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 ::emberAfScheduleTickExtended. The cluster on the given endpoint will be set to long poll if sleepControl is set to EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is EMBER_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 emberAfOkToNap 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 EMBER_AF_STAY_AWAKE and then resetting the value to EMBER_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 EMBER_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the emberAfSetDefaultSleepControl() function.
API Documentation#
sl_zigbee_zcl_schedule_tick_extended#
EmberStatus sl_zigbee_zcl_schedule_tick_extended (uint8_t endpoint, EmberAfClusterId clusterId, bool isClient, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl 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 | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or EMBER_AF_SERVER_CLUSTER_TICK otherwise. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1194
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_cluster_tick#
EmberStatus sl_zigbee_zcl_schedule_cluster_tick (uint8_t endpoint, EmberAfClusterId clusterId, bool isClient, uint32_t delayMs, EmberAfEventSleepControl sleepControl)
Schedule a cluster-related event inside the application framework's event mechanism. This function is a wrapper for ::emberAfScheduleTickExtended. The cluster on the given endpoint will be set to long poll if sleepControl is set to EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is EMBER_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 | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or EMBER_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
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1221
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick_extended#
EmberStatus sl_zigbee_zcl_schedule_client_tick_extended (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl 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 | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1241
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick#
EmberStatus sl_zigbee_zcl_schedule_client_tick (uint8_t endpoint, EmberAfClusterId 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
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1258
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick_extended#
EmberStatus sl_zigbee_zcl_schedule_server_tick_extended (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl 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 | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1276
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick#
EmberStatus sl_zigbee_zcl_schedule_server_tick (uint8_t endpoint, EmberAfClusterId 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
EMBER_SUCCESS if the event was scheduled or an error otherwise.
1293
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_cluster_tick#
EmberStatus sl_zigbee_zcl_deactivate_cluster_tick (uint8_t endpoint, EmberAfClusterId 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 | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be deactivated is a client cluster EMBER_AF_SERVER_CLUSTER_TICK otherwise. |
Returns
EMBER_SUCCESS if the event was deactivated or an error otherwise.
1311
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_client_tick#
EmberStatus sl_zigbee_zcl_deactivate_client_tick (uint8_t endpoint, EmberAfClusterId 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
EMBER_SUCCESS if the event was deactivated or an error otherwise.
1324
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_server_tick#
EmberStatus sl_zigbee_zcl_deactivate_server_tick (uint8_t endpoint, EmberAfClusterId 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
EMBER_SUCCESS if the event was deactivated or an error otherwise.
1336
of file app/framework/include/af.h
EMBER_AF_CLIENT_CLUSTER_TICK#
#define EMBER_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().
1163
of file app/framework/include/af.h
EMBER_AF_SERVER_CLUSTER_TICK#
#define EMBER_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().
1170
of file app/framework/include/af.h
emberAfGetCurrentSleepControl#
#define emberAfGetCurrentSleepControlValue:
()
Retrieve the most restrictive sleep control value for all scheduled events. This function is used by emberAfOkToNap 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 emberAfGetDefaultSleepControl() if no events are currently scheduled. The default sleep control value is initialized to EMBER_AF_OK_TO_HIBERNATE but can be changed at any time using the emberAfSetDefaultSleepControl() function.
1353
of file app/framework/include/af.h
emberAfSetDefaultSleepControl#
#define emberAfSetDefaultSleepControlValue:
(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 EMBER_AF_STAY_AWAKE and then resetting the value to EMBER_AF_OK_TO_HIBERNATE once the wake period is complete.
1365
of file app/framework/include/af.h
emberAfGetDefaultSleepControl#
#define emberAfGetDefaultSleepControlValue:
()
Retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to EMBER_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the emberAfSetDefaultSleepControl() function.
Returns
The current default sleep control value.
1376
of file app/framework/include/af.h