From 5bcc93a2131940725a3e8d354cdf4bc4cea09264 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 af753cb09e..e5782908fa 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; }