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 APP_ERROR_HANDLER call after softdevice API ?

Hi everyone,

I've noticed in SDK examples such as the ble_app_hrs that call APP_ERROR_HANDLER after softdevice API Call.

What is the reason for this API call?

Any side effect if not call this function after Softdevice API call ?

Please suggest any alternate solution or any recommendation for  that.

Regards,

Himansu

  • Hi,

    The Softdevice API functions return a specific code dependent on the result of the Softdevice API call. This is a way for the Softdevice to signalize to the application if an error has occurred, such as when some requirements has not been specified or missing parameters etc. The APP_ERROR_CHECK() that is used in many of our examples checks the return value of the API call, and "asserts" by calling the error handler if the return value is non-zero which indicates an error. We do therefore not recommend to remove these checks in the code, doing so will prevent the SD to signalize any critical errors.

    regards

    Jared 

Related