Zigbee Protocol Controller 1.6.0
ZigPC ZCL Utilities

This component contains definitions and behaviours that is used to manipulate ZCL data types. More...

Modules

 Internal API used within the ZCL utility component.
 
 ZigPC ZCL Definitions
 Contains definitions used by ZigPC in order to intrepret ZCL information.
 

Classes

struct  zigpc_zcl_frame_data_t
 Structure used to pass data for ZCL frame build helpers. More...
 

Enumerations

enum  zigpc_zcl_frame_type_t { ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER , ZIGPC_ZCL_FRAME_TYPE_GLOBAL_CMD_TO_SERVER }
 ZCL frame control types. More...
 

Functions

size_t zigpc_zcl_get_data_type_size (zigpc_zcl_data_type_t type)
 Get data size of ZCL type passed in. More...
 
sl_status_t zigpc_zcl_frame_init_command (zcl_frame_t *const frame, zcl_command_id_t command_id, uint8_t frame_control)
 Initialize the ZCL Frame for sending ZCL command. More...
 
sl_status_t zigpc_zcl_frame_fill_data (zcl_frame_t *const frame, zigpc_zcl_data_type_t type, const void *data)
 Populate the given ZCL frame with data. The data copied is dictated by the type passed in. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type passed in. More...
 
sl_status_t zigpc_zcl_frame_fill_data_array (zcl_frame_t *const frame, zigpc_zcl_data_type_t type, size_t type_count, const void *data)
 Populate the ZCL frame with an array of the given ZCL data type. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type and array count passed in. More...
 
sl_status_t zigpc_zcl_build_command_frame (zcl_frame_t *const frame, const zigpc_zcl_frame_type_t frame_type, const zcl_cluster_id_t cluster_id, const zcl_command_id_t command_id, const size_t command_arg_count, const zigpc_zcl_frame_data_t *const command_arg_list)
 Build a ZCL command frame to be sent on the Zigbee network. More...
 
size_t zigpc_zcl_get_type_size (zigpc_zcl_data_type_t type)
 zigpc_zcl_get_type_size - retrieve the size (in bytes) of a given ZCL type More...
 
size_t zigpc_zcl_get_number_supported_clusters ()
 zigpc_zcl_get_number_supported_clusters More...
 
const uint16_t * zigpc_zcl_get_supported_cluster_list ()
 zigpc_zcl_get_supported_cluster_list More...
 

Detailed Description

This component contains definitions and behaviours that is used to manipulate ZCL data types.

Enumeration Type Documentation

◆ zigpc_zcl_frame_type_t

ZCL frame control types.

Enumerator
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER 
ZIGPC_ZCL_FRAME_TYPE_GLOBAL_CMD_TO_SERVER 

Function Documentation

◆ zigpc_zcl_build_command_frame()

sl_status_t zigpc_zcl_build_command_frame ( zcl_frame_t *const  frame,
const zigpc_zcl_frame_type_t  frame_type,
const zcl_cluster_id_t  cluster_id,
const zcl_command_id_t  command_id,
const size_t  command_arg_count,
const zigpc_zcl_frame_data_t *const  command_arg_list 
)

Build a ZCL command frame to be sent on the Zigbee network.

NOTE: Ensure pointers to data passed through command argument list is valid in the context that this function is called.

Parameters
framePointer to ZCL frame container to be populated.
frame_typeZCL frame information.
cluster_idCluster identifier.
command_idCluster command identifier.
command_arg_countCommand argument list count.
command_arg_listCommand argument type and data list. arguments.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in, or other error related to the ZCL command argument appending process.

◆ zigpc_zcl_frame_fill_data()

sl_status_t zigpc_zcl_frame_fill_data ( zcl_frame_t *const  frame,
zigpc_zcl_data_type_t  type,
const void *  data 
)

Populate the given ZCL frame with data. The data copied is dictated by the type passed in. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type passed in.

Parameters
framePointer to the ZCL frame to be populated.
typeType of data to be transferred to the frame.
dataPointer to the data to be transferred.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in, or SL_STATUS_WOULD_OVERFLOW if appending data would cause buffer overflow.

◆ zigpc_zcl_frame_fill_data_array()

sl_status_t zigpc_zcl_frame_fill_data_array ( zcl_frame_t *const  frame,
zigpc_zcl_data_type_t  type,
size_t  type_count,
const void *  data 
)

Populate the ZCL frame with an array of the given ZCL data type. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type and array count passed in.

Parameters
framePointer to the ZCL frame to be populated.
typeType of data to be transferred to the frame.
type_countNumber of data elements to be compied.
dataPointer to the data to be transferred.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in, SL_STATUS_WOULD_OVERFLOW if appending data would cause buffer overflow, or SL_STATUS_INVALID_COUNT if the count of elements is 0.

◆ zigpc_zcl_frame_init_command()

sl_status_t zigpc_zcl_frame_init_command ( zcl_frame_t *const  frame,
zcl_command_id_t  command_id,
uint8_t  frame_control 
)

Initialize the ZCL Frame for sending ZCL command.

Parameters
framePointer to frame to be initialized.
command_idZCL Command ID to be populated in the frame.
frame_controlZCL frame control field to be populated.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in.

◆ zigpc_zcl_get_data_type_size()

size_t zigpc_zcl_get_data_type_size ( zigpc_zcl_data_type_t  type)

Get data size of ZCL type passed in.

Parameters
typeZCL data type to lookup
Returns
size_t Number of bytes occupied by the data with ZCL type; if size information is not found, 0 is returned.

◆ zigpc_zcl_get_number_supported_clusters()

size_t zigpc_zcl_get_number_supported_clusters ( )

zigpc_zcl_get_number_supported_clusters

Returns
the number of unique supported ZCL clusters

◆ zigpc_zcl_get_supported_cluster_list()

const uint16_t * zigpc_zcl_get_supported_cluster_list ( )

zigpc_zcl_get_supported_cluster_list

Returns
a const pointer to the static list of the ID's of supported clusters

◆ zigpc_zcl_get_type_size()

size_t zigpc_zcl_get_type_size ( zigpc_zcl_data_type_t  type)

zigpc_zcl_get_type_size - retrieve the size (in bytes) of a given ZCL type

Parameters
type- the ZCL type
Returns
the size in bytes of the requested type. returns 0 if no type or an invalid type was found