Page 1 of 1

Update 'adv_data_raw' in my BLE ADV application

Posted: Fri Jun 11, 2021 10:53 pm
by GustavoGB
Hi. I'm having trouble updating the BLE Advertising Raw Data.
I have taken as an example the ibeacon example of esp-idf, however this example does not allow me to update the raw data in real time since no more events are produced once the process has started.
I would like to know if I can force some event (timer style) to be able to make it work an update of values in raw data. Or perhaps there is another better option, and the ibeacon example was not the best in this case.
Thanks

Re: Update 'adv_data_raw' in my BLE ADV application

Posted: Sat Jun 12, 2021 12:40 am
by chegewara
Why not update adv_raw_data in app_main or any other place you want?
Maybe you will need to add some flag in events, that will tell you when you can setup advertising first time, but i believe you can try without it.

Re: Update 'adv_data_raw' in my BLE ADV application

Posted: Sat Jun 12, 2021 1:32 am
by GustavoGB
chegewara wrote:
Sat Jun 12, 2021 12:40 am
Why not update adv_raw_data in app_main or any other place you want?
Maybe you will need to add some flag in events, that will tell you when you can setup advertising first time, but i believe you can try without it.
because Im using the

Code: Select all

esp_ble_gap_config_adv_data_raw()
function, and its a blocking function.
Maybe if it should implement some flag.
What flag could it be? I need to update the raw data every certain time interval

Re: Update 'adv_data_raw' in my BLE ADV application

Posted: Sat Jun 12, 2021 7:59 pm
by chegewara
GustavoGB wrote:
Sat Jun 12, 2021 1:32 am
chegewara wrote:
Sat Jun 12, 2021 12:40 am
Why not update adv_raw_data in app_main or any other place you want?
Maybe you will need to add some flag in events, that will tell you when you can setup advertising first time, but i believe you can try without it.
because Im using the

Code: Select all

esp_ble_gap_config_adv_data_raw()
function, and its a blocking function.
Thats good. You can call it anywhere you want, not just from events handler. Just remember you have to re-start advertising each time.

By flag i mean some bool value which will be set to true in events handler that will tell you when ble stack is ready to set and start advertising. I believe it should be done only 1 time, before first advertising.