Z-Wave Protocol Controller Reference
zwave_command_class_switch_multilevel.c File Reference
#include "zwave_command_class_switch_multilevel.h"
#include "zwave_command_classes_utils.h"
#include <stdlib.h>
#include "zwave_command_class_indices.h"
#include "zwave_unid.h"
#include "zwave_command_handler.h"
#include "zpc_attribute_store_network_helper.h"
#include "attribute_store_defined_attribute_types.h"
#include "ZW_classcmd.h"
#include "zpc_attribute_resolver.h"
#include "dotdot_mqtt.h"
#include "dotdot_mqtt_generated_commands.h"
#include "attribute_store_helper.h"
#include "attribute_resolver.h"
#include "attribute_transitions.h"
#include "attribute_timeouts.h"
#include "attribute_mapper.h"
#include "sl_log.h"
Include dependency graph for zwave_command_class_switch_multilevel.c:

Classes

struct  multilevel_switch_state
 Full state of a multilevel Switch supporting node. More...
 

Macros

#define LOG_TAG   "zwave_command_class_switch_multilevel"
 
#define ATTRIBUTE(type)   ATTRIBUTE_COMMAND_CLASS_MULTILEVEL_SWITCH_##type
 
#define SET_VALUE_INDEX   2
 
#define SET_DURATION_INDEX   3
 
#define START_LEVEL_CHANGE_UP_DOWN_INDEX   2
 
#define START_LEVEL_CHANGE_UP_DOWN_MASK   0x40
 
#define START_LEVEL_CHANGE_DURATION_INDEX   4
 
#define MAX_LEVEL   0x63
 
#define MIN_LEVEL   0x00
 
#define REPORT_VALUE_INDEX   2
 
#define REPORT_TARGET_VALUE_INDEX   3
 
#define REPORT_DURATION_INDEX   4
 
#define IGNORE_START_LEVEL   1 << 5
 
#define UP   0
 
#define DOWN   1 << 6
 

Typedefs

typedef struct multilevel_switch_state multilevel_switch_state_t
 Full state of a multilevel Switch supporting node. More...
 

Functions

static void zwave_command_class_switch_multilevel_on_desired_sub_state_update (attribute_store_node_t node, attribute_store_change_t change)
 
static void get_state (attribute_store_node_t state_node, multilevel_switch_state_t *state)
 
static void set_desired_value (attribute_store_node_t state_node, uint32_t value)
 
static void set_reported_value (attribute_store_node_t state_node, uint32_t value)
 
static void set_desired_duration (attribute_store_node_t state_node, uint32_t duration)
 
static void set_reported_duration (attribute_store_node_t state_node, uint32_t duration)
 
static sl_status_t zwave_command_class_switch_multilevel_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_supported_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_set (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_handle_set (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_handle_start_level_change (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_handle_stop_level_change (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_handle_report (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_switch_multilevel_handle_supported_report (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static void on_state_send_data_complete (attribute_store_node_t state_node, resolver_rule_type_t rule_type, zpc_resolver_event_t event)
 
static void zwave_command_class_switch_multilevel_on_version_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
static void update_node_state (attribute_store_node_t state_node)
 Sets the state node desired/reported values to match the sub-state. More...
 
static void zwave_command_class_switch_multilevel_on_reported_sub_state_update (attribute_store_node_t node, attribute_store_change_t change)
 
sl_status_t zwave_command_class_switch_multilevel_control_handler (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
sl_status_t zwave_command_class_switch_multilevel_init ()
 This function initialize the Multilevel Switch Command Class handler. More...
 

Variables

static const attribute_store_type_t v1_sub_attributes [] = {ATTRIBUTE(VALUE), ATTRIBUTE(DURATION)}
 
static const attribute_store_type_t v3_attributes [] = {ATTRIBUTE(CAPABILITIES_REQUESTED)}
 

Macro Definition Documentation

◆ ATTRIBUTE

#define ATTRIBUTE (   type)    ATTRIBUTE_COMMAND_CLASS_MULTILEVEL_SWITCH_##type

◆ DOWN

#define DOWN   1 << 6

◆ IGNORE_START_LEVEL

#define IGNORE_START_LEVEL   1 << 5

◆ LOG_TAG

#define LOG_TAG   "zwave_command_class_switch_multilevel"

◆ MAX_LEVEL

#define MAX_LEVEL   0x63

◆ MIN_LEVEL

#define MIN_LEVEL   0x00

◆ REPORT_DURATION_INDEX

#define REPORT_DURATION_INDEX   4

◆ REPORT_TARGET_VALUE_INDEX

#define REPORT_TARGET_VALUE_INDEX   3

◆ REPORT_VALUE_INDEX

#define REPORT_VALUE_INDEX   2

◆ SET_DURATION_INDEX

#define SET_DURATION_INDEX   3

◆ SET_VALUE_INDEX

#define SET_VALUE_INDEX   2

◆ START_LEVEL_CHANGE_DURATION_INDEX

#define START_LEVEL_CHANGE_DURATION_INDEX   4

◆ START_LEVEL_CHANGE_UP_DOWN_INDEX

#define START_LEVEL_CHANGE_UP_DOWN_INDEX   2

◆ START_LEVEL_CHANGE_UP_DOWN_MASK

#define START_LEVEL_CHANGE_UP_DOWN_MASK   0x40

◆ UP

#define UP   0

Typedef Documentation

◆ multilevel_switch_state_t

Full state of a multilevel Switch supporting node.

Function Documentation

◆ get_state()

static void get_state ( attribute_store_node_t  state_node,
multilevel_switch_state_t state 
)
static
Here is the caller graph for this function:

◆ on_state_send_data_complete()

static void on_state_send_data_complete ( attribute_store_node_t  state_node,
resolver_rule_type_t  rule_type,
zpc_resolver_event_t  event 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_desired_duration()

static void set_desired_duration ( attribute_store_node_t  state_node,
uint32_t  duration 
)
static
Here is the caller graph for this function:

◆ set_desired_value()

static void set_desired_value ( attribute_store_node_t  state_node,
uint32_t  value 
)
static
Here is the caller graph for this function:

◆ set_reported_duration()

static void set_reported_duration ( attribute_store_node_t  state_node,
uint32_t  duration 
)
static
Here is the caller graph for this function:

◆ set_reported_value()

static void set_reported_value ( attribute_store_node_t  state_node,
uint32_t  value 
)
static
Here is the caller graph for this function:

◆ update_node_state()

static void update_node_state ( attribute_store_node_t  state_node)
static

Sets the state node desired/reported values to match the sub-state.

Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_control_handler()

sl_status_t zwave_command_class_switch_multilevel_control_handler ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_get()

static sl_status_t zwave_command_class_switch_multilevel_get ( attribute_store_node_t  node,
uint8_t *  frame,
uint16_t *  frame_length 
)
static
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_handle_report()

static sl_status_t zwave_command_class_switch_multilevel_handle_report ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_handle_set()

static sl_status_t zwave_command_class_switch_multilevel_handle_set ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_handle_start_level_change()

static sl_status_t zwave_command_class_switch_multilevel_handle_start_level_change ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_handle_stop_level_change()

static sl_status_t zwave_command_class_switch_multilevel_handle_stop_level_change ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_handle_supported_report()

static sl_status_t zwave_command_class_switch_multilevel_handle_supported_report ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_on_desired_sub_state_update()

static void zwave_command_class_switch_multilevel_on_desired_sub_state_update ( attribute_store_node_t  node,
attribute_store_change_t  change 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_on_reported_sub_state_update()

static void zwave_command_class_switch_multilevel_on_reported_sub_state_update ( attribute_store_node_t  node,
attribute_store_change_t  change 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_on_version_attribute_update()

static void zwave_command_class_switch_multilevel_on_version_attribute_update ( attribute_store_node_t  updated_node,
attribute_store_change_t  change 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_set()

static sl_status_t zwave_command_class_switch_multilevel_set ( attribute_store_node_t  node,
uint8_t *  frame,
uint16_t *  frame_length 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_switch_multilevel_supported_get()

static sl_status_t zwave_command_class_switch_multilevel_supported_get ( attribute_store_node_t  node,
uint8_t *  frame,
uint16_t *  frame_length 
)
static
Here is the caller graph for this function:

Variable Documentation

◆ v1_sub_attributes

const attribute_store_type_t v1_sub_attributes[] = {ATTRIBUTE(VALUE), ATTRIBUTE(DURATION)}
static

◆ v3_attributes

const attribute_store_type_t v3_attributes[] = {ATTRIBUTE(CAPABILITIES_REQUESTED)}
static