GBZ Message Controller#
API and Callbacks for the GBZ Message Controller Component.
Silicon Labs implementation of a GBZ message controller. This component extracts ZCL commands by parsing the elemental GBZ components of the GBZ message. Processing of encrypted GBZ message is not supported.
Modules#
sl_zigbee_af_gbz_zcl_command_t
sl_zigbee_af_gbz_message_parser_state_t
sli_zigbee_af_gbz_payload_header
sli_zigbee_af_gbz_use_case_specific_component
sl_zigbee_af_gbz_message_creator_result_t
sl_zigbee_af_gbz_message_creator_state_t
API#
Assemble appended ZCL responses into 1 big chunk of memory.
Get the default response byte from the GBZ ZCL Command.
Check the GBZ parser structure for any non-parsed commands.
Clean any resources allocated during the parsing of GBZ message.
Initialize proper parsing states for decoding GBZ messages.
Append a ZCL command to a given GBZ creator structure.
Initialize proper states for construction of GBZ messages.
Return the command size of the given parser structure.
Clean up/free all allocated memory used to store the overall GBZ response.
Get the next available ZCL command from the given GBZ parser structure.
Print out all information retained in a sl_zigbee_af_gbz_zcl_command_t structure.
Indicate whether the ZCL payload will be encrypted.
Enumerations#
Typedefs#
Functions#
Macros#
API Documentation#
sl_zigbee_af_gbz_message_controller_creator_assemble#
sl_zigbee_af_gbz_message_creator_result_t * sl_zigbee_af_gbz_message_controller_creator_assemble (sl_zigbee_af_gbz_message_creator_state_t * state)
Assemble appended ZCL responses into 1 big chunk of memory.
N/A | state |
208
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_get_zcl_default_response#
sl_zigbee_af_status_t sl_zigbee_af_gbz_message_controller_get_zcl_default_response (sl_zigbee_af_gbz_zcl_command_t * cmd)
Get the default response byte from the GBZ ZCL Command.
N/A | cmd | status. |
215
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_has_next_command#
bool sl_zigbee_af_gbz_message_controller_has_next_command (sl_zigbee_af_gbz_message_parser_state_t * state)
Check the GBZ parser structure for any non-parsed commands.
N/A | state | A structure containing the bookkeeping information of parsed GBZ messages. |
222
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_parser_cleanup#
void sl_zigbee_af_gbz_message_controller_parser_cleanup (sl_zigbee_af_gbz_message_parser_state_t * state)
Clean any resources allocated during the parsing of GBZ message.
N/A | state | A pre-allocated structure that's updated to hold bookkeeping information of parsed GBZ messages. |
230
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_parser_init#
bool sl_zigbee_af_gbz_message_controller_parser_init (sl_zigbee_af_gbz_message_parser_state_t * state, sl_zigbee_af_gbz_message_type_t type, uint8_t * gbzCommand, uint16_t gbzCommandLength, bool copyGbzCommand, uint16_t messageCode)
Initialize proper parsing states for decoding GBZ messages.
N/A | state | A pre-allocated structure that's updated to hold bookkeeping information for parsing GBZ messages. |
N/A | type | A pointer to GBZ messages. |
N/A | gbzCommand | Length of GBZ messages. |
N/A | gbzCommandLength | A flag to indicate if the parser should be storing the GBZ command locally for parsing. |
N/A | copyGbzCommand | "Message Code" for the corresponding Non TOM command. |
N/A | messageCode |
The GBZ message payload and payload length are passed in as arguments. Iterator functions, sl_zigbee_af_gbz_message_controller_has_next_command() and sl_zigbee_af_gbz_message_controller_next_command() are used to iterate through each of the embedded ZCL functions.
249
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_append_command#
uint16_t sl_zigbee_af_gbz_message_controller_append_command (sl_zigbee_af_gbz_message_creator_state_t * state, sl_zigbee_af_gbz_zcl_command_t * zclCmd)
Append a ZCL command to a given GBZ creator structure.
N/A | state | A pre-allocated structure that's updated to hold bookkeeping information of creating GBZ messages. |
N/A | zclCmd | A structure containing information for new ZCL command. |
Returns
0 - if the appending operation did not succeed else - number of appended bytes.
267
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_creator_init#
uint16_t sl_zigbee_af_gbz_message_controller_creator_init (sl_zigbee_af_gbz_message_creator_state_t * state, sl_zigbee_af_gbz_message_type_t type, uint16_t alertCode, uint32_t timestamp, uint16_t messageCode, uint8_t * gbzCommand, uint16_t gbzCommandLength)
Initialize proper states for construction of GBZ messages.
N/A | state | A pre-allocated structure that will be updated to hold bookkeeping information for creating GBZ messages. |
N/A | type | GBZ payload type: command, response, or alert. |
N/A | alertCode | When type is alert this field contains the alert code. |
N/A | timestamp | When type is alert this field contains the UTC when the alert occurred. |
N/A | messageCode | NULL - if the user wants API to allocate memory to store responses. Otherwise - a pointer to destination buffer for GBZ messages |
N/A | gbzCommand | Length of GBZ messages. this argument is ignored if gbzCommand is NULL. |
N/A | gbzCommandLength |
Depending on the value of the argument (gbzCommand), the creator behaves differently. If a NULL value is passed, the creator assumes you want the API to allocate memory to store the appended responses. Otherwise, the creator uses the provided buffer as the destination for storing responses.
Below is a general flow to make ZCL messages into a GBZ message.
sl_zigbee_af_gbz_message_controller_append_command() - append
sl_zigbee_af_gbz_message_controller_creator_assemble() - assemble result.
sl_zigbee_af_gbz_message_controller_creator_cleanup() - memory clean up
298
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_get_component_size#
uint8_t sl_zigbee_af_gbz_message_controller_get_component_size (sl_zigbee_af_gbz_message_parser_state_t * state)
Return the command size of the given parser structure.
N/A | state | A structure containing the bookkeeping information of parsed GBZ messages. |
312
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_creator_cleanup#
void sl_zigbee_af_gbz_message_controller_creator_cleanup (sl_zigbee_af_gbz_message_creator_state_t * state)
Clean up/free all allocated memory used to store the overall GBZ response.
N/A | state |
318
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_next_command#
void sl_zigbee_af_gbz_message_controller_next_command (sl_zigbee_af_gbz_message_parser_state_t * state, sl_zigbee_af_gbz_zcl_command_t * gbzZclCommand)
Get the next available ZCL command from the given GBZ parser structure.
N/A | state | A structure that retains the bookkeeping info of parsing GBZ messages. |
N/A | gbzZclCommand | A pre-allocated buffer that will be modified with the next available ZCL command's information. |
If any payload is encrypted, the decrypted data will overwrite the old data.
330
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_print_command_info#
void sl_zigbee_af_gbz_message_controller_print_command_info (sl_zigbee_af_gbz_zcl_command_t * gbzZclCommand)
Print out all information retained in a sl_zigbee_af_gbz_zcl_command_t structure.
N/A | gbzZclCommand |
335
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_get_encrypt_payload_flag#
bool sl_zigbee_af_gbz_message_controller_get_encrypt_payload_flag (sl_zigbee_af_gbz_message_creator_state_t * state, sl_zigbee_af_gbz_zcl_command_t * resp)
Indicate whether the ZCL payload will be encrypted.
N/A | state | |
N/A | resp |
340
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Enumeration Documentation#
sli_zigbee_gbcs_use_case_message_code_t#
sli_zigbee_gbcs_use_case_message_code_t
Enumerator | |
---|---|
GCS06_MESSAGE_CODE | |
GCS11_MESSAGE_CODE | |
CS11_MESSAGE_CODE | |
GCS01a_MESSAGE_CODE | |
GCS01b_MESSAGE_CODE | |
GCS05_MESSAGE_CODE | |
GCS07_MESSAGE_CODE | |
GCS09_MESSAGE_CODE | |
GCS13a_MESSAGE_CODE | |
GCS13b_MESSAGE_CODE | |
GCS13c_MESSAGE_CODE | |
GCS14_MESSAGE_CODE | |
GCS17_MESSAGE_CODE | |
GCS21d_MESSAGE_CODE | |
GCS21e_MESSAGE_CODE | |
GCS21j_MESSAGE_CODE | |
GCS23_MESSAGE_CODE | |
GCS25_MESSAGE_CODE | |
GCS33_MESSAGE_CODE | |
GCS38_MESSAGE_CODE | |
GCS44_MESSAGE_CODE | |
GCS46_MESSAGE_CODE | |
GCS60_MESSAGE_CODE | |
CS10a_MESSAGE_CODE | |
CS10b_MESSAGE_CODE | |
GCS61_MESSAGE_CODE | |
GCS16a_MESSAGE_CODE | |
GCS16b_MESSAGE_CODE | |
GCS15b_MESSAGE_CODE | |
GCS15c_MESSAGE_CODE | |
GCS15d_MESSAGE_CODE | |
GCS15e_MESSAGE_CODE | |
GCS21f_MESSAGE_CODE | |
GCS21b_MESSAGE_CODE | |
GCS53_MESSAGE_CODE | |
TEST_ENCRYPTED_MESSAGE_CODE | |
TEST_MESSAGE_CODE |
38
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_extended_header_control_field_t#
sl_zigbee_af_gbz_extended_header_control_field_t
Enumerator | |
---|---|
SL_ZIGBEE_AF_GBZ_NOT_LAST_UNENCRYPTED_MESSAGE | |
SL_ZIGBEE_AF_GBZ_LAST_UNENCRYPTED_MESSAGE | |
SL_ZIGBEE_AF_GBZ_NOT_LAST_ENCRYPTED_MESSAGE | |
SL_ZIGBEE_AF_GBZ_LAST_ENCRYPTED_MESSAGE |
107
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_type_t#
sl_zigbee_af_gbz_message_type_t
Enumerator | |
---|---|
SL_ZIGBEE_AF_GBZ_MESSAGE_COMMAND | |
SL_ZIGBEE_AF_GBZ_MESSAGE_RESPONSE | |
SL_ZIGBEE_AF_GBZ_MESSAGE_ALERT |
114
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Typedef Documentation#
sli_zigbee_af_gbz_use_case_specific_component#
typedef struct sli_zigbee_af_gbz_use_case_specific_component sli_zigbee_af_gbz_use_case_specific_component
166
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Function Documentation#
sl_zigbee_af_cluster_specific_command_parse#
sl_zigbee_af_status_t sl_zigbee_af_cluster_specific_command_parse (sl_zigbee_af_cluster_command_t * cmd)
N/A | cmd |
105
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Macro Definition Documentation#
sl_zigbee_af_gbz_message_controller_print#
#define sl_zigbee_af_gbz_message_controller_printValue:
(...)
78
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_println#
#define sl_zigbee_af_gbz_message_controller_printlnValue:
(...)
79
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_debug_exec#
#define sl_zigbee_af_gbz_message_controller_debug_execValue:
(x)
80
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
sl_zigbee_af_gbz_message_controller_print_buffer#
#define sl_zigbee_af_gbz_message_controller_print_bufferValue:
(buffer, len, withSpace)
81
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_CONTROL_FIELD_OFFSET#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_CONTROL_FIELD_OFFSETValue:
(0)
84
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_CLUSTER_ID_OFFSET#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_CLUSTER_ID_OFFSETValue:
(2)
85
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_GBZ_CMD_LENGTH_OFFSET#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_GBZ_CMD_LENGTH_OFFSETValue:
(3)
86
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_MESSAGE_COMMAND_HEADER_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_MESSAGE_COMMAND_HEADER_LENGTHValue:
(3)
88
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_MESSAGE_RESPONSE_HEADER_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_MESSAGE_RESPONSE_HEADER_LENGTHValue:
(3)
89
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_MESSAGE_ALERT_HEADER_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_MESSAGE_ALERT_HEADER_LENGTHValue:
(9)
90
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_FIELDS_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_FIELDS_LENGTHValue:
(5)
91
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_FIELDS_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_EXT_HEADER_FIELDS_LENGTHValue:
(5)
96
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ZCL_HEADER_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ZCL_HEADER_LENGTHValue:
(3)
92
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_LENGTHValue:
(4)
93
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_LENGTHValue:
(4)
98
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_HEADER_FIELDS_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_HEADER_FIELDS_LENGTHValue:
(2)
94
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_HEADER_FIELDS_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_HEADER_FIELDS_LENGTHValue:
(2)
97
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_CIPHERED_INFO_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_CIPHERED_INFO_LENGTHValue:
(2)
95
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_CIPHERED_INFO_LENGTH#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTION_CIPHERED_INFO_LENGTHValue:
(2)
99
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_LAST_MSG_MASK#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_LAST_MSG_MASKValue:
(0x01)
100
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTED_MSG_MASK#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_ENCRYPTED_MSG_MASKValue:
(0x02)
101
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_MASK#
#define GAS_PROXY_FUNCTION_GBZ_COMPONENT_FROM_DATE_TIME_MASKValue:
(0x10)
102
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h