Modules#
EmAfGbzUseCaseSpecificComponent
EmberAfGbzMessageCreatorResult
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.
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 EmberAfGbzZclCommand structure.
Get the length of the overall GBZ message.
Indicate whether the ZCL payload will be encrypted.
Enumerations#
Typedefs#
Functions#
Macros#
API Documentation#
emberAfPluginGbzMessageControllerCreatorAssemble#
EmberAfGbzMessageCreatorResult* emberAfPluginGbzMessageControllerCreatorAssemble (EmberAfGbzMessageCreatorState * 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
emberAfPluginGbzMessageControllerGetZclDefaultResponse#
EmberAfStatus emberAfPluginGbzMessageControllerGetZclDefaultResponse (EmberAfGbzZclCommand * 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
emberAfPluginGbzMessageControllerHasNextCommand#
bool emberAfPluginGbzMessageControllerHasNextCommand (EmberAfGbzMessageParserState * 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
emberAfPluginGbzMessageControllerParserCleanup#
void emberAfPluginGbzMessageControllerParserCleanup (EmberAfGbzMessageParserState * 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
emberAfPluginGbzMessageControllerParserInit#
bool emberAfPluginGbzMessageControllerParserInit (EmberAfGbzMessageParserState * state, EmberAfGbzMessageType 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, emberAfPluginGbzMessageControllerHasNextCommand() and emberAfPluginGbzMessageControllerNextCommand() are used to iterate through each of the embedded ZCL functions.
249
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerAppendCommand#
uint16_t emberAfPluginGbzMessageControllerAppendCommand (EmberAfGbzMessageCreatorState * state, EmberAfGbzZclCommand * 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
emberAfPluginGbzMessageControllerCreatorInit#
uint16_t emberAfPluginGbzMessageControllerCreatorInit (EmberAfGbzMessageCreatorState * state, EmberAfGbzMessageType 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.
emberAfPluginGbzMessageControllerCreatorAssemble() - assemble result.
emberAfPluginGbzMessageControllerCreatorCleanup() - memory clean up
298
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerGetComponentSize#
uint8_t emberAfPluginGbzMessageControllerGetComponentSize (EmberAfGbzMessageParserState * 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
emberAfPluginGbzMessageControllerCreatorCleanup#
void emberAfPluginGbzMessageControllerCreatorCleanup (EmberAfGbzMessageCreatorState * 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
emberAfPluginGbzMessageControllerNextCommand#
void emberAfPluginGbzMessageControllerNextCommand (EmberAfGbzMessageParserState * state, EmberAfGbzZclCommand * 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
emberAfPluginGbzMessageControllerPrintCommandInfo#
void emberAfPluginGbzMessageControllerPrintCommandInfo (EmberAfGbzZclCommand * gbzZclCommand)
Print out all information retained in a EmberAfGbzZclCommand structure.
N/A | gbzZclCommand |
335
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emAfPluginGbzMessageControllerGetLength#
uint16_t emAfPluginGbzMessageControllerGetLength (EmberAfGbzZclCommand * cmd, EmberAfGbzMessageData * msg)
Get the length of the overall GBZ message.
N/A | cmd | |
N/A | msg |
340
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerGetEncryptPayloadFlag#
bool emberAfPluginGbzMessageControllerGetEncryptPayloadFlag (EmberAfGbzMessageCreatorState * state, EmberAfGbzZclCommand * resp)
Indicate whether the ZCL payload will be encrypted.
N/A | state | |
N/A | resp |
346
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Enumeration Documentation#
GBCSUseCaseMessageCode#
GBCSUseCaseMessageCode
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
EmberAfGbzExtendedHeaderControlField#
EmberAfGbzExtendedHeaderControlField
Enumerator | |
---|---|
EMBER_AF_GBZ_NOT_LAST_UNENCRYPTED_MESSAGE | |
EMBER_AF_GBZ_LAST_UNENCRYPTED_MESSAGE | |
EMBER_AF_GBZ_NOT_LAST_ENCRYPTED_MESSAGE | |
EMBER_AF_GBZ_LAST_ENCRYPTED_MESSAGE |
107
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
EmberAfGbzMessageType#
EmberAfGbzMessageType
Enumerator | |
---|---|
EMBER_AF_GBZ_MESSAGE_COMMAND | |
EMBER_AF_GBZ_MESSAGE_RESPONSE | |
EMBER_AF_GBZ_MESSAGE_ALERT |
114
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Typedef Documentation#
EmAfGbzUseCaseSpecificComponent#
typedef struct EmAfGbzUseCaseSpecificComponent EmAfGbzUseCaseSpecificComponent
105
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Function Documentation#
emberAfClusterSpecificCommandParse#
EmberAfStatus emberAfClusterSpecificCommandParse (EmberAfClusterCommand * cmd)
N/A | cmd |
105
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
Macro Definition Documentation#
emberAfPluginGbzMessageControllerPrint#
#define emberAfPluginGbzMessageControllerPrintValue:
(...)
78
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerPrintln#
#define emberAfPluginGbzMessageControllerPrintlnValue:
(...)
79
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerDebugExec#
#define emberAfPluginGbzMessageControllerDebugExecValue:
(x)
80
of file app/framework/plugin/gbz-message-controller/gbz-message-controller.h
emberAfPluginGbzMessageControllerPrintBuffer#
#define emberAfPluginGbzMessageControllerPrintBufferValue:
(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