Modules#

EmberAfGbzZclCommand

EmberAfGbzMessageParserState

EmAfGbzPayloadHeader

EmAfGbzUseCaseSpecificComponent

EmberAfGbzMessageCreatorResult

EmberAfGbzMessageCreatorState

GBZ Message Controller

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#

emberAfPluginGbzMessageControllerCreatorAssemble(EmberAfGbzMessageCreatorState *state)

Assemble appended ZCL responses into 1 big chunk of memory.

Get the default response byte from the GBZ ZCL Command.

bool
emberAfPluginGbzMessageControllerHasNextCommand(EmberAfGbzMessageParserState *state)

Check the GBZ parser structure for any non-parsed commands.

void
emberAfPluginGbzMessageControllerParserCleanup(EmberAfGbzMessageParserState *state)

Clean any resources allocated during the parsing of GBZ message.

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.

uint16_t
emberAfPluginGbzMessageControllerAppendCommand(EmberAfGbzMessageCreatorState *state, EmberAfGbzZclCommand *zclCmd)

Append a ZCL command to a given GBZ creator structure.

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.

uint8_t
emberAfPluginGbzMessageControllerGetComponentSize(EmberAfGbzMessageParserState *state)

Return the command size of the given parser structure.

void
emberAfPluginGbzMessageControllerCreatorCleanup(EmberAfGbzMessageCreatorState *state)

Clean up/free all allocated memory used to store the overall GBZ response.

void
emberAfPluginGbzMessageControllerNextCommand(EmberAfGbzMessageParserState *state, EmberAfGbzZclCommand *gbzZclCommand)

Get the next available ZCL command from the given GBZ parser structure.

void
emberAfPluginGbzMessageControllerPrintCommandInfo(EmberAfGbzZclCommand *gbzZclCommand)

Print out all information retained in a EmberAfGbzZclCommand structure.

uint16_t
emAfPluginGbzMessageControllerGetLength(EmberAfGbzZclCommand *cmd, EmberAfGbzMessageData *msg)

Get the length of the overall GBZ message.

bool
emberAfPluginGbzMessageControllerGetEncryptPayloadFlag(EmberAfGbzMessageCreatorState *state, EmberAfGbzZclCommand *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
EMBER_AF_GBZ_NOT_LAST_UNENCRYPTED_MESSAGE = 0x00
EMBER_AF_GBZ_LAST_UNENCRYPTED_MESSAGE = 0x01
EMBER_AF_GBZ_NOT_LAST_ENCRYPTED_MESSAGE = 0x02
EMBER_AF_GBZ_LAST_ENCRYPTED_MESSAGE = 0x03
}
enum
EMBER_AF_GBZ_MESSAGE_COMMAND
EMBER_AF_GBZ_MESSAGE_RESPONSE
EMBER_AF_GBZ_MESSAGE_ALERT
}

Functions#

API Documentation#

emberAfPluginGbzMessageControllerCreatorAssemble#

EmberAfGbzMessageCreatorResult* emberAfPluginGbzMessageControllerCreatorAssemble (EmberAfGbzMessageCreatorState * 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

emberAfPluginGbzMessageControllerGetZclDefaultResponse#

EmberAfStatus emberAfPluginGbzMessageControllerGetZclDefaultResponse (EmberAfGbzZclCommand * 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

emberAfPluginGbzMessageControllerHasNextCommand#

bool emberAfPluginGbzMessageControllerHasNextCommand (EmberAfGbzMessageParserState * 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

emberAfPluginGbzMessageControllerParserCleanup#

void emberAfPluginGbzMessageControllerParserCleanup (EmberAfGbzMessageParserState * 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

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.

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, emberAfPluginGbzMessageControllerHasNextCommand() and emberAfPluginGbzMessageControllerNextCommand() 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

emberAfPluginGbzMessageControllerAppendCommand#

uint16_t emberAfPluginGbzMessageControllerAppendCommand (EmberAfGbzMessageCreatorState * state, EmberAfGbzZclCommand * 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

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.

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. emberAfPluginGbzMessageControllerCreatorInit() - create

  2. emberAfPluginGbzMessageControllerAppendCommand() - append

  3. emberAfPluginGbzMessageControllerCreatorAssemble() - assemble result.

  4. emberAfPluginGbzMessageControllerCreatorCleanup() - memory clean up


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

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

emberAfPluginGbzMessageControllerCreatorCleanup#

void emberAfPluginGbzMessageControllerCreatorCleanup (EmberAfGbzMessageCreatorState * 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

emberAfPluginGbzMessageControllerNextCommand#

void emberAfPluginGbzMessageControllerNextCommand (EmberAfGbzMessageParserState * state, EmberAfGbzZclCommand * 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

emberAfPluginGbzMessageControllerPrintCommandInfo#

void emberAfPluginGbzMessageControllerPrintCommandInfo (EmberAfGbzZclCommand * gbzZclCommand)

Print out all information retained in a EmberAfGbzZclCommand structure.

Parameters
N/AgbzZclCommand

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

Parameters
N/Acmd
N/Amsg

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

Parameters
N/Astate
N/Aresp

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

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

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

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

Typedef Documentation#

EmAfGbzUseCaseSpecificComponent#

typedef struct EmAfGbzUseCaseSpecificComponent EmAfGbzUseCaseSpecificComponent

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

Function Documentation#

emberAfClusterSpecificCommandParse#

EmberAfStatus emberAfClusterSpecificCommandParse (EmberAfClusterCommand * cmd)
Parameters
N/Acmd

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

Macro Definition Documentation#

emberAfPluginGbzMessageControllerPrint#

#define emberAfPluginGbzMessageControllerPrint
Value:
(...)

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

emberAfPluginGbzMessageControllerPrintln#

#define emberAfPluginGbzMessageControllerPrintln
Value:
(...)

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

emberAfPluginGbzMessageControllerDebugExec#

#define emberAfPluginGbzMessageControllerDebugExec
Value:
(x)

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

emberAfPluginGbzMessageControllerPrintBuffer#

#define emberAfPluginGbzMessageControllerPrintBuffer
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