Data Structures | |
| struct | zb_zcl_disc_attr_req_s |
| ZCL Discover Attribute Command frame. More... | |
| struct | zb_zcl_disc_attr_info_s |
| ZCL Description for Discover Attribute Response frame. More... | |
| struct | zb_zcl_disc_attr_res_s |
| ZCL Discover Attribute Response frame. More... | |
Macros | |
| #define | ZB_ZCL_GENERAL_GET_COMPLETE_DISC_RES(data_buf, complete) |
| Parses Discovery attribute response and returns next Read attribute status record or NULL if there is no more data. More... | |
| #define | ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES(data_buf, disc_attr_info) |
| Discovery attribute response and returns next Discovery attribute status record or NULL if there is no more data. More... | |
| #define | ZB_ZCL_GENERAL_DISC_READ_ATTR_REQ(buffer, def_resp, start_attr_id, max_len, addr, dst_addr_mode, dst_ep, ep, profile_id, cluster_id, cb) |
| Discover attribute command. More... | |
| #define | ZB_ZCL_GENERAL_DISC_ATTR_REQ_A(buffer, cmd_ptr, direction, def_resp, start_attr_id, max_len, addr, dst_addr_mode, dst_ep, ep, profile_id, cluster_id, cb) |
| Discover Attribute Request. More... | |
Typedefs | |
| typedef struct zb_zcl_disc_attr_req_s | zb_zcl_disc_attr_req_t |
| ZCL Discover Attribute Command frame. More... | |
| typedef struct zb_zcl_disc_attr_info_s | zb_zcl_disc_attr_info_t |
| ZCL Description for Discover Attribute Response frame. More... | |
| typedef struct zb_zcl_disc_attr_res_s | zb_zcl_disc_attr_res_t |
| ZCL Discover Attribute Response frame. More... | |
| typedef zb_uint8_t | zb_zcl_disc_complete_t |
| Type for possible values of ZCL Discover Attribute Response. More... | |
ZCL Discover Attribute Response - complete field | |
| |
| #define | ZB_ZCL_DISC_NON_COMPLETE 0x00U |
| #define | ZB_ZCL_DISC_COMPLETE 0x01U |
Detailed Description
Discover attributes command described in ZCL spec, subclauses 2.4.13 and 2.4.14.
Read attributes request command can be formed and sent as in following snippet:
ZB_ZCL_GENERAL_DISC_ATTR_REQ(zcl_cmd_buf, cmd_ptr, ZB_ZCL_ENABLE_DEFAULT_RESPONSE, DUT_ADDR, DUT_ADDR_MODE, DUT_ENDPOINT, TH_ENDPOINT, ZB_AF_HA_PROFILE_ID, ZB_ZCL_CLUSTER_ID_BINARY_INPUT, NULL);Discover attributes response can be parsed as:
ZB_ZCL_GENERAL_GET_COMPLETE_DISC_RES(buf, complete);ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES(buf, disc_attr_info);until allocated buffer space exceeds.
Discover attributes request parsing and response filling and sending is implemented in ZCL library internal functions.
Macro Definition Documentation
◆ ZB_ZCL_DISC_COMPLETE
| #define ZB_ZCL_DISC_COMPLETE 0x01U |
no more attributes to be discovered
◆ ZB_ZCL_DISC_NON_COMPLETE
| #define ZB_ZCL_DISC_NON_COMPLETE 0x00U |
more attributes to be discovered
◆ ZB_ZCL_GENERAL_DISC_ATTR_REQ_A
| #define ZB_ZCL_GENERAL_DISC_ATTR_REQ_A | ( | buffer, | |
| cmd_ptr, | |||
| direction, | |||
| def_resp, | |||
| start_attr_id, | |||
| max_len, | |||
| addr, | |||
| dst_addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| profile_id, | |||
| cluster_id, | |||
| cb | |||
| ) |
{ \ zb_uint8_t *cmd_ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_REQ_FRAME_CONTROL_A(cmd_ptr, direction, \ ZB_ZCL_NOT_MANUFACTURER_SPECIFIC, def_resp); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER(cmd_ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_DISC_ATTRIB); \ ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_ptr, (start_attr_id)); \ ZB_ZCL_PACKET_PUT_DATA8(cmd_ptr, (max_len)); \ ZB_ZCL_FINISH_PACKET(buffer, cmd_ptr) \ ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, dst_addr_mode, dst_ep, ep, profile_id, cluster_id, cb); \}#define ZB_ZCL_GET_SEQ_NUM()Return next sequence number for ZCL frame. Definition: zb_zcl_common.h:1443
#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFICDefinition: zb_zcl_common.h:1006
Discover Attribute Request.
- Parameters
-
buffer - reference to buffer to put packet into cmd_ptr - pointer to command (not used) direction - direction of command (see zcl_frame_direction) def_resp - enable/disable default response start_attr_id - start attribute ID max_len - max count addr - address to send packet to dst_addr_mode - addressing mode dst_ep - destination endpoint ep - sending endpoint profile_id - profile identifier cluster_id - cluster identifier cb - callback for getting command send status
◆ ZB_ZCL_GENERAL_DISC_READ_ATTR_REQ
| #define ZB_ZCL_GENERAL_DISC_READ_ATTR_REQ | ( | buffer, | |
| def_resp, | |||
| start_attr_id, | |||
| max_len, | |||
| addr, | |||
| dst_addr_mode, | |||
| dst_ep, | |||
| ep, | |||
| profile_id, | |||
| cluster_id, | |||
| cb | |||
| ) |
{ \ zb_uint8_t *cmd_ptr = ZB_ZCL_START_PACKET(buffer); \ ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_REQ_FRAME_CONTROL(cmd_ptr, def_resp); \ ZB_ZCL_CONSTRUCT_COMMAND_HEADER(cmd_ptr, ZB_ZCL_GET_SEQ_NUM(), ZB_ZCL_CMD_DISC_ATTRIB); \ ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_ptr, (start_attr_id)); \ ZB_ZCL_PACKET_PUT_DATA8(cmd_ptr, (max_len)); \ ZB_ZCL_FINISH_PACKET(buffer, cmd_ptr) \ ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, dst_addr_mode, dst_ep, ep, profile_id, cluster_id, cb); \}#define ZB_ZCL_GET_SEQ_NUM()Return next sequence number for ZCL frame. Definition: zb_zcl_common.h:1443
#define ZB_ZCL_START_PACKET(zbbuf)Initializes zb_buf_t buffer and returns pointer to the beginning of array. Definition: zb_zcl_common.h:1523
Discover attribute command.
- Parameters
-
buffer - reference to buffer to put packet into def_resp - enable/disable default response start_attr_id - start attribute ID max_len - max count addr - address to send packet to dst_addr_mode - addressing mode dst_ep - destination endpoint ep - sending endpoint profile_id - profile identifier cluster_id - cluster identifier cb - callback for getting command send status
◆ ZB_ZCL_GENERAL_GET_COMPLETE_DISC_RES
| #define ZB_ZCL_GENERAL_GET_COMPLETE_DISC_RES | ( | data_buf, | |
| complete | |||
| ) |
{ \ if (zb_buf_len(data_buf) > 0) \ { \ complete = *(zb_uint8_t*)zb_buf_begin(data_buf); \ } \ else \ { \ (complete) = 0; \ } \}
unsigned char zb_uint8_tProject-local 1-byte unsigned int type. Definition: zb_types.h:155
Parses Discovery attribute response and returns next Read attribute status record or NULL if there is no more data.
If response contains invalid data, 0 is returned.
- Parameters
-
data_buf - ID zb_bufid_t of a buffer containing discover attribute response data complete - variable to store Complete field
- Note
- data_buf buffer should contain Discover attribute response payload, without ZCL header.
◆ ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES
| #define ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES | ( | data_buf, | |
| disc_attr_info | |||
| ) |
{ \ (disc_attr_info) = zb_buf_len(data_buf) >= ZB_ZCL_DISC_ATTR_RESP_SIZE ? \ \ if (disc_attr_info) \ { \ ZB_ZCL_HTOLE16_INPLACE(&(disc_attr_info)->attr_id); \ \ (void)zb_buf_cut_left((data_buf), ZB_ZCL_DISC_ATTR_RESP_SIZE); \ } \}
ZCL Description for Discover Attribute Response frame. Definition: zb_zcl_commands.h:1174
Discovery attribute response and returns next Discovery attribute status record or NULL if there is no more data.
If response contains invalid data, NULL is returned.
- Parameters
-
data_buf - ID zb_bufid_t of a buffer containing part of Discover attribute response data disc_attr_info - out pointer to zb_zcl_disc_attr_info_t, containing Discover attribute status record
- Note
- data_buf buffer should contain Discover attribute response payload, without ZCL header. Each parsed Discover attribute status record is extracted from initial data_buf buffer
Typedef Documentation
◆ zb_zcl_disc_attr_info_t
| typedef struct zb_zcl_disc_attr_info_s zb_zcl_disc_attr_info_t |
ZCL Description for Discover Attribute Response frame.
- See also
- ZCL spec, zb_zcl_read_attr 2.4.14 Discover Attribute Response
◆ zb_zcl_disc_attr_req_t
| typedef struct zb_zcl_disc_attr_req_s zb_zcl_disc_attr_req_t |
ZCL Discover Attribute Command frame.
- See also
- ZCL spec, zb_zcl_disc_attr 2.4.13 Discover Attributes Command
◆ zb_zcl_disc_attr_res_t
| typedef struct zb_zcl_disc_attr_res_s zb_zcl_disc_attr_res_t |
ZCL Discover Attribute Response frame.
- See also
- ZCL spec, zb_zcl_read_attr 2.4.15 Discover Attribute Response
- Note
- Command frame contains variable number of parameters
◆ zb_zcl_disc_complete_t
| typedef zb_uint8_t zb_zcl_disc_complete_t |
Type for possible values of ZCL Discover Attribute Response.