Sub GHz Server#

API and Callbacks for the Sub GHz Cluster Server Component.

The Smart Energy Sub-GHz server monitors clients' and its own duty cycles. After a Limited threshold is reached, the Sub-GHz server instructs the offending client to suspend sending any more ZCL messages for a certain period. On reaching the Critical threshold, the suspend ZCL messages command is broadcast to all clients.

Modules#

Sub GHz Server

API#

EmberStatus
emberAfPluginSubGhzServerSendSuspendZclMessagesCommand(EmberNodeId nodeId, uint8_t endpoint, uint8_t period)

Send the 'Suspend ZCL Messages' command.

uint16_t

Get the current suspend status for a given client.

bool
sli_zigbee_af_sub_ghz_server_incoming_message(EmberIncomingMessageType type, EmberApsFrame *apsFrame, EmberNodeId sender, uint16_t messageLength, uint8_t *messageContents)

An incoming message handler.

API Documentation#

emberAfPluginSubGhzServerSendSuspendZclMessagesCommand#

EmberStatus emberAfPluginSubGhzServerSendSuspendZclMessagesCommand (EmberNodeId nodeId, uint8_t endpoint, uint8_t period)

Send the 'Suspend ZCL Messages' command.

Parameters
N/AnodeId

The client's node ID.

N/Aendpoint

The client's endpoint (ignored, backwards compatibility only).

N/Aperiod

The suspension period in minutes.

This is a server command. The server sends it to temporarily suspend ZCL messages from clients it identifies as causing too much traffic. It is also sent in response to the 'Get Suspend ZCL Messages Status' command.

Note: If endpoint == 0, the framework will choose the suitable endpoint based on the past communication with the given node. If GetSuspendZclMessagesStatus has never been received by the server, the server will not know which endpoint implements the Sub-GHz Client and will default to endpoint 1. The application can "teach" the server the client endpoint by discovering the Sub-GHz clients and call this function for each of them with period == 0.


Definition at line 62 of file app/framework/plugin/sub-ghz-server/sub-ghz-server.h

emberAfPluginSubGhzServerSuspendZclMessagesStatus#

uint16_t emberAfPluginSubGhzServerSuspendZclMessagesStatus (EmberNodeId nodeId)

Get the current suspend status for a given client.

Parameters
N/AnodeId

The client's node ID.

Returns

  • The number of seconds remaining; 0 = not suspended.


Definition at line 72 of file app/framework/plugin/sub-ghz-server/sub-ghz-server.h

sli_zigbee_af_sub_ghz_server_incoming_message#

bool sli_zigbee_af_sub_ghz_server_incoming_message (EmberIncomingMessageType type, EmberApsFrame *apsFrame, EmberNodeId sender, uint16_t messageLength, uint8_t *messageContents)

An incoming message handler.

Parameters
N/Atype
N/AapsFrame
N/Asender
N/AmessageLength
N/AmessageContents

Used to handle any incoming message from clients. Based on the Duty Cycle state, client's ID (has the client been suspended?) and the message type, determines the right action, which could be one of:

  • let the message through to allow the framework to process it further

  • respond with 'Suspend ZCL Messages' and suppress this message

  • suppress the message silently.

Returns

  • True if the message has been processed by the Sub-GHz plugin and should be suppressed, false to allow the message through.


Definition at line 92 of file app/framework/plugin/sub-ghz-server/sub-ghz-server.h