If you are asking a question, please follow this template:
- My goal is: Retrieve the manufacturer beacon data from a BLE service advertisement, which is in bold in following service data result from mgos_bt_gap debug:
Scan result debug:
SCAN_RESULT 0 e9:83:8f:e4:a0:90 [ST10202988] manu [] dt 2 at 1 et 0 rssi -56 adl 31 [0201060fff008aeeb3589b203f1514ff6400090b0953543130323032393838] srl 18 [110763fe4ef0b6e24bab901c8128010001a9]
- My actions are:
const struct mg_str manufacturerData = mgos_bt_gap_parse_adv_data(ble_data->adv_data, MGOS_BT_GAP_EIR_MANUFACTURER_SPECIFIC_DATA);
(that enum means 0xFF / 255, which matches the manufacturer’s datasheet as well)
3. The result I see is:
Absolutely empty.
- My expectation & question is: pulling out the data “008aeeb3589b203f1514ff640009” per the scan result. I’ve even modified esp32_bt_gap to make sure something wasn’t overwriting the data.
const struct mg_str name = mgos_bt_gap_parse_name(arg.adv_data);
const struct mg_str manuData = mgos_bt_gap_parse_adv_data(
arg.adv_data, MGOS_BT_GAP_EIR_MANUFACTURER_SPECIFIC_DATA);
LOG(LL_DEBUG,
("SCAN_RESULT %d %s [%.*s] manu [%.*s] dt %d at %d et %d rssi %d "
"adl %d [%s] srl %d [%s]",
p->search_evt, esp32_bt_addr_to_str(p->bda, buf), (int) name.len,
name.p,
(int) manuData.len, manuData.p,
p->dev_type,
p->ble_addr_type, p->ble_evt_type, p->rssi,
(int) arg.adv_data.len, ad_hex, (int) arg.scan_rsp.len, sr_hex));
What I got:
SCAN_RESULT 0 e9:83:8f:e4:a0:90 [ST10202988] manu [] dt 2 at 1 et 0 rssi -56 adl 31 [0201060fff008aeeb3589b203f1514ff6400090b0953543130323032393838] srl 18 [110763fe4ef0b6e24bab901c8128010001a9]
Please, any tips?