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

ble_radio_notification_evt_handler_t timeslot API and softdevice

I am using the timeslot API and softdevice to advertise two separate types of message. This works well. But I have also used ble_radio_notification_evt_handler_t in an attempt to change the payload of the softdevice advertisement.

Unfortunately through experimentation I have found that ble_radio_notification_evt_handler_t is called on any radio activity. There doesn't appear to be a context.

Any ideas how to run code before or after (just) the softdevice advertises?

I'm using S130 V11 nrf51

Many thanks in advance

John

  • Hi Kristin, Roger,

    I believe that timer actually might solve it if you set it to the middle of the adv. interval then jitter should oscillate a bit but in average you could run both adv. interval and timer in sync. Of course this isn't usable if you need 100% precision over long period of time (hours/days).

    Cheers Jan

  • I'm currently running a 1 second timer and updating the ble advertising data when the timer event occurs. The softdevice advertises every 500ms Over the air I see either 1,2 or 3 advertisements with the same payload I think this means that the advertisement intervals are not sync'd with the standard app timers -I guess this could be due to the time slot advertisements clashing with the softdevice advertisements It's a shame there's no context available in the ble_radio_notification_evt_handler_t cbh. I guess we could synchronise the updates by putting some sort of semaphore between the main timer and the ble_radio_notification_evt_handler_t cbh . Maybe also speed up the main timer to 500ms

  • Johnofleek

    can you explain in a bit more detail why the radio notification doesnt work for you?

    I have not personally used it, but I thought there were settings to be notified in advance of the transmission.

    Are you just advertising e.g. is this just a beacon?

    BTW. Are you aware that virtually no receiver , especially in a phone, gets data every advertising transmission.

    In my experience, phone apps often only get notified of about a third of the actual transmissions

  • could you start a timer from a radio notification event, for half the period of the advertising ?

    I still dont understand the issue with "context" here, cant context issues be overcome with a global semaphore

  • Roger The radio notification event looks like it's driven - not surprisingly - by all radio events - so in my case we get 10ish events per second from the timeslot , 2ish per second for the soft device advert and some additional ones. You are correct you can select a notification delay and also test to see if the event indicating the start or end of the timeslot. I was hoping the events only occurred for softdevice related radio events but I was wrong. It would be great if we could sync the advertising data with the transmissions - but without a "source" indicator I think we will have to live with the random ish updates. Thanks for the info on the receivers missing data - in our use case it's not the end of the world but it would be good if we weren't adding additional random behaviour (1,2 or 3 transmissions) to the system

Related