Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why did the softdevice handler's API change?

Why did the softdevice handler's API change?

sorry for a general question.
I used SDK 13.
and
Now, I am porting my software to SDK 15.
So, I have simple question.
Why did the softdevice handler's API change?
I want to know the meaning changed it.

(from SDK14 migration guide)
> The scheme for dispatching events from the SoftDevice to the libraries and services has changed:
> the ble_evt_dispatch and sys_evt_dispatch functions have been removed,
> in favor of registering BLE and SoC event observers using
> the NRF_SDH_BLE_OBSERVER and NRF_SDH_SOC_OBSERVER macros, respectively.

Thanks,

Parents
  • Hi,

      

    The previous implementation of the softdevice_handler was centered around the main.c application, and the on_ble_evt handler.

    All the hooks into ble-services, bond handling, flash handling, and other SoftDevice related events needed to go through the main.c implementations.

    One of the issues that we at technical support saw very often is that a developer had added a new library, but forgot to add the library-handler function call to the main.c::on_ble_evt() (or sys_evt_handler), thus the application did not work properly.

     

    With the nrf_sdh_* libraries, you can now add a new BLE service to your example, and the handler for the BLE service recently added will be loaded into a .section for the linker to dynamically place.

    nrf_sdh_* will look at this .section, and loop over it for all the registered "subscribers".

    This removes manual labor for the developer, and optimizes the application as each function call is not routed from the main file anymore.

     

    This thread might also be of interest:

    https://devzone.nordicsemi.com/f/nordic-q-a/30470/dynamic-allocate-ble-observers/

     

    Best regards,

    Håkon

  • Hi,

    Thank you for your reply.
    I understood it.

    At old interface,
    if I want to change the handler priority, I changed the order of the hanler calling.

    At new interface,
    if I want to change the handler priority, shuld I set BLE_XXXX_OBSERVER_PRIO?

    Best regards,

    Hasegawa

Reply Children
Related