Z-Wave Protocol Controller Reference
zwave_command_class_basic.c File Reference
#include "zwave_command_class_basic.h"
#include "zwave_command_classes_utils.h"
#include <stdlib.h>
#include <assert.h>
#include "zwave_command_class_indices.h"
#include "zwave_controller_utils.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 "zwave_tx.h"
#include "zwave_tx_scheme_selector.h"
#include "attribute_store_helper.h"
#include "attribute_resolver.h"
#include "attribute_timeouts.h"
#include "dotdot_mqtt_generated_commands.h"
#include "sl_log.h"
Include dependency graph for zwave_command_class_basic.c:

Macros

#define LOG_TAG   "zwave_command_class_basic"
 
#define ATTRIBUTE(type)   ATTRIBUTE_COMMAND_CLASS_BASIC_##type
 
#define REPORT_VALUE_INDEX   2
 
#define REPORT_TARGET_VALUE_INDEX   3
 
#define REPORT_DURATION_INDEX   4
 
#define SET_VALUE_INDEX   2
 
#define ON   0xFF
 
#define OFF   0x00
 

Enumerations

enum  basic_probe_status_t { NOT_REQUESTED = 0 , REQUESTED = 1 , ANSWERED = 2 }
 

Functions

static basic_probe_status_t get_basic_probe_status (attribute_store_node_t endpoint_id_node)
 get the Basic probe status for an endpoint node More...
 
static sl_status_t set_basic_probe_status (attribute_store_node_t endpoint_id_node, basic_probe_status_t probe_status)
 Sets the Basic probe status for an endpoint node. More...
 
static bool do_not_try_basic (attribute_store_node_t nif_node)
 Checks if we can use Basic to control a node. More...
 
static void send_basic_probe (attribute_store_node_t endpoint_node)
 Sends a Basic Probe to an endpoint. More...
 
static sl_status_t zwave_command_class_basic_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_basic_set (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_basic_handle_set (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 Handles incoming Basic Set Commands. More...
 
static sl_status_t zwave_command_class_basic_handle_report (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static void on_endpoint_interview_completed (attribute_store_node_t endpoint_node)
 
static void on_nif_created (attribute_store_node_t node, attribute_store_change_t change)
 
sl_status_t zwave_command_class_basic_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_basic_init ()
 Initialize the basic command class handler. More...
 

Variables

static const attribute_store_type_t v1_attributes [] = {ATTRIBUTE(VALUE), ATTRIBUTE(VERSION)}
 

Macro Definition Documentation

◆ ATTRIBUTE

#define ATTRIBUTE (   type)    ATTRIBUTE_COMMAND_CLASS_BASIC_##type

◆ LOG_TAG

#define LOG_TAG   "zwave_command_class_basic"

◆ OFF

#define OFF   0x00

◆ ON

#define ON   0xFF

◆ 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_VALUE_INDEX

#define SET_VALUE_INDEX   2

Enumeration Type Documentation

◆ basic_probe_status_t

Enumerator
NOT_REQUESTED 
REQUESTED 
ANSWERED 

Function Documentation

◆ do_not_try_basic()

static bool do_not_try_basic ( attribute_store_node_t  nif_node)
static

Checks if we can use Basic to control a node.

Parameters
nif_nodeAttribute Store node for the NIF. It can be Secure or Non-secure NIF.
Returns
true if Basic MUST NOT be used for this node. False if it MAY.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_basic_probe_status()

static basic_probe_status_t get_basic_probe_status ( attribute_store_node_t  endpoint_id_node)
static

get the Basic probe status for an endpoint node

Parameters
endpoint_id_nodeAttribute Store node for the Endpoint ID
Returns
basic_probe_status_t value of the probe status.
Here is the caller graph for this function:

◆ on_endpoint_interview_completed()

static void on_endpoint_interview_completed ( attribute_store_node_t  endpoint_node)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_nif_created()

static void on_nif_created ( 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:

◆ send_basic_probe()

static void send_basic_probe ( attribute_store_node_t  endpoint_node)
static

Sends a Basic Probe to an endpoint.

Parameters
endpoint_nodeAttribute Store node for the Endpoint
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_basic_probe_status()

static sl_status_t set_basic_probe_status ( attribute_store_node_t  endpoint_id_node,
basic_probe_status_t  probe_status 
)
static

Sets the Basic probe status for an endpoint node.

Parameters
endpoint_id_nodeAttribute Store node for the Endpoint ID
probe_statusValue of the probe status to set
Returns
sl_status_t indicating if the value was set.
Here is the caller graph for this function:

◆ zwave_command_class_basic_control_handler()

sl_status_t zwave_command_class_basic_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_basic_get()

static sl_status_t zwave_command_class_basic_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_basic_handle_report()

static sl_status_t zwave_command_class_basic_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_basic_handle_set()

static sl_status_t zwave_command_class_basic_handle_set ( const zwave_controller_connection_info_t connection_info,
const uint8_t *  frame_data,
uint16_t  frame_length 
)
static

Handles incoming Basic Set Commands.

It will convert it into a Generated OnOff command (either On or Off)

Parameters
connection_infoConnection information with the sender
frame_dataPointer to a frame data
frame_lengthLength of the data that can be read in the frame_data pointer.
Returns
Always SL_STATUS_NOT_SUPPORTED as this command is not supported.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_basic_set()

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

Variable Documentation

◆ v1_attributes

const attribute_store_type_t v1_attributes[] = {ATTRIBUTE(VALUE), ATTRIBUTE(VERSION)}
static