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 |
ZCL GPD address type | |
Macro helps to see whether addr_type belongs to GPD subgroup | |
| #define | ZB_ZCL_ADDR_TYPE_IS_GPD(_addr_type) |
Detailed Description
Types and macros required for ZCL frame manipulations
Macro Definition Documentation
◆ ZB_ZCL_ADDR_TYPE_IS_GPD
| #define ZB_ZCL_ADDR_TYPE_IS_GPD | ( | _addr_type | ) |
((_addr_type) == ZB_ZCL_ADDR_TYPE_IEEE_GPD || \ (_addr_type) == ZB_ZCL_ADDR_TYPE_SRC_ID_GPD)
◆ ZB_ZCL_CONSTRUCT_COMMAND_HEADER
| #define ZB_ZCL_CONSTRUCT_COMMAND_HEADER | ( | data_ptr, | |
| tsn, | |||
| cmd_id | |||
| ) |
Construct ZCL header.
- Note
- To add Manufacturer specific field, use ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(), macro.
◆ ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT
| #define ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT | ( | _data_ptr, | |
| _tsn, | |||
| _is_manuf_spec, | |||
| _manuf_specific, | |||
| _cmd_id | |||
| ) |
{ \ if ((_is_manuf_spec)) \ { \ ZB_ZCL_PACKET_PUT_DATA16_VAL((_data_ptr), (_manuf_specific)); \ } \ ZB_ZCL_PACKET_PUT_DATA8((_data_ptr), (_tsn)); \ ZB_ZCL_PACKET_PUT_DATA8((_data_ptr), (_cmd_id)); \ }
Construct ZCL header, Manufacturer specific value is conditionally supported.
◆ ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL
| #define ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL | ( | buf_ptr | ) |
(ZB_ZCL_CONSTRUCT_SET_FRAME_CONTROL(*(buf_ptr), \ (buf_ptr)++)
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFICDefinition: zb_zcl_common.h:1006
#define ZB_ZCL_DISABLE_DEFAULT_RESPONSEDefinition: zb_zcl_common.h:1032
#define ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFICDefinition: zb_zcl_common.h:987
Construct ZCL header frame control value for cluster-specific command response.
zb_uint8_t* ptr = ZB_ZCL_START_PACKET(param);
◆ ZB_ZCL_COPY_PARSED_HEADER
| #define ZB_ZCL_COPY_PARSED_HEADER | ( | buf, | |
| dst | |||
| ) |
(ZB_MEMCPY( \ (dst), \ ZB_BUF_GET_PARAM((buf), zb_zcl_parsed_hdr_t), \ sizeof(zb_zcl_parsed_hdr_t)))Definition: zb_zcl_common.h:1145
Copy parsed ZCL header from buffer.
- Parameters
-
buf - ID zb_bufid_t of buffer containing parsed ZCL header as parameter dst - pointer to the memory area to copy header to
◆ ZB_ZCL_DISABLE_DEFAULT_RESPONSE
| #define ZB_ZCL_DISABLE_DEFAULT_RESPONSE 0x01U |
Disable default response
◆ ZB_ZCL_ENABLE_DEFAULT_RESPONSE
| #define ZB_ZCL_ENABLE_DEFAULT_RESPONSE 0x00U |
Enable default response
◆ ZB_ZCL_FRAME_DIRECTION_TO_CLI
| #define ZB_ZCL_FRAME_DIRECTION_TO_CLI 0x01U |
Command sent from server to a client
◆ ZB_ZCL_FRAME_DIRECTION_TO_SRV
| #define ZB_ZCL_FRAME_DIRECTION_TO_SRV 0x00U |
Command sent from client to a server
◆ ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC
| #define ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC 0x01U |
Command is specific to a cluster
◆ ZB_ZCL_FRAME_TYPE_COMMON
| #define ZB_ZCL_FRAME_TYPE_COMMON 0x00U |
Command acts across the entire profile
◆ ZB_ZCL_MANUFACTURER_SPECIFIC
| #define ZB_ZCL_MANUFACTURER_SPECIFIC 0x01U |
Command refers to manufacturer-specific profile extension. Manufacturer code field shall be included into ZCL frame header.
◆ ZB_ZCL_NOT_MANUFACTURER_SPECIFIC
| #define ZB_ZCL_NOT_MANUFACTURER_SPECIFIC 0x00U |
Standard profile command. Manufacturer code field shall not be included into ZCL frame header.
◆ ZB_ZCL_PARSED_HDR_SHORT_DATA
| #define ZB_ZCL_PARSED_HDR_SHORT_DATA | ( | header | ) | ((header)->addr_data.common_data) |
Extract common addressing data from parsed ZCL structure.
- Parameters
-
header - pointer to the parsed ZCL header structure (see zb_zcl_parsed_hdr_s).
◆ ZB_ZCL_SEND_CMD
| #define ZB_ZCL_SEND_CMD | ( | buffer, | |
| addr, | |||
| dst_addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| prof_id, | |||
| dis_default_resp, | |||
| cluster_id, | |||
| command_id, | |||
| cb | |||
| ) |
{ \ zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer) \ ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, dis_default_resp) \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), command_id); \ ZB_ZCL_FINISH_PACKET(buffer, ptr) \ ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb); \}#define ZB_ZCL_GET_SEQ_NUM()Return next sequence number for ZCL frame. Definition: zb_zcl_common.h:1443
General macro for sending a command with empty payload.
- Parameters
-
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
#define ZB_ZCL_DOOR_LOCK_SEND_LOCK_DOOR_REQ(buffer, \ dst_addr, \ dst_addr_mode, \ dst_ep, \ ep, \ dis_default_resp, \ cb) \ ZB_ZCL_SEND_CMD( buffer, \ dst_addr, \ dst_addr_mode, \ dst_ep, \ ep, \ ZB_AF_HA_PROFILE_ID, \ dis_default_resp, \ ZB_ZCL_CLUSTER_ID_DOOR_LOCK, \ ZB_ZCL_CMD_DOOR_LOCK_LOCK_DOOR, \ cb)
Typedef Documentation
◆ zb_zcl_addr_t
| 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.
◆ zb_zcl_attr_addr_info_t
| typedef struct zb_zcl_attr_addr_info_s zb_zcl_attr_addr_info_t |
Attribute address info structure
◆ zb_zcl_disable_default_response_t
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.
◆ zb_zcl_frame_ctrl_t
| typedef struct zb_zcl_frame_ctrl_s zb_zcl_frame_ctrl_t |
ZCL frame control field.
- See also
- ZCL spec, subclause 2.3.1.1
◆ zb_zcl_frame_direction_t
| 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.
◆ zb_zcl_frame_hdr_full_t
| typedef struct zb_zcl_frame_hdr_full_s zb_zcl_frame_hdr_full_t |
ZCL frame header with manufacturer code.
- See also
- ZCL spec, subclause 2.3.1
◆ zb_zcl_frame_hdr_short_t
| typedef struct zb_zcl_frame_hdr_short_s zb_zcl_frame_hdr_short_t |
ZCL frame header without manufacturer code.
- See also
- ZCL spec, subclause 2.3.1
◆ zb_zcl_frame_type_t
| typedef zb_uint8_t zb_zcl_frame_type_t |
Type for ZCL frame type.
◆ zb_zcl_manufacturer_specific_t
Type for return statuses of mathematical operations.
◆ zb_zcl_parsed_hdr_t
| typedef struct zb_zcl_parsed_hdr_s zb_zcl_parsed_hdr_t |
Parsed ZCL header
Function Documentation
◆ zb_zcl_start_command_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.
- Parameters
-
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).