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

Updating Advertising Packet dynamically using ble_advdata_set

Hello, I have some confusion about updating advertising packet dynamically.

I am using nrf52832 with SDK v12.3.0. I am sending datas from sensor in advertising packet(manuf specific data), the Adv Interval is 187.5ms. Now my sensor data changes so I change advertising packet once a minute without stopping advertising. I have used ble_advdata_set() to update advertising packet without using radio notification, but some discussions recommend to use radio notification.

I am not sure if it is right to just use ble_advdata_set() although it seems ok. Could some friend answers my confusion, thanks a lot!

  • Hello,

    It is absolutely fine to not use radio notification. The reason that someone wants to use radio notifications is that they want to change the advertising data every advertising interval. The reason why it is difficult to do this just using timers is that there is a random delay of 0ms-10ms added between each advertisement, in addition to the advertising interval. Hence, a timer would drift, which is not acceptable for some applications.

    If you only need to change the advertising data once a minute, using a timer is absolutely fine.

    Just to be sure:

    Have you checked that the advertising data is actually changed when you change it without stopping the advertising and starting again? The reason I ask is that I haven't tested right now whether this is possible in SDK12.3.0, and it varies between the different versions of the SDK.

    Best regards,

    Edvin

Related