Ver Fonte

avoid wrongly restart discovery

jincheng há 3 anos atrás
pai
commit
8a7ca296d5

+ 3 - 1
examples/bluetooth/bluedroid/classic_bt/a2dp_source/main/main.c

@@ -213,7 +213,9 @@ static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
     switch (event) {
     /* when device discovered a result, this event comes */
     case ESP_BT_GAP_DISC_RES_EVT: {
-        filter_inquiry_scan_result(param);
+        if (s_a2d_state == APP_AV_STATE_DISCOVERING) {
+            filter_inquiry_scan_result(param);
+        }
         break;
     }
     /* when discovery state changed, this event comes */