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
  • Like this:

    bool current_radio_active_state = false;
    
    void ble_on_radio_active_evt(bool radio_active)
    {
        current_radio_active_state = radio_active;
    }
    
    static void radio_notification_init(void)
    {
        uint32_t err_code;
    
        err_code = ble_radio_notification_init(NRF_APP_PRIORITY_LOW,
                                               NRF_RADIO_NOTIFICATION_DISTANCE_800US,
                                               ble_on_radio_active_evt);
        APP_ERROR_CHECK(err_code);
    }
    
    
    int main(void)
    {
    ...
        radio_notification_init();
    ...
    }
    
Reply
  • Like this:

    bool current_radio_active_state = false;
    
    void ble_on_radio_active_evt(bool radio_active)
    {
        current_radio_active_state = radio_active;
    }
    
    static void radio_notification_init(void)
    {
        uint32_t err_code;
    
        err_code = ble_radio_notification_init(NRF_APP_PRIORITY_LOW,
                                               NRF_RADIO_NOTIFICATION_DISTANCE_800US,
                                               ble_on_radio_active_evt);
        APP_ERROR_CHECK(err_code);
    }
    
    
    int main(void)
    {
    ...
        radio_notification_init();
    ...
    }
    
Children
  • So, just asking for clarification. If I use this example to set ble_radio_notification_init in conjunction with sd_radio_notification_cfg and set the TYPE to NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, it will ignore the distance setting and provide a radio notification on inactive?

  • When I use this code with SDK 7.1, I get this warning:" warning: implicit declaration of function 'ble_radio_notification_init' 'is invalid in C99". I don't get compilation errors, but I cannot build the project. Why could this be?

Related