Developing with ZBOSS SDK for Zigbee

Typedefs

typedef zb_uint8_t zb_ic_types_t
 Type for IC types. More...
 
typedef void(* zb_secur_ic_add_cb_t) (zb_ret_t status)
 

Functions

void zb_secur_ic_add (zb_ieee_addr_t address, zb_uint8_t ic_type, zb_uint8_t *ic, zb_secur_ic_add_cb_t cb)
 Add install code for the device with specified long address. More...
 
zb_ret_t zb_secur_ic_set (zb_uint8_t ic_type, zb_uint8_t *ic)
 Set install code for the device. More...
 
void zb_secur_ic_get_list_req (zb_uint8_t param)
 Get list of the install codes. It is valid only for the TC (ZC). More...
 
void zb_secur_ic_get_by_idx_req (zb_uint8_t param)
 Get the install code by index. It is valid only for the TC (ZC). More...
 
void zb_secur_ic_remove_req (zb_uint8_t param)
 Remove the install code for the device with specified long address. It is valid only for the TC (ZC). More...
 
void zb_secur_ic_remove_all_req (zb_uint8_t param)
 
zb_ret_t zb_secur_ic_str_set (char *ic_str)
 Set install code for the device from character string. More...
 
void zb_secur_ic_str_add (zb_ieee_addr_t address, char *ic_str, zb_secur_ic_add_cb_t cb)
 Add install code for the device from character string. More...
 
void zb_set_installcode_policy (zb_bool_t allow_ic_only)
 

IC types

#define ZB_IC_TYPE_48   0U
 
#define ZB_IC_TYPE_64   1U
 
#define ZB_IC_TYPE_96   2U
 
#define ZB_IC_TYPE_128   3U
 
#define ZB_IC_TYPE_MAX   4U
 

Detailed Description

Typedef Documentation

◆ zb_ic_types_t

Type for IC types.

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

◆ zb_secur_ic_add_cb_t

typedef void(* zb_secur_ic_add_cb_t) (zb_ret_t status)

Declares application callback that is called after installcode addition.

Parameters
status- status of installcode addition

Function Documentation

◆ zb_secur_ic_add()

void zb_secur_ic_add ( zb_ieee_addr_t  address,
zb_uint8_t  ic_type,
zb_uint8_t ic,
zb_secur_ic_add_cb_t  cb 
)

Add install code for the device with specified long address.

Parameters
[in]address- long address of the device to add the install code
[in]ic_type- install code type as enumerated in
[in]cb- callback that will be called after installcode addition ic_types
[in]ic- pointer to the install code buffer

This call allows to add install codes for several devices into NVRAM. It makes sense for Trust Center/Coordinator devices only as usual device doesn't need to have someone's else install codes.

Note
This call is valid only for the TC (ZC)!
Example
static void add_ic_cb(zb_ret_t status)
{
ZB_ASSERT(status == RET_OK);
}
static void enter_wrong_ic(zb_uint8_t param)
{
int i;
ZVUNUSED(param);
ZB_MEMCPY(s_temp_ic, g_ic1, 18);
for (i = 0; i < 4; ++i)
{
s_temp_ic[i] = ~s_temp_ic[i];
}
zb_secur_ic_add(dev_addr, ic_type, s_temp_ic, add_ic_cb);

◆ zb_secur_ic_get_by_idx_req()

void zb_secur_ic_get_by_idx_req ( zb_uint8_t  param)

Get the install code by index. It is valid only for the TC (ZC).

Parameters
parambuffer with request parameters, will be also used to store response.

◆ zb_secur_ic_get_list_req()

void zb_secur_ic_get_list_req ( zb_uint8_t  param)

Get list of the install codes. It is valid only for the TC (ZC).

Parameters
parambuffer with request parameters, will be also used to store response.

◆ zb_secur_ic_remove_all_req()

void zb_secur_ic_remove_all_req ( zb_uint8_t  param)

Remove the install code for all devices. It is valid only for the TC (ZC).

Parameters
parambuffer with request parameters, will be also used to store response.

◆ zb_secur_ic_remove_req()

void zb_secur_ic_remove_req ( zb_uint8_t  param)

Remove the install code for the device with specified long address. It is valid only for the TC (ZC).

Parameters
parambuffer with request parameters, will be also used to store response.

◆ zb_secur_ic_set()

zb_ret_t zb_secur_ic_set ( zb_uint8_t  ic_type,
zb_uint8_t ic 
)

Set install code for the device.

Parameters
[in]ic_type- install code type as enumerated in ic_types
[in]ic- pointer to the install code buffer

This call allows to set the install code for the current device. It is assumed that device can have only one install code.

Note
This function is to be run at client side (not at TC).
Returns
RET_OK on success or RET_CONVERSION_ERROR on error in install code

◆ zb_secur_ic_str_add()

void zb_secur_ic_str_add ( zb_ieee_addr_t  address,
char *  ic_str,
zb_secur_ic_add_cb_t  cb 
)

Add install code for the device from character string.

Parameters
[in]address- long address of the device to add the install code for
[in]ic_str- install code text string
[in]cb- callback that will be called after installcode addition

This call allows to add install codes for several devices into NVRAM. It makes sense for Trust Center/Coordinator devices only as usual device doesn't need to have someone's else install codes.

Note
This call is valid only for the TC (ZC)!

◆ zb_secur_ic_str_set()

zb_ret_t zb_secur_ic_str_set ( char *  ic_str)

Set install code for the device from character string.

Parameters
[in]ic_str- install code text string

This call allows to set the install code for the current device. It is assumed that device can have only one install code.

Note
This function is to be run at client side (not at TC).
Returns
RET_OK on success.

◆ zb_set_installcode_policy()

void zb_set_installcode_policy ( zb_bool_t  allow_ic_only)

Set installcode policy flag.

Parameters
allow_ic_only- use ZB_TRUE value to check installcodes
ZB_ASSERT
#define ZB_ASSERT(expr)
Definition: zb_debug.h:58
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:139
zb_ret_t
zb_int32_t zb_ret_t
Return type for ZB functions returning execution status.
Definition: zb_errors.h:33
RET_OK
#define RET_OK
Error codes for non-void stack functions. In general, function can return OK, BLOCKED or some error....
Definition: zb_errors.h:77
zb_secur_ic_add
void zb_secur_ic_add(zb_ieee_addr_t address, zb_uint8_t ic_type, zb_uint8_t *ic, zb_secur_ic_add_cb_t cb)
Add install code for the device with specified long address.