Sleep Control#
API for the Sleep Control functionality in the Application Framework.
Sleep Control description.
API#
Schedule a cluster-related event inside the application framework's event mechanism. This function provides a wrapper for the Ember stack event mechanism which allows the cluster code to access its events by their endpoint, cluster ID, and client/server identity. The passed poll and sleep controls allow the cluster to indicate whether it needs to long or short poll and whether it needs to stay awake or if it can sleep.
Schedule a cluster-related event inside the application framework's event mechanism. This function is a wrapper for ::sl_zigbee_af_schedule_tick_extended. The cluster on the given endpoint will be set to long poll if sleepControl is set to SL_ZIGBEE_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is SL_ZIGBEE_AF_STAY_AWAKE and will sleep otherwise.
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_client_tick_extended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_server_tick_extended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
Deactivate a cluster-related event. This function provides a wrapper for the Ember stack's event mechanism, which allows an event to be accessed by its endpoint, cluster ID, and client/server identity.
Deactivate a cluster client event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
Deactivate a cluster server event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
Friendly define for use in the scheduling or canceling client events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
Friendly define for use in the scheduling or canceling server events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
Retrieve the most restrictive sleep control value for all scheduled events. This function is used by sl_zigbee_af_ok_to_nap and emberAfOkToHibernate to makes sure that there are no events scheduled, which will keep the device from hibernating or napping.
Set the default sleep control value against which all scheduled event sleep control values will be evaluated. This can be used to keep a device awake for an extended period of time by setting the default to SL_ZIGBEE_AF_STAY_AWAKE and then resetting the value to SL_ZIGBEE_AF_OK_TO_HIBERNATE once the wake period is complete.
Retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the sl_zigbee_af_set_default_sleep_control() function.
API Documentation#
sl_zigbee_zcl_schedule_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster-related event inside the application framework's event mechanism. This function provides a wrapper for the Ember stack event mechanism which allows the cluster code to access its events by their endpoint, cluster ID, and client/server identity. The passed poll and sleep controls allow the cluster to indicate whether it needs to long or short poll and whether it needs to stay awake or if it can sleep.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1227
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_cluster_tick#
sl_status_t sl_zigbee_zcl_schedule_cluster_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient, uint32_t delayMs, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster-related event inside the application framework's event mechanism. This function is a wrapper for ::sl_zigbee_af_schedule_tick_extended. The cluster on the given endpoint will be set to long poll if sleepControl is set to SL_ZIGBEE_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is SL_ZIGBEE_AF_STAY_AWAKE and will sleep otherwise.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | sleepControl | the priority of the event, what the processor should be allowed to do in terms of sleeping while the event is active. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1254
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_client_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
N/A | endpoint | The endpoint of the event to be scheduled |
N/A | clusterId | The cluster id of the event to be scheduled |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1274
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick#
sl_status_t sl_zigbee_zcl_schedule_client_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs)
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_client_tick_extended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1291
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_server_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1309
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick#
sl_status_t sl_zigbee_zcl_schedule_server_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs)
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_server_tick_extended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
N/A | endpoint | The endpoint of the event to be scheduled |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1326
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_cluster_tick#
sl_status_t sl_zigbee_zcl_deactivate_cluster_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient)
Deactivate a cluster-related event. This function provides a wrapper for the Ember stack's event mechanism, which allows an event to be accessed by its endpoint, cluster ID, and client/server identity.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster id of the event to be deactivated. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be deactivated is a client cluster SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1344
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_client_tick#
sl_status_t sl_zigbee_zcl_deactivate_client_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Deactivate a cluster client event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster id of the event to be deactivated. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1357
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_server_tick#
sl_status_t sl_zigbee_zcl_deactivate_server_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Deactivate a cluster server event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster ID of the event to be deactivated. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1369
of file app/framework/include/af.h
SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK#
#define SL_ZIGBEE_AF_CLIENT_CLUSTER_TICKValue:
true
Friendly define for use in the scheduling or canceling client events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
1196
of file app/framework/include/af.h
SL_ZIGBEE_AF_SERVER_CLUSTER_TICK#
#define SL_ZIGBEE_AF_SERVER_CLUSTER_TICKValue:
false
Friendly define for use in the scheduling or canceling server events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
1203
of file app/framework/include/af.h
sl_zigbee_af_get_current_sleep_control#
#define sl_zigbee_af_get_current_sleep_controlValue:
()
Retrieve the most restrictive sleep control value for all scheduled events. This function is used by sl_zigbee_af_ok_to_nap and emberAfOkToHibernate to makes sure that there are no events scheduled, which will keep the device from hibernating or napping.
Returns
The most restrictive sleep control value for all scheduled events or the value returned by sl_zigbee_af_get_default_sleep_control() if no events are currently scheduled. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed at any time using the sl_zigbee_af_set_default_sleep_control() function.
1386
of file app/framework/include/af.h
sl_zigbee_af_set_default_sleep_control#
#define sl_zigbee_af_set_default_sleep_controlValue:
(x)
Set the default sleep control value against which all scheduled event sleep control values will be evaluated. This can be used to keep a device awake for an extended period of time by setting the default to SL_ZIGBEE_AF_STAY_AWAKE and then resetting the value to SL_ZIGBEE_AF_OK_TO_HIBERNATE once the wake period is complete.
1398
of file app/framework/include/af.h
sl_zigbee_af_get_default_sleep_control#
#define sl_zigbee_af_get_default_sleep_controlValue:
()
Retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the sl_zigbee_af_set_default_sleep_control() function.
Returns
The current default sleep control value.
1409
of file app/framework/include/af.h