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

How to use radio notification in IoT softdevice

I need to calculate radio on time in IoT SDK but IoT softdevice don't provide ble_radio_notification (in sdk components) and nvic functions (don't have nrf_nvic.h in softdavice headers). Do you have any idea to solve this? And when we have new update of IoT sdk + softdevice?

Parents
  • Hi,

    If you look into the radio notification c files the SoftDevice callas are pretty simple, to initialize it call the following.

    err_code = sd_nvic_ClearPendingIRQ(SWI1_IRQn);
    APP_ERROR_CHECK(err_code);
    err_code = sd_nvic_EnableIRQ(SWI1_IRQn);
    APP_ERROR_CHECK(err_code);
    err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_YOURTYPEHERE, NRF_RADIO_NOTIFICATION_DISTANCE_YOURDISTANCEHERE);   //Set desired type and distance
    APP_ERROR_CHECK(err_code);
    

    Make sure that you call this right after the SoftDevice is initialized.

    Best regards,

    Øyvind

Reply
  • Hi,

    If you look into the radio notification c files the SoftDevice callas are pretty simple, to initialize it call the following.

    err_code = sd_nvic_ClearPendingIRQ(SWI1_IRQn);
    APP_ERROR_CHECK(err_code);
    err_code = sd_nvic_EnableIRQ(SWI1_IRQn);
    APP_ERROR_CHECK(err_code);
    err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_YOURTYPEHERE, NRF_RADIO_NOTIFICATION_DISTANCE_YOURDISTANCEHERE);   //Set desired type and distance
    APP_ERROR_CHECK(err_code);
    

    Make sure that you call this right after the SoftDevice is initialized.

    Best regards,

    Øyvind

Children
Related