BLE scan and read advertising name

User avatar
fasani
Posts: 184
Joined: Wed Jan 30, 2019 12:00 pm
Location: Berlin
Contact:

BLE scan and read advertising name

Postby fasani » Thu Jan 20, 2022 9:20 am

Hi all,
here trying to understand how the Bluedroid works in IDF. I did some stuff a while ago in Arduino-esp32 but I wanted to learn it also with the ESP-IDF framework.
As a test I'm using one of this Smart price labels that advertises BLE with the name of: ESL_545778

I've tried so far all examples in the examples/bluetooth/bluedroid/ble section. Starting with the GATT client.
The problem I'm facing at the very beginning is that I can see the MAC address but the read advertising name part is not delivering any name:

Code: Select all

adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,
                                                ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);
if (adv_name_len>0) {
   printf("FOUND device: ");
   esp_log_buffer_char(GATTC_TAG, adv_name, adv_name_len);
 }
I can see this works for Xiaomi "Mi Band" watches where the name is read correctly. But many other devices that are known to publish the name at home are not coming.

Just to test that is not the ESP32-WROVER-B that I'm using, tested with this simple Arduino-esp32 example:
ESP32 BLE Scanner

And it does the trick:
Name: ESL_545778, Address: a4:c1:38:54:57:78
Address: fc:f1:36:c9:08:4f, manufacturer data: 7500420401808efcf136c9084f16bb6e9cae090149a500000000

Is there maybe any BLE settings that I'm missing so I can also discover the advertised name of more devices?
I tried many different things without success so far.
PHP Engineer | cale.es E-Ink Screen manager

User avatar
fasani
Posts: 184
Joined: Wed Jan 30, 2019 12:00 pm
Location: Berlin
Contact:

Re: BLE scan and read advertising name

Postby fasani » Sun Jan 23, 2022 9:02 am

Tried many different things and still no luck with this one. I have an idea: will research how arduino framework does and try to replicate it in the IDF…
PHP Engineer | cale.es E-Ink Screen manager

Who is online

Users browsing this forum: No registered users and 30 guests