Developing with ZBOSS
|
Data Structures | |
struct | zb_zcl_write_attr_req_s |
ZCL Write Attribute Command frame. More... | |
struct | zb_zcl_write_attr_res_s |
ZCL Write Attribute Command frame. More... | |
Macros | |
#define | ZB_ZCL_GENERAL_GET_NEXT_WRITE_ATTR_REQ(data_ptr, data_len, write_attr_req) |
Parses Write attribute request and returns next Write attribute record or NULL if there is no more data. More... | |
#define | ZB_ZCL_GET_NEXT_WRITE_ATTR_RES(data_buf, write_attr_res) |
Parses Write attribute response and returns next Write attribute status or NULL if there is no more data. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_BY_TYPE(buffer, cmd_ptr, def_resp, write_attr_type) |
Initialize Write attribute command. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ(buffer, cmd_ptr, def_resp) |
Initialize Write attribute command. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_NO_RESP(buffer, cmd_ptr, def_resp) |
Initialize Write Attribute No Response command. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_UNDIV(buffer, cmd_ptr, def_resp) |
Initialize Write Attribute Undivided command. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_A(buffer, cmd_ptr, direction, def_resp) |
Initialize Write attribute command. More... | |
#define | ZB_ZCL_GENERAL_ADD_VALUE_WRITE_ATTR_REQ(cmd_ptr, attr_id, attr_type, attr_val) |
Add attribute value to command payload. More... | |
#define | ZB_ZCL_GENERAL_SEND_WRITE_ATTR_REQ( buffer, cmd_ptr, addr, dst_addr_mode, dst_ep, ep, profile_id, cluster_id, cb) |
Send Write attribute command. More... | |
#define | ZB_ZCL_GENERAL_SEND_WRITE_ATTRS_REQ( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id) |
Send "write attributes" request. depricate. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_RESP(_buffer, _cmd_ptr, _seq) |
Initialize Write attribute response command. More... | |
#define | ZB_ZCL_GENERAL_INIT_WRITE_ATTR_RESP_EXT(_buffer, _cmd_ptr, _direction, _seq, _is_manuf, _manuf_id) |
Initialize Write attribute response command. More... | |
#define | ZB_ZCL_GENERAL_SUCCESS_WRITE_ATTR_RESP(_cmd_ptr) |
Add Success status value to Write attribute response command payload. More... | |
#define | ZB_ZCL_GENERAL_ADD_STATUS_WRITE_ATTR_RESP(_buf, _cmd_ptr, _attr_id, _status) |
Add Fail status value to Write attribute response command payload. More... | |
#define | ZB_ZCL_GENERAL_SEND_WRITE_ATTR_RESP( _buffer, _cmd_ptr, _addr, _dst_addr_mode, _dst_ep, _ep, _profile_id, _cluster_id, _cb) |
Send Write attribute response command. More... | |
Typedefs | |
typedef struct zb_zcl_write_attr_req_s | zb_zcl_write_attr_req_t |
ZCL Write Attribute Command frame. More... | |
typedef struct zb_zcl_write_attr_res_s | zb_zcl_write_attr_res_t |
ZCL Write Attribute Command frame. More... | |
Both write attributes request and response commands have variable-length payload.
Write attributes request can be filled as following:
On the server side, this packet could be parsed in the following manner:
Response sending and parsing could be done in the same manner.
For more information see any HA sample
#define ZB_ZCL_GENERAL_ADD_STATUS_WRITE_ATTR_RESP | ( | _buf, | |
_cmd_ptr, | |||
_attr_id, | |||
_status | |||
) |
Add Fail status value to Write attribute response command payload.
_buf | - buffer to store command data |
_cmd_ptr | - pointer to a command data memory |
_attr_id | - attribute ID |
_status | - status |
#define ZB_ZCL_GENERAL_ADD_VALUE_WRITE_ATTR_REQ | ( | cmd_ptr, | |
attr_id, | |||
attr_type, | |||
attr_val | |||
) |
Add attribute value to command payload.
cmd_ptr | - pointer to a command data memory |
attr_id | - attribute identifier |
attr_type | - attribute type |
attr_val | - pointer to attribute data value |
#define ZB_ZCL_GENERAL_GET_NEXT_WRITE_ATTR_REQ | ( | data_ptr, | |
data_len, | |||
write_attr_req | |||
) |
Parses Write attribute request and returns next Write attribute record or NULL if there is no more data.
If request contains invlid data, NULL is returned.
data_ptr | - pointer to the data of a zb_bufid_t buffer containing write attribute request data |
data_len | - variable containing length of a zb_bufid_t buffer |
write_attr_req | - out pointer to zb_zcl_write_attr_req_t, containing Write attribute record |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ | ( | buffer, | |
cmd_ptr, | |||
def_resp | |||
) |
Initialize Write attribute command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
def_resp | - enable/disable default response |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_A | ( | buffer, | |
cmd_ptr, | |||
direction, | |||
def_resp | |||
) |
Initialize Write attribute command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
direction | - direction of command (see zb_zcl_frame_direction_t) |
def_resp | - enable/disable default response |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_BY_TYPE | ( | buffer, | |
cmd_ptr, | |||
def_resp, | |||
write_attr_type | |||
) |
Initialize Write attribute command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
def_resp | - enable/disable default response |
write_attr_type | - type of 'Write Attribute' command: default - |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_NO_RESP | ( | buffer, | |
cmd_ptr, | |||
def_resp | |||
) |
Initialize Write Attribute No Response command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
def_resp | - enable/disable default response |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ_UNDIV | ( | buffer, | |
cmd_ptr, | |||
def_resp | |||
) |
Initialize Write Attribute Undivided command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
def_resp | - enable/disable default response |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_RESP | ( | _buffer, | |
_cmd_ptr, | |||
_seq | |||
) |
Initialize Write attribute response command.
_buffer | - buffer to store command data |
_cmd_ptr | - pointer to a command data memory |
_seq | - command sequence |
#define ZB_ZCL_GENERAL_INIT_WRITE_ATTR_RESP_EXT | ( | _buffer, | |
_cmd_ptr, | |||
_direction, | |||
_seq, | |||
_is_manuf, | |||
_manuf_id | |||
) |
Initialize Write attribute response command.
_buffer | - buffer to store command data |
_cmd_ptr | - pointer to a command data memory |
_direction | - direction of command (see zb_zcl_frame_direction_t) |
_seq | - command sequence |
_is_manuf | - whether command is manufacturer specific |
_manuf_id | - manufacturer ID (needed if _is_manuf is set) |
#define ZB_ZCL_GENERAL_SEND_WRITE_ATTR_REQ | ( | buffer, | |
cmd_ptr, | |||
addr, | |||
dst_addr_mode, | |||
dst_ep, | |||
ep, | |||
profile_id, | |||
cluster_id, | |||
cb | |||
) |
Send Write attribute command.
buffer | - buffer to store command data |
cmd_ptr | - pointer to a command data memory |
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 |
#define ZB_ZCL_GENERAL_SEND_WRITE_ATTR_RESP | ( | _buffer, | |
_cmd_ptr, | |||
_addr, | |||
_dst_addr_mode, | |||
_dst_ep, | |||
_ep, | |||
_profile_id, | |||
_cluster_id, | |||
_cb | |||
) |
Send Write attribute response command.
_buffer | - buffer to store command data |
_cmd_ptr | - pointer to a command data memory |
_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 |
#define ZB_ZCL_GENERAL_SEND_WRITE_ATTRS_REQ | ( | buffer, | |
addr, | |||
addr_mode, | |||
dst_ep, | |||
ep, | |||
prof_id, | |||
cluster_id | |||
) |
Send "write attributes" request. depricate.
#define ZB_ZCL_GENERAL_SUCCESS_WRITE_ATTR_RESP | ( | _cmd_ptr | ) |
Add Success status value to Write attribute response command payload.
_cmd_ptr | - pointer to a command data memory |
#define ZB_ZCL_GET_NEXT_WRITE_ATTR_RES | ( | data_buf, | |
write_attr_res | |||
) |
Parses Write attribute response and returns next Write attribute status or NULL if there is no more data.
If response contains invlid data, NULL is returned.
data_buf | - ID zb_bufid_t of a buffer containing write attribute response data |
write_attr_res | - out pointer to zb_zcl_write_attr_res_t, containing Write attribute status |
typedef struct zb_zcl_write_attr_req_s zb_zcl_write_attr_req_t |
ZCL Write Attribute Command frame.
typedef struct zb_zcl_write_attr_res_s zb_zcl_write_attr_res_t |
ZCL Write Attribute Command frame.