|
Developing with ZBOSS SDK for Zigbee
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, direction) |
| Send default response command with custom Direction. More...
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback) |
| Send default response command and execute callback when it is acknowledged or expired. More...
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback, aps_secured) |
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction, callback) |
| Send default response command and execute callback when it's acknowledged or expired. More...
|
|
#define | ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT( _is_broadcast, _delivery_mode, _disable_def_resp, _status, _is_def_resp_frame) |
| check whether command requires default response to be sent More...
|
|
#define | ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP(_cmd_info, _status) |
| API call that is used to check if it is needed to send Default response for the command. More...
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_EXT( _buffer, _dst_addr, _dst_addr_mode, _dst_ep, _src_ep, _prof_id, _cluster_id, _seq_num, _cmd, _status_code, _direction, _is_manuf_specific, _manuf_code, _callback) |
| General API for sending Default response command. More...
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code) |
| Send default response command. More...
|
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_NEW( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, aps_secured) |
|
#define | ZB_ZCL_SEND_DEFAULT_RESP_MANUF( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction) |
| Send default response command. More...
|
|
#define | ZB_ZCL_READ_DEFAULT_RESP(buffer) |
| Default response structured reading. More...
|
|
Default response command is defined in ZCL spec, subclause 2.4.12.
- Example
- Command can be sent like in the following snippet:
buf,
cmd_info->profile_id,
ZB_ZCL_CLUSTER_ID_CUSTOM,
cmd_info->seq_number,
cmd_info->cmd_id,
status);
Incoming default response can be parsed as following:
For more information see any HA sample
◆ ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP
#define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP |
( |
|
_cmd_info, |
|
|
|
_status |
|
) |
| |
Value:
ZB_APS_FC_GET_DELIVERY_MODE((_cmd_info).addr_data.common_data.fc), \
(_cmd_info).disable_default_response, _status, \
API call that is used to check if it is needed to send Default response for the command.
- Parameters
-
_cmd_info | - variable of zb_zcl_parsed_hdr_t type, containing received command header data |
_status | - status of the handled command |
◆ ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT
#define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT |
( |
|
_is_broadcast, |
|
|
|
_delivery_mode, |
|
|
|
_disable_def_resp, |
|
|
|
_status, |
|
|
|
_is_def_resp_frame |
|
) |
| |
Value: (!(_is_broadcast) && ((_delivery_mode) == ZB_APS_DELIVERY_UNICAST) && \
&& !(_is_def_resp_frame))
check whether command requires default response to be sent
Default response is sent if:
- particular response is not sent yet
- original command is NOT broadcast
- disable_default_response is set to FALSE or command status is not Success
- command itself is NOT default response
This is a helper method, use ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP instead
- Parameters
-
_is_broadcast | - broadcast bit from NWK header |
_delivery_mode | - delivery mode from APS header |
_disable_def_resp | - Disable Default Response bit from ZCL header |
_status | - status of the handled command |
_is_def_resp_frame | - check for command type |
◆ ZB_ZCL_READ_DEFAULT_RESP
#define ZB_ZCL_READ_DEFAULT_RESP |
( |
|
buffer | ) |
|
Value:
Default response structured reading.
- Parameters
-
buffer | - pointer to the message buffer (of type zb_bufid_t) containing payload |
- Returns
- pointer to zb_zcl_default_resp_payload_s structure
- Attention
- returned pointer will point to the same data in the buffer thus being valid until buffer data will be overwritten.
◆ ZB_ZCL_SEND_DEFAULT_RESP
#define ZB_ZCL_SEND_DEFAULT_RESP |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code |
|
) |
| |
Value:
seq_num, cmd, status_code, NULL)
Send default response command.
- Parameters
-
buffer | - ID zb_bufid_t of a buffer with payload |
addr | - short destination address |
addr_mode | - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported |
dst_ep | - destination end point |
ep | - our end point |
prof_id | - profile identifier |
cluster_id | - cluster identifier |
seq_num | - sequence number |
cmd | - identifier of the command the response is dedicated to |
status_code | - status field for received command |
◆ ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION
#define ZB_ZCL_SEND_DEFAULT_RESP_DIRECTION |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
direction |
|
) |
| |
Value:{ \
zb_uint8_t * ptr = NULL; \
ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_A(ptr, \
*(ptr++) = cmd; \
*(ptr++) = status_code; \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, NULL); \
}
Send default response command with custom Direction.
If you don't want to specify direction explicitly, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer | - ID zb_bufid_t of a buffer with payload |
addr | - short destination address |
addr_mode | - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported |
dst_ep | - destination end point |
ep | - our end point |
prof_id | - profile identifier |
cluster_id | - cluster identifier |
seq_num | - sequence number |
cmd | - identifier of the command the response is dedicated to |
status_code | - status field for received command |
direction | - direction of the command (see zb_zcl_frame_direction_t) |
◆ ZB_ZCL_SEND_DEFAULT_RESP_EXT
#define ZB_ZCL_SEND_DEFAULT_RESP_EXT |
( |
|
_buffer, |
|
|
|
_dst_addr, |
|
|
|
_dst_addr_mode, |
|
|
|
_dst_ep, |
|
|
|
_src_ep, |
|
|
|
_prof_id, |
|
|
|
_cluster_id, |
|
|
|
_seq_num, |
|
|
|
_cmd, |
|
|
|
_status_code, |
|
|
|
_direction, |
|
|
|
_is_manuf_specific, |
|
|
|
_manuf_code, |
|
|
|
_callback |
|
) |
| |
Value:{ \
zb_uint8_t * _ptr = NULL; \
ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_A(_ptr, \
(_direction), \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(_ptr, _seq_num, \
*(_ptr++) = (_cmd); \
*(_ptr++) = (_status_code); \
ZB_ZCL_FINISH_PACKET(_buffer, _ptr) \
ZB_ZCL_SEND_COMMAND_SHORT(_buffer, _dst_addr, _dst_addr_mode, _dst_ep, _src_ep, _prof_id, _cluster_id, _callback); \
}
General API for sending Default response command.
- Parameters
-
_buffer | - zb_bufid_t buffer |
_dst_addr | - 16-bit destination address |
_dst_addr_mode | - destination address mode. Possible values ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT, ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT, ZB_APS_ADDR_MODE_16_ENDP_PRESENT |
_dst_ep | - destination Endpoint number |
_src_ep | - source Endpoint number |
_prof_id | - profile ID |
_cluster_id | - cluster ID |
_seq_num | - transaction sequence number |
_cmd | - command ID |
_status_code | - command status (enum zb_zcl_status_e) |
_direction | - direction of command (see zb_zcl_frame_direction_t) |
_is_manuf_specific | - flag, equal to 1 if command is manufacturer specific |
_manuf_code | - manufacturer specific code, is taken unto account only if _is_manuf_specific is equal to 1 |
_callback | - pointer to the callback function that will be called when the command is sent |
◆ ZB_ZCL_SEND_DEFAULT_RESP_MANUF
#define ZB_ZCL_SEND_DEFAULT_RESP_MANUF |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
manuf_code, |
|
|
|
direction |
|
) |
| |
Value:
seq_num, cmd, status_code, manuf_code, direction, NULL)
Send default response command.
- Parameters
-
buffer | - ID zb_bufid_t of a buffer with payload |
addr | - short destination address |
addr_mode | - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported |
dst_ep | - destination end point |
ep | - our end point |
prof_id | - profile identifier |
cluster_id | - cluster identifier |
seq_num | - sequence number |
cmd | - identifier of the command the response is dedicated to |
status_code | - status field for received command |
manuf_code | - manufacturer code |
direction | - direction of command (see zb_zcl_frame_direction_t) |
◆ ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB
#define ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
manuf_code, |
|
|
|
direction, |
|
|
|
callback |
|
) |
| |
Value:{ \
zb_uint8_t * ptr = NULL; \
ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL_EXT(ptr,
ZB_TRUE, direction); \
*(ptr++) = cmd; \
*(ptr++) = status_code; \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, (callback)); \
}
Send default response command and execute callback when it's acknowledged or expired.
If no callback is needed, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer | - ID zb_bufid_t of a buffer with payload |
addr | - short destination address |
addr_mode | - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported |
dst_ep | - destination end point |
ep | - our end point |
prof_id | - profile identifier |
cluster_id | - cluster identifier |
seq_num | - sequence number |
cmd | - identifier of the command the response is dedicated to |
status_code | - status field for received command |
manuf_code | - manufacturer code |
direction | - direction of the command (see zb_zcl_frame_direction_t) |
callback | - callback to be executed when command is acknowledged or expired (of type zb_callback_t) |
◆ ZB_ZCL_SEND_DEFAULT_RESP_NEW
#define ZB_ZCL_SEND_DEFAULT_RESP_NEW |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
aps_secured |
|
) |
| |
Value: ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, \
seq_num, cmd, status_code, NULL, aps_secured)
◆ ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB
#define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
callback |
|
) |
| |
Value:{ \
zb_uint8_t * ptr = NULL; \
ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL(ptr); \
*(ptr++) = cmd; \
*(ptr++) = status_code; \
ZB_ZCL_FINISH_PACKET(buffer, ptr) \
ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, (callback)); \
}
Send default response command and execute callback when it is acknowledged or expired.
If no callback is needed, use ZB_ZCL_SEND_DEFAULT_RESP()
- Parameters
-
buffer | - ID zb_bufid_t of a buffer with payload |
addr | - short destination address |
addr_mode | - address mode, only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported |
dst_ep | - destination end point |
ep | - our end point |
prof_id | - profile identifier |
cluster_id | - cluster identifier |
seq_num | - sequence number |
cmd | - identifier of the command the response is dedicated to |
status_code | - status field for received command |
callback | - callback to be executed when command is acknowledged or expired (of type zb_callback_t) |
◆ ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW
#define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB_NEW |
( |
|
buffer, |
|
|
|
addr, |
|
|
|
addr_mode, |
|
|
|
dst_ep, |
|
|
|
ep, |
|
|
|
prof_id, |
|
|
|
cluster_id, |
|
|
|
seq_num, |
|
|
|
cmd, |
|
|
|
status_code, |
|
|
|
callback, |
|
|
|
aps_secured |
|
) |
| |
Value:{ \
zb_uint8_t * ptr = NULL; \
ZB_ZCL_CONSTRUCT_GENERAL_COMMAND_RESP_FRAME_CONTROL(ptr); \
*(ptr++) = cmd; \
*(ptr++) = status_code; \
ZB_ZCL_FINISH_N_SEND_PACKET_NEW(buffer, ptr, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, (callback), aps_secured,
ZB_FALSE, 0); \
}
@ ZB_ZCL_CMD_DEFAULT_RESP
Definition: zb_zcl_commands.h:72
struct zb_zcl_default_resp_payload_s zb_zcl_default_resp_payload_t
Default response payload structure.
enum zb_zcl_manufacturer_specific_e zb_zcl_manufacturer_specific_t
Values for Manufacturer-specific subfield of FCF in ZCL frame.
#define ZB_ZCL_START_PACKET(zbbuf)
Initializes zb_buf_t buffer and returns pointer to the beginning of array.
Definition: zb_zcl_common.h:1354
#define ZB_ZCL_SEND_DEFAULT_RESP_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, callback)
Send default response command and execute callback when it is acknowledged or expired.
Definition: zb_zcl_commands.h:325
@ ZB_ZCL_STATUS_SUCCESS
Definition: zb_zcl_common.h:337
@ ZB_APS_ADDR_MODE_16_ENDP_PRESENT
Definition: zboss_api_aps.h:101
@ ZB_TRUE
Definition: zb_types.h:130
#define ZB_ZCL_READ_DEFAULT_RESP(buffer)
Default response structured reading.
Definition: zb_zcl_commands.h:524
#define ZB_ZCL_PARSED_HDR_SHORT_DATA(header)
Extract common addressing data from parsed ZCL structure.
Definition: zb_zcl_common.h:1036
@ ZB_FALSE
Definition: zb_types.h:129
@ ZB_ZCL_MANUFACTURER_SPECIFIC
Command refers to manufacturer-specific profile extension.
Definition: zb_zcl_common.h:872
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:331
#define ZB_NWK_IS_ADDRESS_BROADCAST(addr)
Check that address is broadcast.
Definition: zboss_api_nwk.h:57
#define ZB_ZCL_SEND_DEFAULT_RESP_MANUF_WITH_CB(buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code, manuf_code, direction, callback)
Send default response command and execute callback when it's acknowledged or expired.
Definition: zb_zcl_commands.h:369
@ ZB_ZCL_NOT_MANUFACTURER_SPECIFIC
Standard profile command.
Definition: zb_zcl_common.h:867
Default response payload structure.
Definition: zb_zcl_commands.h:511
#define ZB_ZCL_CHECK_IF_SEND_DEFAULT_RESP_EXT( _is_broadcast, _delivery_mode, _disable_def_resp, _status, _is_def_resp_frame)
check whether command requires default response to be sent
Definition: zb_zcl_commands.h:399
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:378
#define ZB_ZCL_SEND_DEFAULT_RESP( buffer, addr, addr_mode, dst_ep, ep, prof_id, cluster_id, seq_num, cmd, status_code)
Send default response command.
Definition: zb_zcl_commands.h:476