nRF5 SDK for Thread and Zigbee v1.0.0
Choose documentation:
ZDO commands

Data Structures

struct  tsn_ctx_t
 

Macros

#define ZIGBEE_CLI_ZDO_TSN   3
 
#define ZIGBEE_CLI_MATCH_DESC_RESP_TIMEOUT   1
 
#define ZIGBEE_CLI_BIND_RESP_TIMEOUT   5
 
#define ZIGBEE_CLI_NWK_ADDR_RESP_TIMEOUT   5
 
#define ZIGBEE_CLI_IEEE_ADDR_RESP_TIMEOUT   5
 

Functions

static tsn_ctx_tget_ctx_by_tsn (uint8_t tsn)
 Return a pointer to context with the given transaction sequence number. More...
 
static tsn_ctx_tget_free_ctx (void)
 Get a pointer to a free context. More...
 
static void invalidate_ctx (tsn_ctx_t *p_tsn_ctx)
 
static int sscan_cluster_list (char **pp_argv, uint8_t num, uint16_t *pp_id)
 Parse a list of cluster IDs. More...
 
static void cmd_zb_match_desc_timeout (zb_uint8_t param)
 Prints 'Done' and invalidates transaction. More...
 
static void cmd_zb_match_desc_cb (zb_uint8_t param)
 A callback called on match descriptor response. More...
 
static void cmd_zb_bind_unbind_timeout (zb_uint8_t param)
 Handles timeout error and invalidates binding transaction. More...
 
zb_void_t cmd_zb_bind_unbind_cb (zb_uint8_t param)
 A callback called on bind/unbind response. More...
 
static void cmd_zb_nwk_addr_timeout (zb_uint8_t param)
 Handles timeout error and invalidates network address request transaction. More...
 
zb_void_t cmd_zb_nwk_addr_cb (zb_uint8_t param)
 A callback called on network address response. More...
 
static void cmd_zb_ieee_addr_timeout (zb_uint8_t param)
 Handles timeout error and invalidates IEEE (EUI64) address request transaction. More...
 
zb_void_t cmd_zb_ieee_addr_cb (zb_uint8_t param)
 A callback called on IEEE (EUI64) address response. More...
 
static void cmd_zb_match_desc (nrf_cli_t const *p_cli, size_t argc, char **argv)
 Send match descriptor request. More...
 
static void cmd_zb_bind (nrf_cli_t const *p_cli, size_t argc, char **argv)
 Create a binding between two endpoints on two nodes. More...
 
static void cmd_zb_unbind (nrf_cli_t const *p_cli, size_t argc, char **argv)
 Remove a binding between two endpoints on two nodes. More...
 
static void cmd_zb_nwk_addr (nrf_cli_t const *p_cli, size_t argc, char **argv)
 Resolve eui64 address to a short network address. More...
 
static void cmd_zb_ieee_addr (nrf_cli_t const *p_cli, size_t argc, char **argv)
 Resolve EUI64 by sending IEEE address request. More...
 
 NRF_CLI_CMD_REGISTER (match_desc, NULL,"send match descripor request", cmd_zb_match_desc)
 
 NRF_CLI_CMD_REGISTER (bind, NULL,"send bind request", cmd_zb_bind)
 
 NRF_CLI_CMD_REGISTER (unbind, NULL,"send unbind request", cmd_zb_unbind)
 
 NRF_CLI_CMD_REGISTER (nwk_addr, NULL,"resolve EUI64 address to short network address", cmd_zb_nwk_addr)
 
 NRF_CLI_CMD_REGISTER (ieee_addr, NULL,"resolve network short address to EUI64 address", cmd_zb_ieee_addr)
 

Variables

static tsn_ctx_t m_tsn_ctx [3]
 

Detailed Description

Function Documentation

static void cmd_zb_bind ( nrf_cli_t const *  p_cli,
size_t  argc,
char **  argv 
)
static

Create a binding between two endpoints on two nodes.

bind <h:source eui64> <d:source ep> <h:destination eui64>
<d:destination ep> <h:source cluster id> <h:request dst addr>`

Create bound connection between a device identified by source eui64 and endpoint source ep, and a device identified by destination eui64 and endpoint destination ep. The connection is created for ZCL commands and attributes assigned to the ZCL cluster source cluster id on the request dst addr node (usually the same address as for the source eui64 device).

Example:

bind 0B010E0405060708 1 0B010E4050607080 2 8
zb_void_t cmd_zb_bind_unbind_cb ( zb_uint8_t  param)

A callback called on bind/unbind response.

Parameters
[in]paramReference number to ZBOSS memory buffer.
static void cmd_zb_bind_unbind_timeout ( zb_uint8_t  param)
static

Handles timeout error and invalidates binding transaction.

Parameters
[in]paramZBOSS transaction sequence number.
static void cmd_zb_ieee_addr ( nrf_cli_t const *  p_cli,
size_t  argc,
char **  argv 
)
static

Resolve EUI64 by sending IEEE address request.

ieee_addr <h:short_addr>
zb_void_t cmd_zb_ieee_addr_cb ( zb_uint8_t  param)

A callback called on IEEE (EUI64) address response.

Parameters
[in]paramReference number to ZBOSS memory buffer.
static void cmd_zb_ieee_addr_timeout ( zb_uint8_t  param)
static

Handles timeout error and invalidates IEEE (EUI64) address request transaction.

Parameters
[in]paramZBOSS transaction sequence number.
static void cmd_zb_match_desc ( nrf_cli_t const *  p_cli,
size_t  argc,
char **  argv 
)
static

Send match descriptor request.

match_desc <h:16-bit destination address>
<h:requested address/type> <h:profile ID>
<d:number of input clusters> [<h:input cluster IDs> ...]
<d:number of output clusters> [<h:output cluster IDs> ...]

Send Match Descriptor Request to the dst_addr node that is a query about the req_addr node of the prof_id profile ID, which must have at least one of n_input_clusters(whose IDs are listed in {...}) or n_output_clusters (whose IDs are listed in {...}). The IDs can be either a decimal value or a hexadecimal string.

Example:

match_desc 0xfffd 0xfffd 0x0104 1 6 0

In this example, the command sends a Match Descriptor Request to all non-sleeping nodes regarding all non-sleeping nodes that have 1 input cluster ON/OFF (ID 6) and 0 output clusters.

static void cmd_zb_match_desc_cb ( zb_uint8_t  param)
static

A callback called on match descriptor response.

Parameters
[in]paramReference number to ZBOSS memory buffer.
static void cmd_zb_match_desc_timeout ( zb_uint8_t  param)
static

Prints 'Done' and invalidates transaction.

Parameters
[in]paramZBOSS transaction sequence number.
static void cmd_zb_nwk_addr ( nrf_cli_t const *  p_cli,
size_t  argc,
char **  argv 
)
static

Resolve eui64 address to a short network address.

nwk_addr <h:eui64>

Example:

nwk_addr 0B010E0405060708
zb_void_t cmd_zb_nwk_addr_cb ( zb_uint8_t  param)

A callback called on network address response.

Parameters
[in]paramReference number to ZBOSS memory buffer.
static void cmd_zb_nwk_addr_timeout ( zb_uint8_t  param)
static

Handles timeout error and invalidates network address request transaction.

Parameters
[in]paramZBOSS transaction sequence number.
static void cmd_zb_unbind ( nrf_cli_t const *  p_cli,
size_t  argc,
char **  argv 
)
static

Remove a binding between two endpoints on two nodes.

unbind <h:source eui64> <d:source ep> <h:destination eui64>
<d:destination ep> <h:source cluster id> <h:request dst addr>`

Remove bound connection between a devices identified by source eui64 and endpoint source ep, and a device identified by destination eui64 and endpoint destination ep. The connection is removed for ZCL commands and attributes assigned to the ZCL cluster source cluster id on the request dst addr node (usually the same address as for the source eui64 device).

static tsn_ctx_t* get_ctx_by_tsn ( uint8_t  tsn)
static

Return a pointer to context with the given transaction sequence number.

Parameters
[in]tsnZBOSS transaction sequence number.
Returns
a pointer to context or NULL if context for given TSN wasn't found.
static tsn_ctx_t* get_free_ctx ( void  )
static

Get a pointer to a free context.

Returns
a pointer to context structure or NULL if all contexts are taken.
static void invalidate_ctx ( tsn_ctx_t p_tsn_ctx)
static

Invalidate context.

Parameters
[in]p_tsn_ctxa pointer to transaction context.
static int sscan_cluster_list ( char **  pp_argv,
uint8_t  num,
uint16_t *  pp_id 
)
static

Parse a list of cluster IDs.

Parameters
[in]pp_argvPointer to argument table.
[in]numNumber of cluster IDs to scan.
[out]pp_idPointer to an array to store cluster IDs.
Returns
1 if parsing succeeded, 0 otherwise.