I built a small PoC on rp-pico using the btstack, basically rework of the standalone simple BLE service.
Like in the example, BLE uses advertisement data, and in the example there are some constant value without explanation, as well the documentation is not really clear about the data
Advertisement data in server_common.c:
#define APP_AD_FLAGS 0x06
static uint8_t adv_data[] = {
// Flags general discoverable
0x02, BLUETOOTH_DATA_TYPE_FLAGS, APP_AD_FLAGS,
// Name
0x17, BLUETOOTH_DATA_TYPE_COMPLETE_LOCAL_NAME, 'P', 'i', 'c', 'o', ' ', '0', '0', ':', '0', '0', ':', '0', '0', ':', '0', '0', ':', '0', '0', ':', '0', '0',
0x03, BLUETOOTH_DATA_TYPE_COMPLETE_LIST_OF_16_BIT_SERVICE_CLASS_UUIDS, 0x1a, 0x18,
};
I'd like to know - what is meaning of the values?
As Bluetooth is a manufacturer-independent standard, the specification can of course be found on the pages of the Bluetooth SIG.
The actual Bluetooth Advertising PDU in your example consists of 3 elements: These elements always have the same structure and consist of one byte for the length specification, one byte for the type specification and the rest as payload.
In your case, the first element must be interpreted in this way:
Tag: 01 Length: 02 Value: 06
Flags
-------0 LE Limited Discoverable Mode
------1- LE General Discoverable Mode
-----1-- BR/EDR Not Supported
----0--- Simultaneous LE and BR/EDR to Same Device Capable (Controller)
---0---- Simultaneous LE and BR/EDR to Same Device Capable (Host)
000----- Reserved for future use
and the rest of your PDU will be decoded in the same way:
Tag: 09 Length: 23 Value: 50 69 63 6f 20 30 30 3a 30 30 3a 30 30 3a 30 30 3a 30 30 3a 30 30
Complete Local Name
Local Name: "Pico 00:00:00:00:00:00"
Tag: 03 Length: 03 Value: 1a 18
Complete List of 16-bit Service Class UUIDs
16-bit Service UUID: 0x181A "Environmental Sensing"