void ble_gatt_server_module_enable(u8 en)
{
log_info(“mode_en:%d\n”, en);
if (en) {
__this->adv_ctrl_en = 1;
__gatt_server_check_auto_adv();
} else {
ble_gatt_server_adv_enable(0);
-
__this->adv_ctrl_en = 0; //要放到上个语句的后面 ble_gatt_server_disconnect_all();
-
}__gatt_server_set_work_state(INVAIL_CONN_HANDLE, BLE_ST_IDLE, 0); //设置BLE状态为IDLE
}