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#
API#
Send the 'Suspend ZCL Messages' command.
Get the current suspend status for a given client.
An incoming message handler.
API Documentation#
sl_zigbee_af_sub_ghz_server_send_suspend_zcl_messages_command#
sl_status_t sl_zigbee_af_sub_ghz_server_send_suspend_zcl_messages_command (sl_802154_short_addr_t nodeId, uint8_t endpoint, uint8_t period)
Send the 'Suspend ZCL Messages' command.
N/A | nodeId | The client's node ID. |
N/A | endpoint | The client's endpoint (ignored, backwards compatibility only). |
N/A | period | 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.
62
of file app/framework/plugin/sub-ghz-server/sub-ghz-server.h
sl_zigbee_af_sub_ghz_server_suspend_zcl_messages_status#
uint16_t sl_zigbee_af_sub_ghz_server_suspend_zcl_messages_status (sl_802154_short_addr_t nodeId)
Get the current suspend status for a given client.
N/A | nodeId | The client's node ID. |
Returns
The number of seconds remaining; 0 = not suspended.
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 (sl_zigbee_incoming_message_type_t type, sl_zigbee_aps_frame_t * apsFrame, sl_802154_short_addr_t sender, uint16_t messageLength, uint8_t * messageContents)
An incoming message handler.
N/A | type | |
N/A | apsFrame | |
N/A | sender | |
N/A | messageLength | |
N/A | messageContents |
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.
92
of file app/framework/plugin/sub-ghz-server/sub-ghz-server.h