Flags ignored in BLE advertising

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

Flags ignored in BLE advertising

Postby aschweiz » Wed Dec 21, 2016 1:46 pm

The struct esp_ble_adv_params_t contains a 'flag' field:

uint8_t flag; /*!< Advertising flag of discovery mode */

It seems that this field is ignored in the implementation?

Greetings
Andreas

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

Re: Flags ignored in BLE advertising

Postby aschweiz » Thu Jan 05, 2017 10:32 am

I think I've found the issue:

It seems that the flags are lost in the BLE stack, in file "btc_gap_ble.c", function "btc_to_bta_adv_data".
The input object "p_adv_data" still contains them, but they're not copied to the output object "bta_adv_data".

By changing...

Code: Select all

    if (p_adv_data->flag != 0) {
        mask = BTM_BLE_AD_BIT_FLAGS;
    }
... to ...

Code: Select all

    if (p_adv_data->flag != 0) {
        mask = BTM_BLE_AD_BIT_FLAGS;
        bta_adv_data->flag = p_adv_data->flag; // Added this line to copy the flags
    }
... I got the flags working correctly.

Could someone please verify and fix this issue in the repository?

Thanks and all the best for 2017!
Andreas

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: Flags ignored in BLE advertising

Postby michaelwgnr » Thu Jan 05, 2017 2:12 pm

There is actually a corresponding pull request on github (not by me).

I agree, it would be nice to have this included in the next update.

Who is online

Users browsing this forum: No registered users and 30 guests