Developing with ZBOSS for Zigbee

Data Structures

struct  zb_secur_ic_get_list_req_s
 Request for zb_secur_ic_get_list_req. More...
 
struct  zb_secur_ic_get_list_resp_s
 Response for zb_secur_ic_get_list_req. More...
 
struct  zb_secur_ic_entry_s
 IC entry type zb_secur_ic_get_list_req. More...
 
struct  zb_secur_ic_get_by_idx_req_s
 Request for zb_secur_ic_get_by_idx_req. More...
 
struct  zb_secur_ic_get_by_idx_resp_s
 Response for zb_secur_ic_get_by_idx_req. More...
 
struct  zb_secur_ic_remove_req_s
 Request for zb_secur_ic_remove_req. More...
 
struct  zb_secur_ic_remove_resp_s
 Response for zb_secur_ic_remove_req. More...
 
struct  zb_secur_ic_remove_all_req_s
 Request for zb_secur_ic_remove_all_req. More...
 
struct  zb_secur_ic_remove_all_resp_s
 Response for zb_secur_ic_remove_all_req. More...
 

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)
 
typedef struct zb_secur_ic_get_list_req_s zb_secur_ic_get_list_req_t
 Request for zb_secur_ic_get_list_req.
 
typedef struct zb_secur_ic_get_list_resp_s zb_secur_ic_get_list_resp_t
 Response for zb_secur_ic_get_list_req.
 
typedef struct zb_secur_ic_entry_s zb_secur_ic_entry_t
 IC entry type zb_secur_ic_get_list_req.
 
typedef struct zb_secur_ic_get_by_idx_req_s zb_secur_ic_get_by_idx_req_t
 Request for zb_secur_ic_get_by_idx_req.
 
typedef struct zb_secur_ic_get_by_idx_resp_s zb_secur_ic_get_by_idx_resp_t
 Response for zb_secur_ic_get_by_idx_req.
 
typedef struct zb_secur_ic_remove_req_s zb_secur_ic_remove_req_t
 Request for zb_secur_ic_remove_req.
 
typedef struct zb_secur_ic_remove_resp_s zb_secur_ic_remove_resp_t
 Response for zb_secur_ic_remove_req.
 
typedef struct zb_secur_ic_remove_all_req_s zb_secur_ic_remove_all_req_t
 Request for zb_secur_ic_remove_all_req.
 
typedef struct zb_secur_ic_remove_all_resp_s zb_secur_ic_remove_all_resp_t
 Response for zb_secur_ic_remove_all_req.
 

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...
 
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
zb_ieee_addr_t g_zr1_addr = IC_ZR1_IEEE_ADDR;
static zb_uint8_t g_ic1[16+2] = {0x83, 0xFE, 0xD3, 0x40, 0x7A, 0x93, 0x97, 0x23,
0xA5, 0xC6, 0x39, 0xB2, 0x69, 0x16, 0xD5, 0x05,
/* CRC */ 0xC3, 0xB5};
zb_secur_ic_add(g_zr1_addr, ZB_IC_TYPE_128, g_ic1, NULL);

◆ 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_set(ZB_IC_TYPE_128, g_ic1);

◆ 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_add(g_zr2_addr, IC_ZR2_INSTALL_CODE_STR, NULL);

◆ 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.
char* g_ic_zr2_install_code = IC_ZR2_INSTALL_CODE_STR;
zb_secur_ic_str_set(g_ic_zr2_install_code);

◆ 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_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:153
zb_set_installcode_policy
void zb_set_installcode_policy(zb_bool_t allow_ic_only)
ZB_TRUE
#define ZB_TRUE
Definition: zb_types.h:375
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.
zb_ieee_addr_t
zb_64bit_addr_t zb_ieee_addr_t
Long (64-bit) device address.
Definition: zb_types.h:560
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.
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.
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.