nRF5 SDK for Thread and Zigbee v1.0.0
Functions
Fill ZCL packet low-level API

Functions

zb_ret_t zb_zcl_finish_and_send_packet (zb_buf_t *buffer, zb_uint8_t *ptr, zb_addr_u *dst_addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint8_t ep, zb_uint16_t prof_id, zb_uint16_t cluster_id, zb_callback_t cb)
 ZCL finish and send packet. More...
 
zb_ret_t zb_zcl_finish_and_send_packet_frag (zb_buf_t *buffer, zb_uint8_t *ptr, zb_addr_u *dst_addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint8_t ep, zb_uint16_t prof_id, zb_uint16_t cluster_id, zb_callback_t cb, zb_bool_t frag)
 

Detailed Description

Types and macros shared fill Fill ZCL packet.

Example
zb_uint8_t *cmd_payload;
cmd_payload = ZB_ZCL_START_PACKET(data_buf);
// Form command payload
/* Add Attribute reporting configuration record (correct one) */
ZB_ZCL_PACKET_PUT_DATA8(cmd_payload, ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT); //Direction value
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, ZB_ZCL_ATTR_OO_ON_OFF_ID); // attr id
ZB_ZCL_PACKET_PUT_DATA8(cmd_payload, ZB_ZCL_ATTR_TYPE_BOOL); // attr type
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, min_interval); // minimum interval
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, max_interval); // maximum interval
/* Reportable change is omitted for discrete data type */
/* Add Attribute reporting configuration record (with error - invalid attribute id) */
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, ZB_ZCL_ATTR_B_APPLICATION_VERSION_ID); // attr id
ZB_ZCL_PACKET_PUT_DATA8(cmd_payload, ZB_ZCL_ATTR_TYPE_U8); // attr type
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, min_interval); // minimum interval
ZB_ZCL_PACKET_PUT_DATA16_VAL(cmd_payload, max_interval); // maximum interval
ZB_ZCL_PACKET_PUT_DATA8(cmd_payload, VERSION_DELTA_VALUE); // Reportable change
ZB_ZCL_FINISH_PACKET(data_buf, cmd_payload);
ZB_ZCL_SEND_WRITE_ATTRS_CMD(data_buf, dst_addr, ZB_APS_ADDR_MODE_16_ENDP_PRESENT,

For more information see any HA sample

Function Documentation

zb_ret_t zb_zcl_finish_and_send_packet ( zb_buf_t buffer,
zb_uint8_t ptr,
zb_addr_u dst_addr,
zb_uint8_t  dst_addr_mode,
zb_uint8_t  dst_ep,
zb_uint8_t  ep,
zb_uint16_t  prof_id,
zb_uint16_t  cluster_id,
zb_callback_t  cb 
)

ZCL finish and send packet.

Parameters
bufferpointer to the buffer where ZCL cmd is stored
ptrpointer to the end of ZCL cmd in buffer
dst_addrdestination address (see zb_addr_u)
dst_addr_modedestination address mode (only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported)
dst_epdestination endpoint
epsource endpoint
prof_idprofile the command belongs to
cluster_idcluster identifier
cbcommand send status callback

Documentation feedback | Developer Zone | Subscribe | Updated