Logo
DSR GreenBOSS  1.1.0
Functions
Helper functions for handling received commands

Functions

zb_ret_t gboss_handle_header_attr_cmd (zb_uint8_t *buf, zb_size_t length, zb_uint8_t *option, zb_uint16_t *manufactured_id, zb_size_t *hdr_len)
 Parse the header of the received command. More...
 
zb_size_t gboss_handle_cluster_attr_cmd (zb_uint8_t *buf, zb_size_t length, zb_uint16_t *cluster_id, zb_uint8_t *payload_length)
 Parse single attribute from the read/write attribute command. More...
 
zb_ret_t gboss_handle_cluster_attr_write (zb_uint8_t *buf, zb_size_t length, zb_uint32_t attr_count, zb_zcl_attr_t *attr_reports)
 Parse Write Attributes command. More...
 

Detailed Description

Function Documentation

§ gboss_handle_header_attr_cmd()

zb_ret_t gboss_handle_header_attr_cmd ( zb_uint8_t buf,
zb_size_t  length,
zb_uint8_t option,
zb_uint16_t manufactured_id,
zb_size_t hdr_len 
)

Parse the header of the received command.

Parameters
buf- packet payload
length- payload length
option- option field from the header
manufactured_id- manufactured id from the header
hdr_len- header length
Returns
RET_OK or RET_INVALID_PARAMETER if header is invalid

§ gboss_handle_cluster_attr_cmd()

zb_size_t gboss_handle_cluster_attr_cmd ( zb_uint8_t buf,
zb_size_t  length,
zb_uint16_t cluster_id,
zb_uint8_t payload_length 
)

Parse single attribute from the read/write attribute command.

Parameters
buf- packet payload at the position of the attribute to be parsed
length- the rest of the payload length
cluster_id- cluster id from the payload
payload_length- cluster-specific payload length
Returns
number of bytes parsed

§ gboss_handle_cluster_attr_write()

zb_ret_t gboss_handle_cluster_attr_write ( zb_uint8_t buf,
zb_size_t  length,
zb_uint32_t  attr_count,
zb_zcl_attr_t *  attr_reports 
)

Parse Write Attributes command.

Parameters
buf- packet payload rest
length- the rest of the payload length
attr_count- number of attributes to be parsed
attr_reports- filled array of attributes
Returns
RET_OK or RET_INVALID_PARAMETER if packet is invalid