Update 'adv_data_raw' in my BLE ADV application

GustavoGB
Posts: 18
Joined: Fri Jan 15, 2021 1:46 am

Update 'adv_data_raw' in my BLE ADV application

Postby GustavoGB » Fri Jun 11, 2021 10:53 pm

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

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Update 'adv_data_raw' in my BLE ADV application

Postby chegewara » 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.

GustavoGB
Posts: 18
Joined: Fri Jan 15, 2021 1:46 am

Re: Update 'adv_data_raw' in my BLE ADV application

Postby GustavoGB » 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.
Maybe if it should implement some flag.
What flag could it be? I need to update the raw data every certain time interval

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Update 'adv_data_raw' in my BLE ADV application

Postby chegewara » Sat Jun 12, 2021 7:59 pm

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.

Who is online

Users browsing this forum: scerush and 122 guests