Sleep Control#

API for the Sleep Control functionality in the Application Framework.

Sleep Control description.

API#

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.

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.

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.

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.

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.

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.

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.

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.

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.

#define

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

#define

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

#define

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.

#define

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.

#define

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.

Parameters
N/Aendpoint

The endpoint of the event to be scheduled.

N/AclusterId

The cluster id of the event to be scheduled.

N/AisClient

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/AdelayMs

The number of milliseconds until the event should be called.

N/ApollControl

SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise.

N/AsleepControl

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.


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

Parameters
N/Aendpoint

The endpoint of the event to be scheduled.

N/AclusterId

The cluster id of the event to be scheduled.

N/AisClient

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/AdelayMs

The number of milliseconds until the event should be called.

N/AsleepControl

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.


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

Parameters
N/Aendpoint

The endpoint of the event to be scheduled

N/AclusterId

The cluster id of the event to be scheduled

N/AdelayMs

The number of milliseconds until the event should be called.

N/ApollControl

SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise.

N/AsleepControl

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.


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

Parameters
N/Aendpoint

The endpoint of the event to be scheduled.

N/AclusterId

The cluster id of the event to be scheduled.

N/AdelayMs

The number of milliseconds until the event should be called.

Returns

  • SL_STATUS_OK if the event was scheduled or an error otherwise.


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

Parameters
N/Aendpoint

The endpoint of the event to be scheduled.

N/AclusterId

The cluster id of the event to be scheduled.

N/AdelayMs

The number of milliseconds until the event should be called.

N/ApollControl

SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise.

N/AsleepControl

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.


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

Parameters
N/Aendpoint

The endpoint of the event to be scheduled

N/AclusterId

The cluster id of the event to be scheduled.

N/AdelayMs

The number of milliseconds until the event should be called.

Returns

  • SL_STATUS_OK if the event was scheduled or an error otherwise.


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

Parameters
N/Aendpoint

The endpoint of the event to be deactivated.

N/AclusterId

The cluster id of the event to be deactivated.

N/AisClient

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.


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

Parameters
N/Aendpoint

The endpoint of the event to be deactivated.

N/AclusterId

The cluster id of the event to be deactivated.

Returns

  • SL_STATUS_OK if the event was deactivated or an error otherwise.


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

Parameters
N/Aendpoint

The endpoint of the event to be deactivated.

N/AclusterId

The cluster ID of the event to be deactivated.

Returns

  • SL_STATUS_OK if the event was deactivated or an error otherwise.


Definition at line 1369 of file app/framework/include/af.h

SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK#

#define SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK
Value:
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().


Definition at line 1196 of file app/framework/include/af.h

SL_ZIGBEE_AF_SERVER_CLUSTER_TICK#

#define SL_ZIGBEE_AF_SERVER_CLUSTER_TICK
Value:
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().


Definition at line 1203 of file app/framework/include/af.h

sl_zigbee_af_get_current_sleep_control#

#define sl_zigbee_af_get_current_sleep_control
Value:
()

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


Definition at line 1386 of file app/framework/include/af.h

sl_zigbee_af_set_default_sleep_control#

#define sl_zigbee_af_set_default_sleep_control
Value:
(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.


Definition at line 1398 of file app/framework/include/af.h

sl_zigbee_af_get_default_sleep_control#

#define sl_zigbee_af_get_default_sleep_control
Value:
()

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.


Definition at line 1409 of file app/framework/include/af.h