This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Change advertisement manuf_specific_data once a second

Currently I am set timeout to one second and then on BLE_GAP_EVT_TIMEOUT:

  • modify data
  • advertising_init();
  • advertising_start();

Are there more correct ways to solve this task?

My main concern that ble_advdata_set is not thread safe and if I will modify data and call ble_advdata_set once a second I can send some corrupted packets.

Parents
  • Agree with @John DeWitt here. As long as you change the content when the radio is not in active mode, you will be fine. You could use the radio notification functionality in the softdevice to get notification on when there will be a radio event. This will give you indications on whether or not it would be safe to write.

Reply
  • Agree with @John DeWitt here. As long as you change the content when the radio is not in active mode, you will be fine. You could use the radio notification functionality in the softdevice to get notification on when there will be a radio event. This will give you indications on whether or not it would be safe to write.

Children