Page 1 of 1

Flags ignored in BLE advertising

Posted: Wed Dec 21, 2016 1:46 pm
by aschweiz
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

Re: Flags ignored in BLE advertising

Posted: Thu Jan 05, 2017 10:32 am
by aschweiz
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

Re: Flags ignored in BLE advertising

Posted: Thu Jan 05, 2017 2:12 pm
by michaelwgnr
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.