@@ -155,6 +155,8 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
155
155
if (!(uxBits & BLE_GATTS_IDLE_BIT )) {
156
156
esp_ble_gatts_close (gl_profile_tab [PROFILE_A_APP_ID ].gatts_if ,
157
157
gl_profile_tab [PROFILE_A_APP_ID ].conn_id );
158
+ esp_ble_gatts_close (gl_profile_tab [PROFILE_B_APP_ID ].gatts_if ,
159
+ gl_profile_tab [PROFILE_B_APP_ID ].conn_id );
158
160
}
159
161
os_power_restart_wait (BT_SPP_IDLE_BIT | BT_A2DP_IDLE_BIT | BLE_GATTS_IDLE_BIT );
160
162
#else
@@ -181,7 +183,11 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
181
183
ESP_LOGI (BT_SPP_TAG , "GET command: FW+UPD:%ld" , image_length );
182
184
183
185
EventBits_t uxBits = xEventGroupGetBits (user_event_group );
184
- if (image_length != 0 && !(uxBits & BT_OTA_LOCKED_BIT ) && uxBits & BLE_GATTS_IDLE_BIT ) {
186
+ if (image_length != 0 && !(uxBits & BT_OTA_LOCKED_BIT )
187
+ #ifdef CONFIG_ENABLE_BLE_CONTROL_IF
188
+ && (uxBits & BLE_GATTS_IDLE_BIT )
189
+ #endif
190
+ ) {
185
191
xEventGroupClearBits (user_event_group , KEY_SCAN_RUN_BIT );
186
192
187
193
esp_bt_gap_set_scan_mode (ESP_BT_NON_CONNECTABLE , ESP_BT_NON_DISCOVERABLE );
@@ -227,7 +233,11 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
227
233
data_recv = 0 ;
228
234
229
235
esp_spp_write (param -> write .handle , strlen (rsp_str [0 ]), (uint8_t * )rsp_str [0 ]);
230
- } else if (uxBits & BT_OTA_LOCKED_BIT || !(uxBits & BLE_GATTS_IDLE_BIT )) {
236
+ } else if (uxBits & BT_OTA_LOCKED_BIT
237
+ #ifdef CONFIG_ENABLE_BLE_CONTROL_IF
238
+ || !(uxBits & BLE_GATTS_IDLE_BIT )
239
+ #endif
240
+ ) {
231
241
esp_spp_write (param -> write .handle , strlen (rsp_str [3 ]), (uint8_t * )rsp_str [3 ]);
232
242
} else {
233
243
esp_spp_write (param -> write .handle , strlen (rsp_str [2 ]), (uint8_t * )rsp_str [2 ]);
0 commit comments