8000 BLE GATTC: Issue reading Advertising/scan response data · Issue #369 · espressif/esp-idf · GitHub
[go: up one dir, main page]

Skip to content
BLE GATTC: Issue reading Advertising/scan response data #369
@lucashutchinson

Description

@lucashutchinson

Hi all,

Hopefully this has not been previously reported.
I am using the esp-idf with the GATT_Client example.
I have got the latest version of the esp-idf (i am currently at commit: 61c7bd3)

I am currently looking into the reading and resolving the advertising and scan response data when performing a BLE scan.

This scan returns various BLE devices I have around me, including another esp32 running an un-modified version of the GATT_Server example.

However fo 5DAA r some reason when I look at the raw advertising data, after the 31st byte the data seems to either be 0x00 or garbage. This means that on some devices only half of the device name is decoded, on others the 128bit uuid is incomplete.

The GATT_Client seems to be receiving at least part of the scan response data as on one of the devices, part of the data that is in the response packet (at least the first few bytes) are contained in this first 31 bytes.

I initially discovered this when trying to resolve the name of a device which has the full device name in the scan response data rather than the advertising data.

I am reading the raw data using:

 case ESP_GAP_BLE_SCAN_RESULT_EVT: {
        esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;
        switch (scan_result->scan_rst.search_evt) {
        case ESP_GAP_SEARCH_INQ_RES_EVT:
			printf("\nRAW: ");
			for(int j=0; j<62; j++)
			{
				printf("%c", scan_result->scan_rst.ble_adv[j]);
			}

I seem to be able to decode/read other data within the scan result.
Eg, i can read the RSSI and it doesn't seem to be garbage (eg it returns plausible results such as -55dBm)

Please let me know if I am doing something wrong, if you need more information, or if you have a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0