Zigbee Protocol Controller 1.6.0
unify_dotdot_attribute_store_command_callbacks_level.c File Reference

Functions

static uint8_t get_min_level (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint)
 Finds the Level::MinLevel value for a UNID/ep. More...
 
static uint8_t get_max_level (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint)
 Finds the Level::MaxLevel value for a UNID/ep. More...
 
static uint16_t get_min_frequency (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint)
 Finds the Level::MinFrequency value for a UNID/ep. More...
 
static uint16_t get_max_frequency (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint)
 Finds the Level::MaxFrequency value for a UNID/ep. More...
 
static uint8_t validated_level_value (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint, uint8_t level)
 Verifies that the Level is within the allowed range and returns a valid value from it. More...
 
static void on_remaining_time_reported_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
static void dotdot_set_level_current_level_and_on_off_transition_time (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint, uint8_t level, uint16_t transition_time)
 
bool is_option_active (uint8_t option, uint8_t mask_offset)
 
bool has_execute_if_off_option (uint8_t option_level, uint8_t options_mask, uint8_t options_override)
 Check if ExecuteIfOff option is set according to the ZCL specification (3.10.2.3.1.2). More...
 
sl_status_t level_cluster_mapper_move_to_level (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, uint8_t level, uint16_t transition_time, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_move (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, MoveStepMode move_mode, uint8_t rate, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_step (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, MoveStepMode step_mode, uint8_t step_size, uint16_t transition_time, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_stop (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_move_to_level_with_on_off (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, uint8_t level, uint16_t transition_time, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_move_with_on_off (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, MoveStepMode move_mode, uint8_t rate, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_step_with_on_off (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, MoveStepMode step_mode, uint8_t step_size, uint16_t transition_time, uint8_t options_mask, uint8_t options_override)
 
sl_status_t level_cluster_mapper_stop_with_on_off (dotdot_unid_t unid, uint8_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, uint8_t options_mask, uint8_t options_override)
 
static sl_status_t level_move_to_closest_frequency_command (dotdot_unid_t unid, dotdot_endpoint_id_t endpoint, uic_mqtt_dotdot_callback_call_type_t call_type, uint16_t frequency)
 
void level_cluster_mapper_init ()
 Intitialise the Level cluster mapper. More...
 

Variables

const char LOG_TAG [] = "unify_dotdot_attribute_store_level_commands_callbacks"
 
const uint8_t ON = 0xFF
 
const uint8_t DEFAULT_MOVE_RATE = 0xFF
 
const uint8_t DEFAULT_MIN_LEVEL = 0x00
 
const uint8_t DEFAULT_MAX_LEVEL = 0xFF
 
const uint8_t DEFAULT_MIN_FREQUENCY = 0x00
 
const uint8_t DEFAULT_MAX_FREQUENCY = 0x00
 

Function Documentation

◆ dotdot_set_level_current_level_and_on_off_transition_time()

static void dotdot_set_level_current_level_and_on_off_transition_time ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint,
uint8_t  level,
uint16_t  transition_time 
)
static

◆ get_max_frequency()

static uint16_t get_max_frequency ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint 
)
static

Finds the Level::MaxFrequency value for a UNID/ep.

Parameters
unidUNID of the node we want to get the information for
endpointEndpoint of the node we want to get the information for
Returns
uint16_t MaxFrequency value to use

◆ get_max_level()

static uint8_t get_max_level ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint 
)
static

Finds the Level::MaxLevel value for a UNID/ep.

Parameters
unidUNID of the node we want to get the information for
endpointEndpoint of the node we want to get the information for
Returns
uint8_t MaxLevel value to use

◆ get_min_frequency()

static uint16_t get_min_frequency ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint 
)
static

Finds the Level::MinFrequency value for a UNID/ep.

Parameters
unidUNID of the node we want to get the information for
endpointEndpoint of the node we want to get the information for
Returns
uint16_t MinFrequency value to use

◆ get_min_level()

static uint8_t get_min_level ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint 
)
static

Finds the Level::MinLevel value for a UNID/ep.

Parameters
unidUNID of the node we want to get the information for
endpointEndpoint of the node we want to get the information for
Returns
uint8_t MinLevel value to use

◆ has_execute_if_off_option()

bool has_execute_if_off_option ( uint8_t  option_level,
uint8_t  options_mask,
uint8_t  options_override 
)

Check if ExecuteIfOff option is set according to the ZCL specification (3.10.2.3.1.2).

Parameters
option_levelZCL option attribute
options_maskOption mask
options_overrideOption override

The function checks ExecuteIfOffOn bit in option_level or in options_override if options_mask contains ExecuteIfOffOn bit.

Returns
bool True if ExecuteIfOff option is activated, false otherwise

◆ is_option_active()

bool is_option_active ( uint8_t  option,
uint8_t  mask_offset 
)

◆ level_cluster_mapper_move()

sl_status_t level_cluster_mapper_move ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
MoveStepMode  move_mode,
uint8_t  rate,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_cluster_mapper_move_with_on_off()

sl_status_t level_cluster_mapper_move_with_on_off ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
MoveStepMode  move_mode,
uint8_t  rate,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_cluster_mapper_step()

sl_status_t level_cluster_mapper_step ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
MoveStepMode  step_mode,
uint8_t  step_size,
uint16_t  transition_time,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_cluster_mapper_step_with_on_off()

sl_status_t level_cluster_mapper_step_with_on_off ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
MoveStepMode  step_mode,
uint8_t  step_size,
uint16_t  transition_time,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_cluster_mapper_stop()

sl_status_t level_cluster_mapper_stop ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_cluster_mapper_stop_with_on_off()

sl_status_t level_cluster_mapper_stop_with_on_off ( dotdot_unid_t  unid,
uint8_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
uint8_t  options_mask,
uint8_t  options_override 
)

◆ level_move_to_closest_frequency_command()

static sl_status_t level_move_to_closest_frequency_command ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint,
uic_mqtt_dotdot_callback_call_type_t  call_type,
uint16_t  frequency 
)
static

◆ on_remaining_time_reported_update()

static void on_remaining_time_reported_update ( attribute_store_node_t  updated_node,
attribute_store_change_t  change 
)
static

◆ validated_level_value()

static uint8_t validated_level_value ( dotdot_unid_t  unid,
dotdot_endpoint_id_t  endpoint,
uint8_t  level 
)
static

Verifies that the Level is within the allowed range and returns a valid value from it.

Parameters
unidUNID of the node we want to validate the level
endpointEndpoint of the node we want to validate the level
levelThe value that we received for the level
Returns
uint8_t The validated value that we should apply.

Variable Documentation

◆ DEFAULT_MAX_FREQUENCY

const uint8_t DEFAULT_MAX_FREQUENCY = 0x00

◆ DEFAULT_MAX_LEVEL

const uint8_t DEFAULT_MAX_LEVEL = 0xFF

◆ DEFAULT_MIN_FREQUENCY

const uint8_t DEFAULT_MIN_FREQUENCY = 0x00

◆ DEFAULT_MIN_LEVEL

const uint8_t DEFAULT_MIN_LEVEL = 0x00

◆ DEFAULT_MOVE_RATE

const uint8_t DEFAULT_MOVE_RATE = 0xFF

◆ ON

const uint8_t ON = 0xFF