Setup TX power in BLE raw data gap advertizing

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Setup TX power in BLE raw data gap advertizing

Postby davdav » Fri Mar 23, 2018 3:38 pm

Hi,

I'm trying to insert in my advertizing packet, using raw data function

Code: Select all

esp_ble_gap_config_adv_data_raw
the TX power (in practice GAP index 0x0A as per BLE specification).

Code: Select all

static uint8_t raw_adv_data[] = {
        //Appearance (384 generic remote control)
        0x03, 0x19, 0x80, 0x01,
	/* flags */
        0x02, 0x01, 0x06,
        /* tx power */
        0x02, 0x0a, 0xdb,
        /* Device name */
        0x06, 0x09, 'A', 'v', 'i', 'o', 'r'
};
In the above example it is fixed to 0xdb, but I would like to retrieve the effective TX power of the ESP32.

How can I get it? If it is not possible to have it with an API, how can I compose the

Code: Select all

esp_ble_adv_data_t
structure in order to setup the device name( GAP index 0x09) (in above example 'A', 'v', 'i', 'o', 'r').
Should I put in

Code: Select all

uint8_t *p_service_data
element?

Thank you.

Who is online

Users browsing this forum: Baidu [Spider] and 110 guests