Developing with ZBOSS for Zigbee
|
Types and macros required for ZCL frame manipulations. More...
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) (((_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 zcl_frame_type. | |
#define | ZB_ZCL_GET_MANUF_SPECIFIC(v) |
Check is ZCL frame manufacturer specific zcl_manufacturer_specific. | |
#define | ZB_ZCL_IS_MANUF_SPECIFIC(v) (ZB_ZCL_GET_MANUF_SPECIFIC(v) != 0U) |
#define | ZB_ZCL_GET_DIRECTION(v) |
Get ZCL frame direction zcl_frame_direction. | |
#define | ZB_ZCL_GET_DISABLE_DEFAULT_RESPONSE(v) |
Get ZCL disable default response field zcl_disable_default_response. | |
#define | ZB_ZCL_SET_FRAME_TYPE(v, val) |
Set ZCL frame type zcl_frame_type. | |
#define | ZB_ZCL_SET_MANUF_SPECIFIC(v, val) |
Set ZCL frame manufacturer specific zcl_manufacturer_specific. | |
#define | ZB_ZCL_SET_DIRECTION(v, val) |
Set ZCL frame direction zcl_frame_direction. | |
#define | ZB_ZCL_SET_DISABLE_DEFAULT_RESPONSE(v, val) |
Set ZCL disable default response field zcl_disable_default_response. | |
#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... | |
Typedefs | |
typedef zb_uint8_t | zb_zcl_frame_type_t |
Type for ZCL frame type. More... | |
typedef zb_uint8_t | zb_zcl_manufacturer_specific_t |
Type for return statuses of mathematical operations. More... | |
typedef zb_uint8_t | zb_zcl_disable_default_response_t |
Type for possible values of Disable default response subfield of FCF in ZCL frame. More... | |
typedef zb_uint8_t | zb_zcl_frame_direction_t |
Type for ZCL frame direction. More... | |
typedef struct zb_zcl_frame_ctrl_s | zb_zcl_frame_ctrl_t |
ZCL frame control field. More... | |
typedef struct zb_zcl_frame_hdr_full_s | zb_zcl_frame_hdr_full_t |
ZCL frame header with manufacturer code. More... | |
typedef struct zb_zcl_frame_hdr_short_s | zb_zcl_frame_hdr_short_t |
ZCL frame header without manufacturer code. More... | |
typedef struct zb_zcl_addr_s | zb_zcl_addr_t |
Type to represent source address of ZCL message. More... | |
typedef struct zb_zcl_parsed_hdr_s | zb_zcl_parsed_hdr_t |
typedef struct zb_zcl_attr_addr_info_s | zb_zcl_attr_addr_info_t |
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... | |
ZCL frame type | |
Defines Permitted values for Frame Type subfield of Frame Control field in ZCL frame. | |
#define | ZB_ZCL_FRAME_TYPE_COMMON 0x00U |
#define | ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC 0x01U |
Values for Manufacturer-specific subfield of FCF in ZCL frame | |
| |
#define | ZB_ZCL_NOT_MANUFACTURER_SPECIFIC 0x00U |
#define | ZB_ZCL_MANUFACTURER_SPECIFIC 0x01U |
Disable default response subfield of FCF in ZCL frame | |
| |
#define | ZB_ZCL_ENABLE_DEFAULT_RESPONSE 0x00U |
#define | ZB_ZCL_DISABLE_DEFAULT_RESPONSE 0x01U |
ZCL frame direction | |
| |
#define | ZB_ZCL_FRAME_DIRECTION_TO_SRV 0x00U |
#define | ZB_ZCL_FRAME_DIRECTION_TO_CLI 0x01U |
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_DISABLE_DEFAULT_RESPONSE 0x01U |
Disable default response
#define ZB_ZCL_ENABLE_DEFAULT_RESPONSE 0x00U |
Enable default response
#define ZB_ZCL_FRAME_DIRECTION_TO_CLI 0x01U |
Command sent from server to a client
#define ZB_ZCL_FRAME_DIRECTION_TO_SRV 0x00U |
Command sent from client to a server
#define ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC 0x01U |
Command is specific to a cluster
#define ZB_ZCL_FRAME_TYPE_COMMON 0x00U |
Command acts across the entire profile
#define ZB_ZCL_MANUFACTURER_SPECIFIC 0x01U |
Command refers to manufacturer-specific profile extension. Manufacturer code field shall be included into ZCL frame header.
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFIC 0x00U |
Standard profile command. Manufacturer code field shall not be included into ZCL frame header.
#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
Type for possible values of Disable default response subfield of FCF in ZCL frame.
Holds one of zcl_disable_default_response. Kept for backward compatibility as zcl_disable_default_response were declared previously as enum.
typedef struct zb_zcl_frame_ctrl_s zb_zcl_frame_ctrl_t |
ZCL frame control field.
typedef zb_uint8_t zb_zcl_frame_direction_t |
Type for ZCL frame direction.
Holds one of zcl_frame_direction. Kept only for backward compatibility as zcl_frame_direction were declared previously as enum.
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 zb_uint8_t zb_zcl_frame_type_t |
Type for ZCL frame type.
Type for return statuses of mathematical operations.
typedef struct zb_zcl_parsed_hdr_s zb_zcl_parsed_hdr_t |
Parsed ZCL header
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).