Developing with ZBOSS for Zigbee

Data Structures

struct  zb_zdo_signal_leave_params_s
 Leave parameters. More...
 
struct  zb_zdo_signal_nlme_status_indication_params_s
 NLME status indication parameters. More...
 
struct  zb_zdo_signal_leave_indication_params_s
 Leave Indication parameters. More...
 
struct  zb_zgp_signal_commissioning_params_s
 ZGP commissioning parameters. More...
 
struct  zb_nwk_signal_device_associated_params_s
 Association parameters. More...
 
struct  zb_zdo_signal_device_annce_params_s
 Association parameters. More...
 
struct  zb_zdo_signal_can_sleep_params_s
 Sleep signal parameters. More...
 
struct  zb_zdo_signal_macsplit_dev_boot_params_s
 Macsplit device boot parameters. More...
 
struct  zb_zdo_signal_fb_initiator_finished_params_s
 F&B Initiator Finished signal parameters. More...
 
struct  zb_zdo_signal_device_update_params_s
 Device Updated signal parameters. More...
 
struct  zb_zdo_signal_device_authorized_params_s
 Device Authorized signal parameters. More...
 
struct  zb_zdo_app_signal_hdr_s
 

Macros

#define ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, type)   ((type *)(void *)((((zb_uint8_t *)sg_p) + sizeof(zb_zdo_app_signal_hdr_t))))
 
#define ZB_ZDO_SIGNAL_CUT_HEADER(buf)   zb_buf_cut_left(buf, sizeof(zb_zdo_app_signal_hdr_t))
 Cuts ZBOSS signal headers while keeping the signal parameter (if it was in the buffer). More...
 
#define ZB_HIGH_SEQ_SECURED_REJOIN   4U
 
#define ZB_HIGH_SEQ_UNSECURED_JOIN   5U
 
#define ZB_HIGH_SEQ_UNSECURED_REJOIN   7U
 
#define ZB_GET_APP_SIGNAL_STATUS(param)   zb_buf_get_status(param)
 Get status from the application signal. More...
 

Typedefs

typedef zb_uint8_t zb_zdp_status_t
 Type for ZDP status values. More...
 
typedef zb_uint8_t zb_zdo_app_signal_type_t
 Type for signals passed to zboss_signal_handler(). More...
 
typedef zb_zdo_app_signal_type_t zb_zdo_app_signal_t
 
typedef struct zb_zdo_signal_leave_params_s zb_zdo_signal_leave_params_t
 Leave parameters. More...
 
typedef struct zb_zdo_signal_nlme_status_indication_params_s zb_zdo_signal_nlme_status_indication_params_t
 NLME status indication parameters. More...
 
typedef struct zb_zdo_signal_leave_indication_params_s zb_zdo_signal_leave_indication_params_t
 Leave Indication parameters. More...
 
typedef struct zb_zgp_signal_commissioning_params_s zb_zgp_signal_commissioning_params_t
 ZGP commissioning parameters. More...
 
typedef struct zb_nwk_signal_device_associated_params_s zb_nwk_signal_device_associated_params_t
 Association parameters. More...
 
typedef struct zb_zdo_signal_device_annce_params_s zb_zdo_signal_device_annce_params_t
 Association parameters. More...
 
typedef struct zb_zdo_signal_can_sleep_params_s zb_zdo_signal_can_sleep_params_t
 Sleep signal parameters. More...
 
typedef struct zb_zdo_signal_macsplit_dev_boot_params_s zb_zdo_signal_macsplit_dev_boot_params_t
 Macsplit device boot parameters. More...
 
typedef zb_uint8_t zb_zdo_fb_initiator_finished_status_t
 Type for Status codes for F&B Initiator Finished signal. More...
 
typedef struct zb_zdo_signal_fb_initiator_finished_params_s zb_zdo_signal_fb_initiator_finished_params_t
 F&B Initiator Finished signal parameters.
 
typedef struct zb_zdo_signal_device_update_params_s zb_zdo_signal_device_update_params_t
 Device Updated signal parameters.
 
typedef zb_uint8_t zb_zdo_authorization_type_t
 Type for Authorization types for ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED. More...
 
typedef zb_uint8_t zb_zdo_legacy_device_authorization_status_t
 Type for Authorization statuses for ZB_ZDO_AUTHORIZATION_TYPE_LEGACY value of zdo_authorization_type type. More...
 
typedef zb_uint8_t zb_zdo_tclk_authorization_status_t
 Type for Authorization types for ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED. More...
 
typedef struct zb_zdo_signal_device_authorized_params_s zb_zdo_signal_device_authorized_params_t
 Device Authorized signal parameters.
 
typedef struct zb_zdo_app_signal_hdr_s zb_zdo_app_signal_hdr_t
 
typedef zb_zdo_app_signal_hdr_t zb_zdo_app_event_t
 

Functions

void zboss_signal_handler (zb_uint8_t param)
 
zb_zdo_app_signal_type_t zb_get_app_signal (zb_uint8_t param, zb_zdo_app_signal_hdr_t **sg_p)
 Unpack application signal buffer in zboss_signal_handler() More...
 

ZDP status values

See also
2.4.5 - ZDP Enumeration Description
#define ZB_ZDP_STATUS_SUCCESS   0x00U
 
#define ZB_ZDP_STATUS_INV_REQUESTTYPE   0x80U
 
#define ZB_ZDP_STATUS_DEVICE_NOT_FOUND   0x81U
 
#define ZB_ZDP_STATUS_INVALID_EP   0x82U
 
#define ZB_ZDP_STATUS_NOT_ACTIVE   0x83U
 
#define ZB_ZDP_STATUS_NOT_SUPPORTED   0x84U
 
#define ZB_ZDP_STATUS_TIMEOUT   0x85U
 
#define ZB_ZDP_STATUS_NO_MATCH   0x86U
 
#define ZB_ZDP_STATUS_NO_ENTRY   0x88U
 
#define ZB_ZDP_STATUS_NO_DESCRIPTOR   0x89U
 
#define ZB_ZDP_STATUS_INSUFFICIENT_SPACE   0x8aU
 
#define ZB_ZDP_STATUS_NOT_PERMITTED   0x8bU
 
#define ZB_ZDP_STATUS_TABLE_FULL   0x8cU
 
#define ZB_ZDP_STATUS_NOT_AUTHORIZED   0x8dU
 
#define ZB_ZDP_STATUS_INVALID_INDEX   0x8fU
 
#define ZB_ZDP_STATUS_TIMEOUT_BY_STACK   0xffU
 

Signals passed to zboss_signal_handler()

Note
If an application requires the parameters to be passed to the zboss_signal_handler, it is recommended to introduce the structure according to the pattern below:
typedef struct zb_zdo_app_my_custom_signal_s
{
zb_my_custom_data_type_t my_custom_data;
}
#define ZB_ZDO_SIGNAL_DEFAULT_START   0U
 
#define ZB_ZDO_SIGNAL_SKIP_STARTUP   1U
 
#define ZB_ZDO_SIGNAL_DEVICE_ANNCE   2U
 
#define ZB_ZDO_SIGNAL_LEAVE   3U
 
#define ZB_ZDO_SIGNAL_ERROR   4U
 
#define ZB_BDB_SIGNAL_DEVICE_FIRST_START   5U
 
#define ZB_BDB_SIGNAL_DEVICE_REBOOT   6U
 
#define ZB_SIGNAL_DEVICE_FIRST_START   ZB_BDB_SIGNAL_DEVICE_FIRST_START
 
#define ZB_SIGNAL_DEVICE_REBOOT   ZB_BDB_SIGNAL_DEVICE_REBOOT
 
#define ZB_BDB_SIGNAL_STEERING   10U
 
#define ZB_BDB_SIGNAL_FORMATION   11U
 
#define ZB_BDB_SIGNAL_FINDING_AND_BINDING_TARGET_FINISHED   12U
 
#define ZB_BDB_SIGNAL_FINDING_AND_BINDING_INITIATOR_FINISHED   13U
 
#define ZB_NWK_SIGNAL_DEVICE_ASSOCIATED   18U
 
#define ZB_ZDO_SIGNAL_LEAVE_INDICATION   19U
 
#define ZB_BDB_SIGNAL_WWAH_REJOIN_STARTED   20U
 
#define ZB_ZGP_SIGNAL_COMMISSIONING   21U
 
#define ZB_COMMON_SIGNAL_CAN_SLEEP   22U
 
#define ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY   23U
 
#define ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT   24U
 
#define ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED   47U
 
#define ZB_ZDO_SIGNAL_DEVICE_UPDATE   48U
 
#define ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED   49U
 
#define ZB_NLME_STATUS_INDICATION   50U
 
#define ZB_BDB_SIGNAL_TC_REJOIN_DONE   53U
 
#define ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS   54U
 
#define ZB_BDB_SIGNAL_STEERING_CANCELLED   55U
 
#define ZB_BDB_SIGNAL_FORMATION_CANCELLED   56U
 
#define ZB_SIGNAL_READY_TO_SHUT   57U
 

Status codes for F&B Initiator Finished signal

#define ZB_ZDO_FB_INITIATOR_STATUS_SUCCESS   0U
 
#define ZB_ZDO_FB_INITIATOR_STATUS_CANCEL   1U
 
#define ZB_ZDO_FB_INITIATOR_STATUS_ALARM   2U
 
#define ZB_ZDO_FB_INITIATOR_STATUS_ERROR   3U
 

Security/rejoin states of the 'status' field of APSME-Update-Device

See also
Table 4.40
#define ZB_STD_SEQ_SECURED_REJOIN   0U
 
#define ZB_STD_SEQ_UNSECURED_JOIN   1U
 
#define ZB_DEVICE_LEFT   2U
 
#define ZB_STD_SEQ_UNSECURED_REJOIN   3U
 
#define ZB_MAX_USED_UPD_DEV_STATUS   ZB_STD_SEQ_UNSECURED_REJOIN
 

TC action on incoming Update Device

#define ZB_TC_ACTION_AUTHORIZE   0u
 
#define ZB_TC_ACTION_DENY   1u
 
#define ZB_TC_ACTION_IGNORE   2u
 

Authorization types for @ref ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED

#define ZB_ZDO_AUTHORIZATION_TYPE_LEGACY   0U
 
#define ZB_ZDO_AUTHORIZATION_TYPE_R21_TCLK   1U
 
#define ZB_ZDO_AUTHORIZATION_TYPE_SE_CBKE   2U
 

Authorization statuses for ZB_ZDO_AUTHORIZATION_TYPE_LEGACY value of @ref

zdo_authorization_type type.

#define ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_SUCCESS   0U
 
#define ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_FAILED   1U
 

Authorization statuses for ZB_ZDO_AUTHORIZATION_TYPE_R21_TCLK value of @ref

zdo_authorization_type type

#define ZB_ZDO_TCLK_AUTHORIZATION_SUCCESS   0U
 
#define ZB_ZDO_TCLK_AUTHORIZATION_TIMEOUT   1U
 
#define ZB_ZDO_TCLK_AUTHORIZATION_FAILED   2U
 

Authorization statuses for ZB_ZDO_AUTHORIZATION_TYPE_SE_CBKE value of @ref

For non-success statuses

See also
zb_kec_term_status_t
#define ZB_ZDO_CBKE_AUTHORIZATION_SUCCESS   0U
 

Detailed Description

There are tools that allow an application to handle Zigbee events like network formation, association status, leave indication, and others. Due to its nature, different Zigbee events appear asynchronously and ZBOSS informs the application about it through application signals. The application may handle or ignore a received signal. All application signals are processed in the application with a predefined callback function zboss_signal_handler(). It is mandatory for each application to implement this function, even if there is no need to process a signal.

There are policies that should be taken into account while implementing zboss_signal_handler() function:

Macro Definition Documentation

◆ ZB_BDB_SIGNAL_DEVICE_FIRST_START

#define ZB_BDB_SIGNAL_DEVICE_FIRST_START   5U

Device started for the first time after the NVRAM erase.

When generated:

  • Upon completing the typical device startup (network formation for ZC or rejoin/discovery/association for ZR and ZED).
  • This signal is exclusive to ZB_BDB_SIGNAL_DEVICE_REBOOT
Note
No ZB_BDB_SIGNAL_STEERING or ZB_BDB_SIGNAL_FORMATION signals will be generated.

Status codes:

  • RET_OK: Device started after the NVRAM erase
  • RET_ERROR: An error of any type.

Signal parameters:

  • none
TRACE_MSG(TRACE_APP1, "Device STARTED OK", (FMT__0));
#ifdef TEST_APS_FRAGMENTATION
ZB_SCHEDULE_APP_ALARM(send_frag_data, 0, ZB_TIME_ONE_SECOND / 2);
#endif
break;

◆ ZB_BDB_SIGNAL_DEVICE_REBOOT

#define ZB_BDB_SIGNAL_DEVICE_REBOOT   6U

Device started using the NVRAM contents.

When generated:

Note
No ZB_BDB_SIGNAL_STEERING or ZB_BDB_SIGNAL_FORMATION signals will be generated.

Status codes:

  • RET_OK: Device started using configuration stored in NVRAM
  • RET_ERROR: An error of any type.

Signal parameters:

  • none
TRACE_MSG(TRACE_APP1, "Device RESTARTED OK", (FMT__0));
#ifndef ZB_USE_BUTTONS
/* Do not have buttons in simulator - just start periodic on/off sending */
cmd_in_progress = ZB_FALSE;
ZB_SCHEDULE_APP_ALARM(button_press_handler, 0, 7 * ZB_TIME_ONE_SECOND);
#endif
break;

◆ ZB_BDB_SIGNAL_FINDING_AND_BINDING_INITIATOR_FINISHED

#define ZB_BDB_SIGNAL_FINDING_AND_BINDING_INITIATOR_FINISHED   13U

BDB finding and binding for an initiator endpoint completed.

When generated:

  • F&B with a Target succeeded or F&B initiator timeout expired or cancelled.

Status codes:

Signal parameters:

◆ ZB_BDB_SIGNAL_FINDING_AND_BINDING_TARGET_FINISHED

#define ZB_BDB_SIGNAL_FINDING_AND_BINDING_TARGET_FINISHED   12U

BDB finding and binding for a target endpoint completed.

When generated:

  • F&B target timeout expires.

Status codes:

  • RET_OK: F&B completed successfully.
  • RET_ERROR: An error of any type.

Signal parameters:

  • none

◆ ZB_BDB_SIGNAL_FORMATION

#define ZB_BDB_SIGNAL_FORMATION   11U

BDB network formation completed (Network formation only).

When generated:

  • Upon completing Network formation initiated by bdb_start_top_level_commissioning(ZB_BDB_NETWORK_FORMATION).

Status codes:

Signal parameters:

  • none

◆ ZB_BDB_SIGNAL_FORMATION_CANCELLED

#define ZB_BDB_SIGNAL_FORMATION_CANCELLED   56U

BDB formation cancel request processed

When generated:

Status codes:

  • RET_INVALID_STATE: formation is not in progress
  • RET_PENDING: it is too late to cancel a formation, it will be completed soon
  • RET_IGNORE: cancellation was already requested
  • RET_OK: formation is cancelled successfully

Signal parameters:

  • none

◆ ZB_BDB_SIGNAL_STEERING

#define ZB_BDB_SIGNAL_STEERING   10U

BDB network steering completed (Network steering only).

When generated:

  • Upon completing Network steering initiated by bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING).

Status codes:

Has additional data of type zb_zdo_signal_leave_indication_params_t.

Signal parameters:

  • none

◆ ZB_BDB_SIGNAL_STEERING_CANCELLED

#define ZB_BDB_SIGNAL_STEERING_CANCELLED   55U

BDB steering cancel request processed

When generated:

  • after the cancel request called with bdb_cancel_steering() is processed

Status codes:

  • RET_ILLEGAL_REQUEST: device is a ZC
  • RET_INVALID_STATE: steering for a node not a network is not in progress
  • RET_PENDING: it is too late to cancel a steering, it will be completed soon
  • RET_IGNORE: cancellation was already requested
  • RET_OK: steering is cancelled successfully

Signal parameters:

  • none

◆ ZB_BDB_SIGNAL_TC_REJOIN_DONE

#define ZB_BDB_SIGNAL_TC_REJOIN_DONE   53U

TC rejoin is completed

When generated:

  • Device completes TC rejoin procedure.

Status codes:

  • RET_OK: TC rejoin completed successful
  • RET_ERROR: An error of any type.

Signal parameters:

  • none
TRACE_MSG(TRACE_APP1, "TC rejoin failed, so try it again with interval", (FMT__0));
break; /* ZB_BDB_SIGNAL_TC_REJOIN_DONE */

◆ ZB_BDB_SIGNAL_WWAH_REJOIN_STARTED

#define ZB_BDB_SIGNAL_WWAH_REJOIN_STARTED   20U

WWAH Rejoin start indication.

When generated:

  • Device lost communication with the parent and started WWAH Rejoin procedure.

Status codes:

  • RET_OK: Leave command received from the child device.
  • Does not return error status.

Signal parameters: no

◆ ZB_COMMON_SIGNAL_CAN_SLEEP

#define ZB_COMMON_SIGNAL_CAN_SLEEP   22U

Notifies the application that the MCU can sleep for the specified period of time.

Note
Signal will not be generated if the sleep interval is less than sleep threshold ZB_SCHED_SLEEP_THRESHOLD_MS. To change the sleep threshold see zb_ret_t zb_sleep_set_threshold().

When generated:

  • ZBOSS scheduler detects that the sleep mode can be enabled on the device.

Status codes:

  • RET_OK: The sleep mode can be enabled on the device.
  • Does not return error status.

Signal parameters:

{
/* zb_zdo_signal_can_sleep_params_t *can_sleep_params = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_zdo_signal_can_sleep_params_t); */
#ifdef ZB_USE_SLEEP
#endif
break;
}

◆ ZB_DEVICE_LEFT

#define ZB_DEVICE_LEFT   2U

Device left

◆ ZB_GET_APP_SIGNAL_STATUS

#define ZB_GET_APP_SIGNAL_STATUS (   param)    zb_buf_get_status(param)

Get status from the application signal.

Parameters
param- buffer reference
Returns
status zb_ret_t

◆ ZB_HIGH_SEQ_SECURED_REJOIN

#define ZB_HIGH_SEQ_SECURED_REJOIN   4U

Device rejoin with high security

◆ ZB_HIGH_SEQ_UNSECURED_JOIN

#define ZB_HIGH_SEQ_UNSECURED_JOIN   5U

Device join without high security

◆ ZB_HIGH_SEQ_UNSECURED_REJOIN

#define ZB_HIGH_SEQ_UNSECURED_REJOIN   7U

Device rejoin without high security

◆ ZB_NLME_STATUS_INDICATION

#define ZB_NLME_STATUS_INDICATION   50U

NLME status indication. Application may implement additional logic based on receiving some statuses.

Signal parameter
zb_zdo_signal_nlme_status_indication_params_t
See also
zb_nwk_command_status_t is the full list of NLME statuses

◆ ZB_NWK_SIGNAL_DEVICE_ASSOCIATED

#define ZB_NWK_SIGNAL_DEVICE_ASSOCIATED   18U

Obsolete signal, used for pre-R21 ZBOSS API compatibility. Use ZB_ZDO_SIGNAL_DEVICE_ANNCE signal instead!

When generated:

  • Indicates that there is a new device associated with Zigbee Coordinator or router.

Status codes:

  • RET_OK: New device associated.
  • Does not return error status.

Signal parameters:

◆ ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT

#define ZB_NWK_SIGNAL_NO_ACTIVE_LINKS_LEFT   24U

Notifies the application about the Neighbor Table expiration. It means that the neighbor devices did not send the Link Status messages for ZB_NWK_ROUTER_AGE_LIMIT * ZB_NWK_LINK_STATUS_PERIOD seconds.

When generated:

  • All routes expired (usually when the link is down).

Status codes:

  • RET_OK: All routers expired.
  • Does not return error status.

Signal parameters:

  • none

◆ ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED

#define ZB_NWK_SIGNAL_PANID_CONFLICT_DETECTED   49U

PAN ID conflict has been detected. Application has to decide whether to initiate its resolution or not.

Signal parameter
See also
zb_start_pan_id_conflict_resolution

◆ ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS

#define ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS   54U

Notifies the Zigbee Trust center or router application about permit join status changed.

When generated:
  • Network was just open
  • Network was just closed
Status codes:
  • RET_OK: Device information updated.
  • Does not return error status.
Signal parameters:
Signal handling:
{
zb_uint8_t *permit_duration = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_uint8_t);
TRACE_MSG(TRACE_APP1, "Permit Join Received. Duration: %hd", (FMT__D, (*permit_duration)));
break; /* ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS */
}
Signal generation:

◆ ZB_SIGNAL_READY_TO_SHUT

#define ZB_SIGNAL_READY_TO_SHUT   57U

ZBOSS is ready to shutdown signal

When generated:

  • after ZBOSS preparations to shutdown initiated by zboss_start_shut() is done

After receiving that signal application MUST complete ZBOSS shutdown by calling zboss_complete_shut(). It is impossible to continue ZBOSS work without a restart after calling zboss_start_shut().

Signal parameters:

  • none

◆ ZB_STD_SEQ_SECURED_REJOIN

#define ZB_STD_SEQ_SECURED_REJOIN   0U

Device rejoin with standard security

◆ ZB_STD_SEQ_UNSECURED_JOIN

#define ZB_STD_SEQ_UNSECURED_JOIN   1U

Device join without security

◆ ZB_STD_SEQ_UNSECURED_REJOIN

#define ZB_STD_SEQ_UNSECURED_REJOIN   3U

Device rejoin without standard security

◆ ZB_TC_ACTION_AUTHORIZE

#define ZB_TC_ACTION_AUTHORIZE   0u

authorize device

◆ ZB_TC_ACTION_DENY

#define ZB_TC_ACTION_DENY   1u

deby authorization - msend Remove device

◆ ZB_TC_ACTION_IGNORE

#define ZB_TC_ACTION_IGNORE   2u

ignore Update Device - that meay lead to authorization deny

◆ ZB_ZDO_AUTHORIZATION_TYPE_LEGACY

#define ZB_ZDO_AUTHORIZATION_TYPE_LEGACY   0U

Authorization type for legacy devices ( < r21)

◆ ZB_ZDO_AUTHORIZATION_TYPE_R21_TCLK

#define ZB_ZDO_AUTHORIZATION_TYPE_R21_TCLK   1U

Authorization type for r21 device through TCLK

◆ ZB_ZDO_AUTHORIZATION_TYPE_SE_CBKE

#define ZB_ZDO_AUTHORIZATION_TYPE_SE_CBKE   2U

Authorization type for SE through CBKE

◆ ZB_ZDO_CBKE_AUTHORIZATION_SUCCESS

#define ZB_ZDO_CBKE_AUTHORIZATION_SUCCESS   0U

Authorization success

◆ ZB_ZDO_FB_INITIATOR_STATUS_ALARM

#define ZB_ZDO_FB_INITIATOR_STATUS_ALARM   2U

F&B on the Initiator side is finished by timeout

◆ ZB_ZDO_FB_INITIATOR_STATUS_CANCEL

#define ZB_ZDO_FB_INITIATOR_STATUS_CANCEL   1U

F&B on the Initiator side is canceled

◆ ZB_ZDO_FB_INITIATOR_STATUS_ERROR

#define ZB_ZDO_FB_INITIATOR_STATUS_ERROR   3U

F&B on the Initiator side is failure finished

◆ ZB_ZDO_FB_INITIATOR_STATUS_SUCCESS

#define ZB_ZDO_FB_INITIATOR_STATUS_SUCCESS   0U

F&B with a Target on the Initiator side is success completed

◆ ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_FAILED

#define ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_FAILED   1U

Authorization failed

◆ ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_SUCCESS

#define ZB_ZDO_LEGACY_DEVICE_AUTHORIZATION_SUCCESS   0U

Authorization success

◆ ZB_ZDO_SIGNAL_CUT_HEADER

#define ZB_ZDO_SIGNAL_CUT_HEADER (   buf)    zb_buf_cut_left(buf, sizeof(zb_zdo_app_signal_hdr_t))

Cuts ZBOSS signal headers while keeping the signal parameter (if it was in the buffer).

Parameters
buf- pointer to a zb_buf_t structure. The buffer must be the one passed into zboss_signal_handler.

◆ ZB_ZDO_SIGNAL_DEFAULT_START

#define ZB_ZDO_SIGNAL_DEFAULT_START   0U

Obsolete signal, used for pre-R21 ZBOSS API compatibility. Not recommended to use.

When generated:

  • After the device has been started and the non-BDB commissioning completed.
  • In case of the commissioning error.

Status codes:

  • RET_OK: Device has started and joined the network.
  • RET_ERROR: An error of any type.

Signal parameters:

  • none

◆ ZB_ZDO_SIGNAL_DEVICE_ANNCE

#define ZB_ZDO_SIGNAL_DEVICE_ANNCE   2U

Notifies the application about the new device appearance.

When generated:

  • Upon receiving the Device_annce command.

Status codes:

  • RET_OK: Device_annce command was received.
  • Does not return error status.

Signal parameters:

{
simple_gw_dev_annce_cb(dev_annce_params->device_short_addr);
}
break;

◆ ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED

#define ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED   47U

Notifies the Zigbee Trust center application about a new device is authorized in the network. For Zigbee R21 devices it means that the TCLK exchange procedure was finished, for the legacy devices it means that the Transport key was send to the device.

When generated:

  • Authorization success
  • Authorization failed
  • Authorization timeout

Status codes:

◆ ZB_ZDO_SIGNAL_DEVICE_UPDATE

#define ZB_ZDO_SIGNAL_DEVICE_UPDATE   48U

Notifies the Zigbee Trust center or parent router application about a new device joined, rejoined or left the network.

When generated:

  • Standard device secured rejoin
  • Standard device unsecured join
  • Device left
  • Standard device trust center rejoin

Status codes:

  • RET_OK: Device information updated.
  • Does not return error status.

Signal parameters:

◆ ZB_ZDO_SIGNAL_ERROR

#define ZB_ZDO_SIGNAL_ERROR   4U

Corrupted or incorrect signal information.

When generated:

  • Incorrect buffer length detected by zb_get_app_signal (less then zb_zdo_app_signal_hdr_t)

Status codes:

  • none

Signal parameters:

  • none

◆ ZB_ZDO_SIGNAL_GET_PARAMS

#define ZB_ZDO_SIGNAL_GET_PARAMS (   sg_p,
  type 
)    ((type *)(void *)((((zb_uint8_t *)sg_p) + sizeof(zb_zdo_app_signal_hdr_t))))

Obtains pointer to parameters passed with application signal.

Parameters
[in]sg_p- pointer to application signal
[in]type- parameter type
Returns
pointer to signal parameters

Example

{
erl_interface_leave_handler(leave_params->leave_type);
}
break;

◆ ZB_ZDO_SIGNAL_LEAVE

#define ZB_ZDO_SIGNAL_LEAVE   3U

Notifies the application that the device itself has left the network.

When generated:

  • Upon sending the "Leave" command.

Status codes:

  • RET_OK: Device has sent the "Leave" command.
  • Does not return error status.

Signal parameters:

{
light_control_retry_join(leave_params->leave_type);
}
break;

◆ ZB_ZDO_SIGNAL_LEAVE_INDICATION

#define ZB_ZDO_SIGNAL_LEAVE_INDICATION   19U

Network leave indication.

When generated:

  • The child device has left the network.

Status codes:

  • RET_OK: Leave command received from the child device.
  • RET_ERROR: An error of any type.

Signal parameters:

{
if (!leave_ind_params->rejoin)
{
simple_gw_leave_indication(leave_ind_params->device_addr);
}
}
break;

◆ ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY

#define ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY   23U

Notifies the application that the application specific part of the production configuration was found and restored and provides the application with this data.

When generated:

  • After restoring the production configuration.

Status codes:

  • RET_OK: The application specific part of the production configuration exists.
  • RET_ERROR: An error of any type.

Signal parameters:

  • Passed up with application specific data from production configuration.

◆ ZB_ZDO_SIGNAL_SKIP_STARTUP

#define ZB_ZDO_SIGNAL_SKIP_STARTUP   1U

Notifies the application that ZBOSS framework (scheduler, buffer pool, etc.) has started, but no join/rejoin/formation/BDB initialization has been done yet.

When generated:

Status codes:

  • RET_OK: Only ZBOSS framework has been initialized.
  • Does not return error status.

Signal parameters:

  • none
#ifndef ZB_MACSPLIT_HOST
TRACE_MSG(TRACE_APP1, "ZB_ZDO_SIGNAL_SKIP_STARTUP: start commissioning", (FMT__0));
{
ZB_SCHEDULE_APP_ALARM_CANCEL(sp_com_button_pressed_reset_fd, ZB_ALARM_ANY_PARAM);
}
/* NVRAM is loaded, init relay state */
{
sp_relay_on_off((zb_bool_t )ZB_ZCL_GET_ATTRIBUTE_VAL_8(attr_desc_on_off));
#ifdef SP_CONTROL4_COMPATIBLE
{
/* Increment BOOT_COUNT attribute */
g_dev_ctx.c4_attr.boot_count++;
ZB_SCHEDULE_APP_CALLBACK(sp_write_app_data, 0);
}
#endif /* SP_CONTROL4_COMPATIBLE */
}
/* Have zb_bdb_is_factory_new() check inside */
ZB_SCHEDULE_APP_CALLBACK(sp_start_join, SP_FIRST_JOIN_ATTEMPT);
#endif /* ZB_MACSPLIT_HOST */
break;
#ifdef ZB_MACSPLIT_HOST
case ZB_MACSPLIT_DEVICE_BOOT:
TRACE_MSG(TRACE_APP1, "ZB_MACSPLIT_DEVICE_BOOT: start commissioning", (FMT__0));
{
ZB_SCHEDULE_APP_ALARM_CANCEL(sp_com_button_pressed_reset_fd, ZB_ALARM_ANY_PARAM);
}
/* NVRAM is loaded, init relay state */
{
sp_relay_on_off((zb_bool_t )ZB_ZCL_GET_ATTRIBUTE_VAL_8(attr_desc_on_off));
#ifdef SP_CONTROL4_COMPATIBLE
{
/* Increment BOOT_COUNT attribute */
g_dev_ctx.c4_attr.boot_count++;
ZB_SCHEDULE_APP_CALLBACK(sp_write_app_data, 0);
}
#endif /* SP_CONTROL4_COMPATIBLE */
}
/* Have zb_bdb_is_factory_new() check inside */
ZB_SCHEDULE_APP_CALLBACK(sp_start_join, SP_FIRST_JOIN_ATTEMPT);
break;
#endif /* ZB_MACSPLIT_HOST */

◆ ZB_ZDO_TCLK_AUTHORIZATION_FAILED

#define ZB_ZDO_TCLK_AUTHORIZATION_FAILED   2U

Authorization failed

◆ ZB_ZDO_TCLK_AUTHORIZATION_SUCCESS

#define ZB_ZDO_TCLK_AUTHORIZATION_SUCCESS   0U

Authorization success

◆ ZB_ZDO_TCLK_AUTHORIZATION_TIMEOUT

#define ZB_ZDO_TCLK_AUTHORIZATION_TIMEOUT   1U

Authorization timeout

◆ ZB_ZDP_STATUS_DEVICE_NOT_FOUND

#define ZB_ZDP_STATUS_DEVICE_NOT_FOUND   0x81U

The supplied endpoint was equal to 0x00 or between 0xf1 and 0xff.

◆ ZB_ZDP_STATUS_INSUFFICIENT_SPACE

#define ZB_ZDP_STATUS_INSUFFICIENT_SPACE   0x8aU

The device is not in the proper state to support the requested operation.

◆ ZB_ZDP_STATUS_INV_REQUESTTYPE

#define ZB_ZDP_STATUS_INV_REQUESTTYPE   0x80U

The requested device did not exist on a device following a child descriptor request to a parent.

◆ ZB_ZDP_STATUS_INVALID_EP

#define ZB_ZDP_STATUS_INVALID_EP   0x82U

The requested endpoint is not described by simple descriptor.

◆ ZB_ZDP_STATUS_INVALID_INDEX

#define ZB_ZDP_STATUS_INVALID_INDEX   0x8fU

Custom internal statuses.

◆ ZB_ZDP_STATUS_NO_DESCRIPTOR

#define ZB_ZDP_STATUS_NO_DESCRIPTOR   0x89U

The device does not have storage space to support the requested operation.

◆ ZB_ZDP_STATUS_NO_ENTRY

#define ZB_ZDP_STATUS_NO_ENTRY   0x88U

A child descriptor was not available following a discovery request to a parent.

◆ ZB_ZDP_STATUS_NO_MATCH

#define ZB_ZDP_STATUS_NO_MATCH   0x86U

The unbind request was unsuccessful due to the coordinator or source device not having an entry in its binding table to unbind.

◆ ZB_ZDP_STATUS_NOT_ACTIVE

#define ZB_ZDP_STATUS_NOT_ACTIVE   0x83U

The requested optional feature is not supported on the target device.

◆ ZB_ZDP_STATUS_NOT_AUTHORIZED

#define ZB_ZDP_STATUS_NOT_AUTHORIZED   0x8dU

The index in the received command is out of bounds.

◆ ZB_ZDP_STATUS_NOT_PERMITTED

#define ZB_ZDP_STATUS_NOT_PERMITTED   0x8bU

The device does not have table space to support the operation.

◆ ZB_ZDP_STATUS_NOT_SUPPORTED

#define ZB_ZDP_STATUS_NOT_SUPPORTED   0x84U

A timeout has occurred with the requested operation.

◆ ZB_ZDP_STATUS_SUCCESS

#define ZB_ZDP_STATUS_SUCCESS   0x00U

The requested operation or transmission was completed successfully. The supplied request type was invalid.

◆ ZB_ZDP_STATUS_TABLE_FULL

#define ZB_ZDP_STATUS_TABLE_FULL   0x8cU

The permissions configuration table on the target indicates that the request is not authorized from this device.

◆ ZB_ZDP_STATUS_TIMEOUT

#define ZB_ZDP_STATUS_TIMEOUT   0x85U

The end device bind request was unsuccessful due to a failure to match any suitable clusters.

◆ ZB_ZGP_SIGNAL_COMMISSIONING

#define ZB_ZGP_SIGNAL_COMMISSIONING   21U

ZGP commissioning complete signal.

When generated:

  • GPCB left the commissioning mode.

Status codes:

  • RET_OK: commissioning complete.
  • RET_ERROR: An error of any type.

Signal parameters:

Typedef Documentation

◆ zb_nwk_signal_device_associated_params_t

Association parameters.

Stack passes this parameter to application when some device associates to that.

◆ zb_zdo_app_signal_hdr_t

Application signal header

◆ zb_zdo_app_signal_type_t

Type for signals passed to zboss_signal_handler().

Holds one of zdo_app_signal_type. Previously it was defined as enum but was converted to a set of defines due to MISRA violations.

◆ zb_zdo_authorization_type_t

Type for Authorization types for ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED.

Deprecated:
holds one of zdo_authorization_type. Kept only for backward compatibility as zdo_authorization_type were declared previously as enum. Can be removed in future releases.

◆ zb_zdo_fb_initiator_finished_status_t

Type for Status codes for F&B Initiator Finished signal.

Holds one of zdo_fb_initiator_finished_status. Kept only for backward compatibility as zdo_fb_initiator_finished_status were declared previously as enum. Can be removed in future releases.

◆ zb_zdo_legacy_device_authorization_status_t

Type for Authorization statuses for ZB_ZDO_AUTHORIZATION_TYPE_LEGACY value of zdo_authorization_type type.

Deprecated:
holds one of zdo_legacy_device_authorization_status. Kept only for backward compatibility as zdo_legacy_device_authorization_status were declared previously as enum. Can be removed in future releases.

◆ zb_zdo_signal_can_sleep_params_t

Sleep signal parameters.

Stack passes this parameter to application when device ready to sleep.

◆ zb_zdo_signal_device_annce_params_t

Association parameters.

Stack passes this parameter to application when some device joins/rejoins to network.

◆ zb_zdo_signal_leave_indication_params_t

Leave Indication parameters.

Stack passes this parameter to application upon receipt of leave indication primitive.

◆ zb_zdo_signal_leave_params_t

Leave parameters.

Stack passes this parameter to application when device leave the network.

◆ zb_zdo_signal_macsplit_dev_boot_params_t

Macsplit device boot parameters.

Macsplit passes this parameter to application when device is booted.

◆ zb_zdo_signal_nlme_status_indication_params_t

NLME status indication parameters.

Stack passes this parameter to application when NLME status indication is generated.

◆ zb_zdo_tclk_authorization_status_t

Type for Authorization types for ZB_ZDO_SIGNAL_DEVICE_AUTHORIZED.

Deprecated:
holds one of zdo_authorization_type_r21_tclk_status. Kept only for backward compatibility as zdo_authorization_type_r21_tclk_status were declared previously as enum. Can be removed in future releases.

◆ zb_zdp_status_t

Type for ZDP status values.

Holds one of zdp_status. Kept for backward compatibility as zdp_status were declared previously as enum.

◆ zb_zgp_signal_commissioning_params_t

ZGP commissioning parameters.

Stack passes this parameter to application to notify about GPD commissioning result.

Function Documentation

◆ zb_get_app_signal()

zb_zdo_app_signal_type_t zb_get_app_signal ( zb_uint8_t  param,
zb_zdo_app_signal_hdr_t **  sg_p 
)

Unpack application signal buffer in zboss_signal_handler()

Parameters
param- parameter of zboss_signal_handler()
sg_p- pointer to the extended signal info, if application wants it. Can be NULL.
Returns
Application signal

◆ zboss_signal_handler()

void zboss_signal_handler ( zb_uint8_t  param)

ZBOSS application signal handler.

Mandatory for all applications implemented on the top of ZBOSS stack. See zdo_app_signal_type.

Parameters
param- reference to the buffer which contains signal. See zb_get_app_signal.
ZB_ZCL_GET_ATTRIBUTE_VAL_8
#define ZB_ZCL_GET_ATTRIBUTE_VAL_8(attr_desc)
Definition: zb_zcl_common.h:837
zb_zdo_mgmt_permit_joining_req_param_s::dest_addr
zb_uint16_t dest_addr
Definition: zboss_api_zdo.h:2621
ZB_BDB_SIGNAL_TC_REJOIN_DONE
#define ZB_BDB_SIGNAL_TC_REJOIN_DONE
Definition: zboss_api_zdo.h:759
zb_zdo_signal_device_annce_params_s
Association parameters.
Definition: zboss_api_zdo.h:951
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:153
TRACE_MSG
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:359
ZB_ZCL_CLUSTER_ID_ON_OFF
#define ZB_ZCL_CLUSTER_ID_ON_OFF
Definition: zb_zcl_common.h:211
zb_zdo_signal_leave_indication_params_s::device_addr
zb_ieee_addr_t device_addr
Definition: zboss_api_zdo.h:900
ZB_ZGP_SIGNAL_COMMISSIONING
#define ZB_ZGP_SIGNAL_COMMISSIONING
Definition: zboss_api_zdo.h:466
ZB_ZDO_SIGNAL_LEAVE
#define ZB_ZDO_SIGNAL_LEAVE
Definition: zboss_api_zdo.h:180
zb_buf_get_out_delayed_ext
#define zb_buf_get_out_delayed_ext(callback, arg, max_size)
Allocate OUT buffer, call a callback when the buffer is available.
Definition: zboss_api_buf.h:302
zb_zcl_attr_s
ZCL attribute definition structure.
Definition: zb_zcl_common.h:651
ZB_BDB_SIGNAL_DEVICE_FIRST_START
#define ZB_BDB_SIGNAL_DEVICE_FIRST_START
Definition: zboss_api_zdo.h:213
zb_bool_t
zb_uint8_t zb_bool_t
General purpose boolean type. For C90, 'zb_bool_t' is an alias of 'zb_uint8_t'. For C99,...
Definition: zb_types.h:371
ZB_ZDO_SIGNAL_DEVICE_ANNCE
#define ZB_ZDO_SIGNAL_DEVICE_ANNCE
Definition: zboss_api_zdo.h:164
ZB_SCHEDULE_APP_CALLBACK
#define ZB_SCHEDULE_APP_CALLBACK(func, param)
Definition: zboss_api_core.h:319
ZB_BUF_GET_PARAM
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:447
ZB_ZCL_CLUSTER_SERVER_ROLE
#define ZB_ZCL_CLUSTER_SERVER_ROLE
Definition: zb_zcl_common.h:188
zb_zgp_signal_commissioning_params_s::result
zb_zgp_comm_status_t result
Definition: zboss_api_zdo.h:930
ZB_TRUE
#define ZB_TRUE
Definition: zb_types.h:375
ZB_SCHEDULE_APP_ALARM
#define ZB_SCHEDULE_APP_ALARM(func, param, timeout_bi)
Definition: zboss_api_core.h:370
ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS
#define ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS
Definition: zboss_api_zdo.h:784
zb_zdo_signal_leave_params_s
Leave parameters.
Definition: zboss_api_zdo.h:877
zb_zdo_app_signal_type_t
zb_uint8_t zb_zdo_app_signal_type_t
Type for signals passed to zboss_signal_handler().
Definition: zboss_api_zdo.h:847
zb_zgp_signal_commissioning_params_s::zgpd_id
zb_zgpd_id_t zgpd_id
Definition: zboss_api_zdo.h:929
zb_bdb_initiate_tc_rejoin
void zb_bdb_initiate_tc_rejoin(zb_uint8_t param)
Starts TC rejoin procedure.
bdb_start_top_level_commissioning
zb_bool_t bdb_start_top_level_commissioning(zb_uint8_t mode_mask)
Start device commissioning procedure specified step.
zb_zdo_mgmt_permit_joining_req_param_s
Parameters for zb_zdo_mgmt_permit_joining_req.
Definition: zboss_api_zdo.h:2619
zb_zdo_mgmt_permit_joining_req
zb_uint8_t zb_zdo_mgmt_permit_joining_req(zb_uint8_t param, zb_callback_t cb)
sends Mgmt_Permit_Joining_req (See Zigbee spec 2.4.3.3.7)
zb_zcl_get_attr_desc_a
zb_zcl_attr_t * zb_zcl_get_attr_desc_a(zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id)
ZB_SCHEDULE_APP_ALARM_CANCEL
#define ZB_SCHEDULE_APP_ALARM_CANCEL(func, param)
Definition: zboss_api_core.h:414
ZB_ZDO_SIGNAL_SKIP_STARTUP
#define ZB_ZDO_SIGNAL_SKIP_STARTUP
Definition: zboss_api_zdo.h:148
zb_zdo_signal_device_annce_params_s::device_short_addr
zb_uint16_t device_short_addr
Definition: zboss_api_zdo.h:953
ZB_TIME_ONE_SECOND
#define ZB_TIME_ONE_SECOND
Definition: zboss_api_core.h:172
zb_zdo_mgmt_permit_joining_req_param_s::tc_significance
zb_uint8_t tc_significance
Definition: zboss_api_zdo.h:2625
zb_uint16_t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:157
zb_bdb_is_factory_new
zb_bool_t zb_bdb_is_factory_new(void)
ZB_ALARM_ANY_PARAM
#define ZB_ALARM_ANY_PARAM
Definition: zboss_api_core.h:379
zb_sleep_now
void zb_sleep_now(void)
ZB_COMMON_SIGNAL_CAN_SLEEP
#define ZB_COMMON_SIGNAL_CAN_SLEEP
Definition: zboss_api_zdo.h:486
zb_zgp_signal_commissioning_params_s
ZGP commissioning parameters.
Definition: zboss_api_zdo.h:927
ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID
@ ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID
OnOff attribute.
Definition: zb_zcl_on_off.h:60
ZB_BDB_NETWORK_STEERING
@ ZB_BDB_NETWORK_STEERING
Definition: zboss_api_zcl.h:1989
zb_buf_free
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:333
ZB_ZDO_SIGNAL_LEAVE_INDICATION
#define ZB_ZDO_SIGNAL_LEAVE_INDICATION
Definition: zboss_api_zdo.h:436
ZB_FALSE
#define ZB_FALSE
Definition: zb_types.h:374
ZB_ZDO_SIGNAL_GET_PARAMS
#define ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, type)
Definition: zboss_api_zdo.h:862
ZB_NWK_BROADCAST_ROUTER_COORDINATOR
#define ZB_NWK_BROADCAST_ROUTER_COORDINATOR
Definition: zboss_api_nwk.h:43
ZB_BDB_SIGNAL_DEVICE_REBOOT
#define ZB_BDB_SIGNAL_DEVICE_REBOOT
Definition: zboss_api_zdo.h:232
zb_zdo_signal_leave_indication_params_s::rejoin
zb_uint8_t rejoin
Definition: zboss_api_zdo.h:901
zb_get_short_address
zb_uint16_t zb_get_short_address(void)
zb_zdo_signal_leave_indication_params_s
Leave Indication parameters.
Definition: zboss_api_zdo.h:898
zb_zdo_mgmt_permit_joining_req_param_s::permit_duration
zb_uint8_t permit_duration
Definition: zboss_api_zdo.h:2622