Zigbee error handler
Note
Zigbee R22 is currently in maintenance mode, and it is not recommended to use it for new Zigbee designs. While critical bug fixes and security updates will be provided as necessary, it will not receive any enhancements or new features. The Zigbee R23 add-on represents Nordic’s primary solution for future Zigbee developments, offering improvements, support for new features, and support for the nRF52840 SoC and new platforms such as the nRF54L series.
The Zigbee error handler library provides a set of macros that can be used to assert on nrfxlib’s ZBOSS Zigbee stack API return codes.
The assertion is implemented by a call to the zb_osif_abort() function.
Additionally, you can enable the library to log the error code name before the assertion.
Functions that resolve the numeric error code to printable string are defined in the zb_error_to_string.c source file in nrfxlib.
Configuration
To use this library, include its header in your application and pass the error code that should be checked using its macros.
Additionally, if you want the error code to be printed to log, enable the CONFIG_LOG and CONFIG_ZBOSS_ERROR_PRINT_TO_LOG Kconfig options.
The CONFIG_ZBOSS_ERROR_PRINT_TO_LOG option automatically enables the CONFIG_ZIGBEE_ERROR_TO_STRING_ENABLED Kconfig option, which obtains the ZBOSS error code name.
The library also provides a macro for checking the value returned by the bdb_start_top_level_commissioning() function.
API documentation
include/zigbee/zigbee_error_handler.h../nrfxlib/zboss/src/zb_error/zb_error_to_string.c- group ZBOSS error handling utilities
This file defines the error handler utilities for ZBOSS error codes.
Module for converting ZBOSS error code into a printable string.
Functions
-
char const *zb_error_to_string_get(zb_ret_t code)
Function for getting a printable error string.
Note
This function cannot fail. For the function that may fail with error translation, see zb_error_to_string_find.
- Parameters:
code – Error code to convert.
- Returns:
Pointer to the printable string. If the string is not found, it returns a simple string that says that the error is unknown.
-
char const *zb_error_to_string_find(zb_ret_t code)
Function for finding a printable error string.
This function gets the error string in the same way as zb_error_to_string_get, but if the string is not found, it returns NULL.
- Parameters:
code – Error code to convert.
- Returns:
Pointer to the printable string. If the string is not found, NULL is returned.
-
char const *zb_error_to_string_get(zb_ret_t code)