소스 검색

esp-idf: Corrected check of Class of Device for discovered devices

Current code stopped inquiry if major class is not Phone. Modified the
condition to consider for both Phone and Audio to cover majority of real
world devices.

Closes https://github.com/espressif/esp-idf/issues/6548
Rahul Tank 5 년 전
부모
커밋
1aff02ea55
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      examples/bluetooth/bluedroid/classic_bt/bt_discovery/main/bt_discovery.c

+ 2 - 1
examples/bluetooth/bluedroid/classic_bt/bt_discovery/main/bt_discovery.c

@@ -149,7 +149,8 @@ static void update_device_info(esp_bt_gap_cb_param_t *param)
     }
 
     if (!esp_bt_gap_is_valid_cod(cod) ||
-            !(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_PHONE)) {
+	    (!(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_PHONE) &&
+             !(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_AV))) {
         return;
     }