From 1aff02ea555b520ea10843b7682f1f9d72e97e94 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Tue, 16 Feb 2021 19:08:22 +0530 Subject: [PATCH] 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 --- .../bluedroid/classic_bt/bt_discovery/main/bt_discovery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_discovery/main/bt_discovery.c b/examples/bluetooth/bluedroid/classic_bt/bt_discovery/main/bt_discovery.c index 7975aaf97b..64c7e789ff 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_discovery/main/bt_discovery.c +++ b/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; }