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

GBZ Message Controller

API#

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.

Get the default response byte from the GBZ ZCL 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Enumerations#

enum
GCS06_MESSAGE_CODE = 0x0070
GCS11_MESSAGE_CODE = 0x0073
CS11_MESSAGE_CODE = 0x0015
GCS01a_MESSAGE_CODE = 0x006B
GCS01b_MESSAGE_CODE = 0x00A3
GCS05_MESSAGE_CODE = 0x006F
GCS07_MESSAGE_CODE = 0x0071
GCS09_MESSAGE_CODE = 0x0072
GCS13a_MESSAGE_CODE = 0x0074
GCS13b_MESSAGE_CODE = 0x00B8
GCS13c_MESSAGE_CODE = 0x00B6
GCS14_MESSAGE_CODE = 0x0075
GCS17_MESSAGE_CODE = 0x0078
GCS21d_MESSAGE_CODE = 0x009D
GCS21e_MESSAGE_CODE = 0x009E
GCS21j_MESSAGE_CODE = 0x00BF
GCS23_MESSAGE_CODE = 0x007C
GCS25_MESSAGE_CODE = 0x007E
GCS33_MESSAGE_CODE = 0x0082
GCS38_MESSAGE_CODE = 0x0084
GCS44_MESSAGE_CODE = 0x0088
GCS46_MESSAGE_CODE = 0x0089
GCS60_MESSAGE_CODE = 0x008D
CS10a_MESSAGE_CODE = 0x0014
CS10b_MESSAGE_CODE = 0x00A1
GCS61_MESSAGE_CODE = 0x00A0
GCS16a_MESSAGE_CODE = 0x0077
GCS16b_MESSAGE_CODE = 0x0096
GCS15b_MESSAGE_CODE = 0x00C3
GCS15c_MESSAGE_CODE = 0x0076
GCS15d_MESSAGE_CODE = 0x00C4
GCS15e_MESSAGE_CODE = 0x00C5
GCS21f_MESSAGE_CODE = 0x009F
GCS21b_MESSAGE_CODE = 0x00B5
GCS53_MESSAGE_CODE = 0x008B
TEST_ENCRYPTED_MESSAGE_CODE = 0xFFFE
TEST_MESSAGE_CODE = 0xFFFF
}
enum
SL_ZIGBEE_AF_GBZ_NOT_LAST_UNENCRYPTED_MESSAGE = 0x00
SL_ZIGBEE_AF_GBZ_LAST_UNENCRYPTED_MESSAGE = 0x01
SL_ZIGBEE_AF_GBZ_NOT_LAST_ENCRYPTED_MESSAGE = 0x02
SL_ZIGBEE_AF_GBZ_LAST_ENCRYPTED_MESSAGE = 0x03
}
enum
SL_ZIGBEE_AF_GBZ_MESSAGE_COMMAND
SL_ZIGBEE_AF_GBZ_MESSAGE_RESPONSE
SL_ZIGBEE_AF_GBZ_MESSAGE_ALERT
}

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.

Parameters
N/Astate

Definition at line 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.

Parameters
N/Acmd

status.


Definition at line 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.

Parameters
N/Astate

A structure containing the bookkeeping information of parsed GBZ messages.


Definition at line 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.

Parameters
N/Astate

A pre-allocated structure that's updated to hold bookkeeping information of parsed GBZ messages.


Definition at line 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.

Parameters
N/Astate

A pre-allocated structure that's updated to hold bookkeeping information for parsing GBZ messages.

N/Atype

A pointer to GBZ messages.

N/AgbzCommand

Length of GBZ messages.

N/AgbzCommandLength

A flag to indicate if the parser should be storing the GBZ command locally for parsing.

N/AcopyGbzCommand

"Message Code" for the corresponding Non TOM command.

N/AmessageCode

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.


Definition at line 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.

Parameters
N/Astate

A pre-allocated structure that's updated to hold bookkeeping information of creating GBZ messages.

N/AzclCmd

A structure containing information for new ZCL command.

Returns

  • 0 - if the appending operation did not succeed else - number of appended bytes.


Definition at line 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.

Parameters
N/Astate

A pre-allocated structure that will be updated to hold bookkeeping information for creating GBZ messages.

N/Atype

GBZ payload type: command, response, or alert.

N/AalertCode

When type is alert this field contains the alert code.

N/Atimestamp

When type is alert this field contains the UTC when the alert occurred.

N/AmessageCode

NULL - if the user wants API to allocate memory to store responses. Otherwise - a pointer to destination buffer for GBZ messages

N/AgbzCommand

Length of GBZ messages. this argument is ignored if gbzCommand is NULL.

N/AgbzCommandLength

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.

  1. sl_zigbee_af_gbz_message_controller_creator_init() - create

  2. sl_zigbee_af_gbz_message_controller_append_command() - append

  3. sl_zigbee_af_gbz_message_controller_creator_assemble() - assemble result.

  4. sl_zigbee_af_gbz_message_controller_creator_cleanup() - memory clean up


Definition at line 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.

Parameters
N/Astate

A structure containing the bookkeeping information of parsed GBZ messages.


Definition at line 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.

Parameters
N/Astate

Definition at line 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.

Parameters
N/Astate

A structure that retains the bookkeeping info of parsing GBZ messages.

N/AgbzZclCommand

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.


Definition at line 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.

Parameters
N/AgbzZclCommand

Definition at line 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.

Parameters
N/Astate
N/Aresp

Definition at line 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

Definition at line 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

Definition at line 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

Definition at line 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

Definition at line 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_zcl_request_status_t sl_zigbee_af_cluster_specific_command_parse (sl_zigbee_af_cluster_command_t * cmd)
Parameters
N/Acmd

Definition at line 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_print
Value:
(...)

Definition at line 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_println
Value:
(...)

Definition at line 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_exec
Value:
(x)

Definition at line 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_buffer
Value:
(buffer, len, withSpace)

Definition at line 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_OFFSET
Value:
(0)

Definition at line 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_OFFSET
Value:
(2)

Definition at line 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_OFFSET
Value:
(3)

Definition at line 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_LENGTH
Value:
(3)

Definition at line 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_LENGTH
Value:
(3)

Definition at line 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_LENGTH
Value:
(9)

Definition at line 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_LENGTH
Value:
(5)

Definition at line 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_LENGTH
Value:
(5)

Definition at line 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_LENGTH
Value:
(3)

Definition at line 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_LENGTH
Value:
(4)

Definition at line 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_LENGTH
Value:
(4)

Definition at line 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_LENGTH
Value:
(2)

Definition at line 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_LENGTH
Value:
(2)

Definition at line 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_LENGTH
Value:
(2)

Definition at line 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_LENGTH
Value:
(2)

Definition at line 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_MASK
Value:
(0x01)

Definition at line 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_MASK
Value:
(0x02)

Definition at line 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_MASK
Value:
(0x10)

Definition at line 102 of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h