Zigbee error handler
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 zb_error
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)