Developing with ZBOSS SDK for Zigbee
|
Data Structures | |
struct | zb_zcl_frame_ctrl_s |
ZCL frame control field. More... | |
struct | zb_zcl_frame_hdr_full_s |
ZCL frame header with manufacturer code. More... | |
struct | zb_zcl_frame_hdr_short_s |
ZCL frame header without manufacturer code. More... | |
struct | zb_zcl_addr_s |
Type to represent source address of ZCL message. More... | |
struct | zb_zcl_parsed_hdr_s |
struct | zb_zcl_attr_addr_info_s |
Macros | |
#define | ZB_ZCL_MANUFACTURER_WILDCARD_ID 0xffff |
#define | ZB_ZCL_REVERT_DIRECTION(_d) (((zb_zcl_frame_direction_t)(_d) == ZB_ZCL_FRAME_DIRECTION_TO_SRV) ? ZB_ZCL_FRAME_DIRECTION_TO_CLI : ZB_ZCL_FRAME_DIRECTION_TO_SRV) |
Reverts ZCL direction value. | |
#define | ZB_ZCL_PARSED_HDR_SHORT_DATA(header) ((header)->addr_data.common_data) |
Extract common addressing data from parsed ZCL structure. More... | |
#define | ZB_ZCL_GET_FRAME_TYPE(v) |
Get ZCL frame type zb_zcl_frame_type_e. | |
#define | ZB_ZCL_GET_MANUF_SPECIFIC(v) |
Check is ZCL frame manufacturer specific zb_zcl_manufacturer_specific_e. | |
#define | ZB_ZCL_GET_DIRECTION(v) |
Get ZCL frame direction zb_zcl_frame_direction_e. | |
#define | ZB_ZCL_GET_DISABLE_DEFAULT_RESPONSE(v) |
Get ZCL disable default response field zb_zcl_disable_default_response_e. | |
#define | ZB_ZCL_SET_FRAME_TYPE(v, val) |
Set ZCL frame type zb_zcl_frame_type_e. | |
#define | ZB_ZCL_SET_MANUF_SPECIFIC(v, val) |
Set ZCL frame manufacturer specific zb_zcl_manufacturer_specific_e. | |
#define | ZB_ZCL_SET_DIRECTION(v, val) |
Set ZCL frame direction zb_zcl_frame_direction_e. | |
#define | ZB_ZCL_SET_DISABLE_DEFAULT_RESPONSE(v, val) |
Set ZCL disable default response field zb_zcl_disable_default_response_e. | |
#define | ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL(buf_ptr) |
Construct ZCL header frame control value for cluster-specific command response. More... | |
#define | ZB_ZCL_CONSTRUCT_COMMAND_HEADER(data_ptr, tsn, cmd_id) |
Construct ZCL header. More... | |
#define | ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(_data_ptr, _tsn, _is_manuf_spec, _manuf_specific, _cmd_id) |
Construct ZCL header, Manufacturer specific value is conditionally supported. More... | |
#define | ZB_ZCL_GET_SEQ_NUM() |
Return next sequence number for ZCL frame. | |
#define | ZB_ZCL_COPY_PARSED_HEADER(buf, dst) |
Copy parsed ZCL header from buffer. More... | |
#define | ZB_ZCL_SEND_CMD( buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cluster_id, command_id, cb) |
General macro for sending a command with empty payload. More... | |
Enumerations | |
enum | zb_zcl_frame_type_e { ZB_ZCL_FRAME_TYPE_COMMON = 0x00, ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC = 0x01 } |
ZCL frame type. More... | |
enum | zb_zcl_manufacturer_specific_e { ZB_ZCL_NOT_MANUFACTURER_SPECIFIC = 0x00, ZB_ZCL_MANUFACTURER_SPECIFIC = 0x01 } |
Values for Manufacturer-specific subfield of FCF in ZCL frame. More... | |
enum | zb_zcl_disable_default_response_e { ZB_ZCL_ENABLE_DEFAULT_RESPONSE = 0x00, ZB_ZCL_DISABLE_DEFAULT_RESPONSE = 0x01 } |
Values for Disable default response subfield of FCF in ZCL frame. More... | |
enum | zb_zcl_frame_direction_e { ZB_ZCL_FRAME_DIRECTION_TO_SRV = 0x00, ZB_ZCL_FRAME_DIRECTION_TO_CLI = 0x01 } |
ZCL frame direction. More... | |
enum | zb_zcl_addr_type_e { ZB_ZCL_ADDR_TYPE_SHORT, ZB_ZCL_ADDR_TYPE_IEEE_GPD, ZB_ZCL_ADDR_TYPE_SRC_ID_GPD, ZB_ZCL_ADDR_TYPE_IEEE } |
Possible address types of devices from which ZCL message is received. | |
Functions | |
void * | zb_zcl_start_command_header (zb_bufid_t zbbuf, zb_uint8_t frame_ctl, zb_uint16_t manuf_code, zb_uint8_t cmd_id, zb_uint8_t *tsn) |
Construct ZCL command header in the buffer. More... | |
Types and macros required for ZCL frame manipulations
#define ZB_ZCL_CONSTRUCT_COMMAND_HEADER | ( | data_ptr, | |
tsn, | |||
cmd_id | |||
) |
Construct ZCL header.
#define ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT | ( | _data_ptr, | |
_tsn, | |||
_is_manuf_spec, | |||
_manuf_specific, | |||
_cmd_id | |||
) |
Construct ZCL header, Manufacturer specific value is conditionally supported.
#define ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL | ( | buf_ptr | ) |
Construct ZCL header frame control value for cluster-specific command response.
#define ZB_ZCL_COPY_PARSED_HEADER | ( | buf, | |
dst | |||
) |
Copy parsed ZCL header from buffer.
buf | - ID zb_bufid_t of buffer containing parsed ZCL header as parameter |
dst | - pointer to the memory area to copy header to |
#define ZB_ZCL_PARSED_HDR_SHORT_DATA | ( | header | ) | ((header)->addr_data.common_data) |
Extract common addressing data from parsed ZCL structure.
header | - pointer to the parsed ZCL header structure (see zb_zcl_parsed_hdr_s). |
#define ZB_ZCL_SEND_CMD | ( | buffer, | |
addr, | |||
dst_addr_mode, | |||
dst_ep, | |||
ep, | |||
prof_id, | |||
dis_default_resp, | |||
cluster_id, | |||
command_id, | |||
cb | |||
) |
General macro for sending a command with empty payload.
buffer | to put command payload and headers to |
addr | address to send to |
dst_addr_mode | destination address mode |
dst_ep | destination endpoint |
ep | source endpoint |
prof_id | profile the command belongs to |
dis_default_resp | "Disable default response" flag |
cluster_id | cluster identifier |
command_id | command identifier |
cb | command send status callback |
typedef struct zb_zcl_addr_s zb_zcl_addr_t |
Type to represent source address of ZCL message.
It is needed if ZGP sink is enabled and therefore messages can be received from ZGPD devices which are identified by 32-bit source Id.
typedef struct zb_zcl_attr_addr_info_s zb_zcl_attr_addr_info_t |
Attribute address info structure
Values for Disable default response subfield of FCF in ZCL frame.
typedef struct zb_zcl_frame_ctrl_s zb_zcl_frame_ctrl_t |
ZCL frame control field.
typedef enum zb_zcl_frame_direction_e zb_zcl_frame_direction_t |
ZCL frame direction.
typedef struct zb_zcl_frame_hdr_full_s zb_zcl_frame_hdr_full_t |
ZCL frame header with manufacturer code.
typedef struct zb_zcl_frame_hdr_short_s zb_zcl_frame_hdr_short_t |
ZCL frame header without manufacturer code.
typedef enum zb_zcl_frame_type_e zb_zcl_frame_type_t |
ZCL frame type.
Defines Permitted values for Frame Type subfield of Frame Control field in ZCL frame.
Values for Manufacturer-specific subfield of FCF in ZCL frame.
typedef struct zb_zcl_parsed_hdr_s zb_zcl_parsed_hdr_t |
Parsed ZCL header
enum zb_zcl_frame_type_e |
Values for Manufacturer-specific subfield of FCF in ZCL frame.
void* zb_zcl_start_command_header | ( | zb_bufid_t | zbbuf, |
zb_uint8_t | frame_ctl, | ||
zb_uint16_t | manuf_code, | ||
zb_uint8_t | cmd_id, | ||
zb_uint8_t * | tsn | ||
) |
Construct ZCL command header in the buffer.
zbbuf | buffer ID |
frame_ctl | Frame Control field for ZCL packet |
manuf_code | manufacturer code, not used manufacturer-specific flag is not set |
cmd_id | ZCL command id |
tsn | pointer to variable (may be NULL) for TSN value of ZCL packet (generated by the function) |
Returns pointer to the buffer data begin after ZCL header (where command payload can be placed if needed).