Zigbee Protocol Controller 1.6.0
Unify Attribute timeouts

Attribute timeout/callback helper component. More...

Typedefs

typedef void(* attribute_timeout_callback_t) (attribute_store_node_t)
 Function prototype callback functions. More...
 

Functions

sl_status_t attribute_timeout_set_callback (attribute_store_node_t node, clock_time_t duration, attribute_timeout_callback_t callback_function)
 Sets a callback to be called after a duration for an attribute. More...
 
bool attribute_timeout_is_callback_active (attribute_store_node_t node, attribute_timeout_callback_t callback_function)
 Checks if a node/callback pair is active. More...
 
sl_status_t attribute_timeout_cancel_callback (attribute_store_node_t node, attribute_timeout_callback_t callback_function)
 Cancels a callback to be called after a duration for an attribute. More...
 
sl_status_t attribute_timeouts_init ()
 Initializes the Unify attribute timeouts component. More...
 
int attribute_timeouts_teardown ()
 Teardown the Unify attribute timeouts component. More...
 

Detailed Description

Attribute timeout/callback helper component.

This module provides timers that invoke callbacks for a particular attribute in the Attribute Store.

Typedef Documentation

◆ attribute_timeout_callback_t

typedef void(* attribute_timeout_callback_t) (attribute_store_node_t)

Function prototype callback functions.

Function Documentation

◆ attribute_timeout_cancel_callback()

sl_status_t attribute_timeout_cancel_callback ( attribute_store_node_t  node,
attribute_timeout_callback_t  callback_function 
)

Cancels a callback to be called after a duration for an attribute.

Parameters
nodeThe attribute store node to inspect after the duration.
callback_functionThe function to invoke for the attribute node inspection.
Returns
SL_STATUS_OK, indicating that the callback function will not be called. SL_STATUS_NOT_FOUND if this callback was not active for the node.

◆ attribute_timeout_is_callback_active()

bool attribute_timeout_is_callback_active ( attribute_store_node_t  node,
attribute_timeout_callback_t  callback_function 
)

Checks if a node/callback pair is active.

Parameters
nodeThe attribute store node to inspect after the duration.
callback_functionThe function to invoke for the attribute node inspection.
Returns
True if the node has a timeor/ Callback running, false otherwise

◆ attribute_timeout_set_callback()

sl_status_t attribute_timeout_set_callback ( attribute_store_node_t  node,
clock_time_t  duration,
attribute_timeout_callback_t  callback_function 
)

Sets a callback to be called after a duration for an attribute.

There can be only one node/callback_function combination active at a time. It means that for example, calling the API in the following sequence:

  • attribute_timeout_set_callback(1,100,&function1);
  • attribute_timeout_set_callback(1,1000,&function1);

Will lead to only 1 call of function1 in 1000ms from now.

As another example, calling the API in the following sequence:

  • attribute_timeout_set_callback(1,100,&function1);
  • attribute_timeout_set_callback(1,1000,&function2);
  • attribute_timeout_set_callback(2,1000,&function2);

Will lead to 3 function calls:

  • function1(1) in 100ms
  • function2(1) in 1000ms
  • function2(2) in 1000ms
Parameters
nodeThe attribute store node to inspect after the duration.
durationThe time in ms for the duration to wait.
callback_functionThe function to invoke for the attribute node inspection.
Returns
SL_STATUS_OK if the timer is started and the callback will be invoked. SL_STATUS_FAIL in case of error.

◆ attribute_timeouts_init()

sl_status_t attribute_timeouts_init ( )

Initializes the Unify attribute timeouts component.

Returns
SL_STATUS_OK on success, any other value otherwise

◆ attribute_timeouts_teardown()

int attribute_timeouts_teardown ( )

Teardown the Unify attribute timeouts component.

Returns
0 on success.