This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Radio notification only after BLE radio

I'd like to get a notification every time after the radio has been active (as shown as NACTIVE in the S110 rev 1.3 spec). How can I make this mappen?

I see two functions available: sd_radio_notification_cfg_set and ble_radio_notification_init. Are these two functions supposed to work together or should we only use the ble_radio_notification_init? This does not have configuration of the notification events, only the distance to next active radio period...

Parents
  • You can just use standard ble_radio_notification_init function, that already calling sd_radio_notification_cfg inside, it will generate interrupts on both inactive to active and active to inactive events and you can determine the event type with radio_active value in ble_on_radio_active_evt handler.

    UPD:

    NRF_RADIO_NOTIFICATION_DISTANCE_NONE can only be used when the event does not have a notification. NRF_RADIO_NOTIFICATION_DISTANCE parameter is only distance before radio activity and there shoudn't be delay with interrupt after radio activity. Here is written: "The distance from the active notification to start of radio activity."

    I have done some more debug'ing here, and the radio_active flag seems to be true if one has a connection active. Hence, there is no way to determine if the interrupt happens before or after the radio transmission.

    Why? When ble_on_radio_active_evt handler will be called with (radio_active == true) it means that now after NRF_RADIO_NOTIFICATION_DISTANCE_XXX time will be radio activity. If ble_on_radio_active_evt handler will be called with (radio_active == false) it means that radio activity ended and now radio is inactive.

Reply
  • You can just use standard ble_radio_notification_init function, that already calling sd_radio_notification_cfg inside, it will generate interrupts on both inactive to active and active to inactive events and you can determine the event type with radio_active value in ble_on_radio_active_evt handler.

    UPD:

    NRF_RADIO_NOTIFICATION_DISTANCE_NONE can only be used when the event does not have a notification. NRF_RADIO_NOTIFICATION_DISTANCE parameter is only distance before radio activity and there shoudn't be delay with interrupt after radio activity. Here is written: "The distance from the active notification to start of radio activity."

    I have done some more debug'ing here, and the radio_active flag seems to be true if one has a connection active. Hence, there is no way to determine if the interrupt happens before or after the radio transmission.

    Why? When ble_on_radio_active_evt handler will be called with (radio_active == true) it means that now after NRF_RADIO_NOTIFICATION_DISTANCE_XXX time will be radio activity. If ble_on_radio_active_evt handler will be called with (radio_active == false) it means that radio activity ended and now radio is inactive.

Children
Related