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

Header file: include/zigbee/zigbee_error_handler.h
Source file: ../nrfxlib/zboss/src/zb_error/zb_error_to_string.c
group zb_error

This file defines the error handler utilities for ZBOSS error codes.

Defines

ZB_ERROR_CHECK(ERR_CODE)

Macro for calling the error handler function if the supplied ZBOSS return code is different than RET_OK.

Parameters:
  • ERR_CODE[in] Error code supplied to the error handler.

ZB_COMM_STATUS_CHECK(COMM_STATUS)

Macro for calling the error handler function if the return code for bdb_start_top_level_commissioning indicates that the BDB procedure did not succeed.

Parameters:
  • COMM_STATUS[in] Value returned by the bdb_start_top_level_commissioning function.