Zigbee Protocol Controller 1.6.0
Unify Attribute transitions

Attribute transition helper component. More...

Functions

sl_status_t attribute_start_transition (attribute_store_node_t node, clock_time_t duration)
 Starts a transition from the REPORTED to the DESIRED value of an attribute following the indicated duration. More...
 
sl_status_t attribute_start_fixed_transition (attribute_store_node_t node, attribute_store_node_value_state_t value_type, float target_value, float step, clock_time_t step_interval)
 Start attribute transition with a fixed step, target value and interval. More...
 
sl_status_t attribute_stop_transition (attribute_store_node_t node)
 Stops an ongoing transition for an attribute. More...
 
bool is_attribute_transition_ongoing (attribute_store_node_t node)
 Verifies if a transition is ongoing for an attribute. More...
 
clock_time_t attribute_transition_get_remaining_duration (attribute_store_node_t node)
 Retrieves the remaining time for a transition. More...
 
sl_status_t attribute_transitions_init ()
 Initializes the Unify attribute transition component. More...
 
int attribute_transitions_teardown ()
 Teardown the Unify attribute transition component. More...
 

Detailed Description

Attribute transition helper component.

Component that performs linear value transitions respecting a given duration for attributes, between the REPORTED and DESIRED values of an Attribute Store attribute.

Function Documentation

◆ attribute_start_fixed_transition()

sl_status_t attribute_start_fixed_transition ( attribute_store_node_t  node,
attribute_store_node_value_state_t  value_type,
float  target_value,
float  step,
clock_time_t  step_interval 
)

Start attribute transition with a fixed step, target value and interval.

This function starts an attribute transition on the desired or reported value of an attribute attribute. The target value, step and interval is given up front. The transition can be canceled using attribute_stop_transition.

The transition is signed such that it can be both upwards or downwards. If the value is changed such that the step would move the value away from the target value, the transition will stop. Then transition will always end on the target value.

Parameters
nodeAttribute node to start the transition on
value_typeMove the DESIRED or REPORTED value.
target_valueTarget value to reach
stepWhich step ot take in the transition
step_intervalNumber of ms beteween each step
Returns
sl_status_t

◆ attribute_start_transition()

sl_status_t attribute_start_transition ( attribute_store_node_t  node,
clock_time_t  duration 
)

Starts a transition from the REPORTED to the DESIRED value of an attribute following the indicated duration.

If a transition is already ongoing for that attribute node, it will be stopped and a new transition will be started.

Parameters
nodeThe attribute store node value to transition. The type of the value of must be uint32_t.
durationThe time that the duration must take.
Returns
SL_STATUS_OK if the transition was initiated, SL_STATUS_FAIL in case of error.

◆ attribute_stop_transition()

sl_status_t attribute_stop_transition ( attribute_store_node_t  node)

Stops an ongoing transition for an attribute.

If a transition is already ongoing for that attribute node, it will be stopped and a new transition will be started.

Parameters
nodeThe attribute store node for which the transition must be stopped, if ongoing
Returns
SL_STATUS_OK

◆ attribute_transition_get_remaining_duration()

clock_time_t attribute_transition_get_remaining_duration ( attribute_store_node_t  node)

Retrieves the remaining time for a transition.

Parameters
nodeThe attribute store node to retrieve the remaining duration
Returns
The clock_time_t in ms remaining for the transitions. 0 if no transition is ongoing for the node

◆ attribute_transitions_init()

sl_status_t attribute_transitions_init ( )

Initializes the Unify attribute transition component.

Returns
SL_STATUS_OK on success, any other value otherwise

◆ attribute_transitions_teardown()

int attribute_transitions_teardown ( )

Teardown the Unify attribute transition component.

Returns
0 on success.

◆ is_attribute_transition_ongoing()

bool is_attribute_transition_ongoing ( attribute_store_node_t  node)

Verifies if a transition is ongoing for an attribute.

Parameters
nodeThe attribute store node to check for ongoing transitions
Returns
true if the node is undergoing a transition, false otherwise.