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

Getting time ticks or adv packet count

Is there an internal counter for the number of packets transmitted since power on?

Im trying to change the advertising packet content after a timer is expired or a certain count, but i get invalid parameter error in advertising_init() and advertising_start() functions when i call them for the 3rd time. I think this can solve the problem about changing the packet but im trying to understand when to change it first.

What would be the preferred approach for getting the timer ticks since the board is powered on or get number of packets transmitted so far?

Im using ble_app_hrs example with nrf51-dk on sdk6.1.0 and sd 7.0.0.

Parents
  • I think you should be able to use the Radio Notification for this. Please see this tutorial.

  • Thank you Petter, I followed through the tutotial you linked. I'm getting radio notifications, yet they don't seem to be getting affected by the advertising interval. For example, when I set the interval to 5 seconds and increase a counter each time I receive radio_off notification in radio_notification_evt_handler the counter is 30 after 15 seconds. Then I change the advertising interval to 300 ms and the counter is still 30 after 15 seconds. I'm using the highest proiority(1) I can use and shortest notification distance(NRF_RADIO_NOTIFICATION_DISTANCE_800US), according to the docs. I double checked that the advertising packets are being transmitted at the interval I'm setting. Do you think this is normal?

Reply
  • Thank you Petter, I followed through the tutotial you linked. I'm getting radio notifications, yet they don't seem to be getting affected by the advertising interval. For example, when I set the interval to 5 seconds and increase a counter each time I receive radio_off notification in radio_notification_evt_handler the counter is 30 after 15 seconds. Then I change the advertising interval to 300 ms and the counter is still 30 after 15 seconds. I'm using the highest proiority(1) I can use and shortest notification distance(NRF_RADIO_NOTIFICATION_DISTANCE_800US), according to the docs. I double checked that the advertising packets are being transmitted at the interval I'm setting. Do you think this is normal?

Children
No Data
Related