Z-Wave Protocol Controller Reference
zwave_command_class_version.c File Reference
#include "zwave_command_class_version.h"
#include <assert.h>
#include <stdbool.h>
#include "ZW_classcmd.h"
#include "zwave_command_class_version_types.h"
#include "zwave_command_handler.h"
#include "zwave_controller_connection_info.h"
#include "zwave_controller_utils.h"
#include "zwave_rx.h"
#include "zwave_controller_transport.h"
#include "zwave_command_class_indices.h"
#include "attribute_store.h"
#include "attribute_store_helper.h"
#include "zpc_attribute_store_network_helper.h"
#include "attribute_store_defined_attribute_types.h"
#include "attribute_resolver.h"
#include "zwave_utils.h"
#include "zwave_unid.h"
#include "zwave_command_classes_utils.h"
#include "zwapi_init.h"
#include "zpc_config.h"
#include "uic_version.h"
#include "sl_log.h"
Include dependency graph for zwave_command_class_version.c:

Macros

#define LOG_TAG   "zwave_command_class_version"
 
#define NUM_FW_TARGETS   1
 
#define DEFAULT_HARDWARE_VERSION   1
 
#define REPORT_LIBRARY_TYPE_INDEX   2
 
#define REPORT_ZWAVE_PROTOCOL_VERSION_INDEX   3
 
#define REPORT_ZWAVE_PROTOCOL_SUB_VERSION_INDEX   4
 
#define REPORT_FIRMWARE_0_VERSION_INDEX   5
 
#define REPORT_FIRMWARE_0_SUB_VERSION_INDEX   6
 
#define REPORT_HARDWARE_VERSION_INDEX   7
 
#define REPORT_NUMBER_OF_TARGETS_INDEX   8
 
#define REPORT_FIRST_ADDITIONAL_TARGET_INDEX   9
 
#define ATTRIBUTE(type)   ATTRIBUTE_CC_VERSION_##type
 

Functions

static sl_status_t zwave_command_class_version_command_class_version_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static bool is_command_class_version_already_known (attribute_store_node_t node)
 Visits other endpoints under the same NodeID and verify if a particular Command Class version is known. More...
 
static void add_command_class_version_attributes (zwave_command_class_t command_class, attribute_store_node_t endpoint_node)
 
static void parse_nif_and_create_command_class_version_attributes (const uint8_t *nif, uint8_t nif_length, attribute_store_node_t endpoint_node)
 
static void zwave_command_class_version_create_cc_version_attributes (zwave_node_id_t node_id, zwave_endpoint_id_t endpoint_id)
 
static attribute_store_node_t get_or_create_firmware_id_node (attribute_store_node_t version_report_data_node, uint32_t firmware_id)
 Retrieves (and create if needed) the firmware ID node for a given ID under the version report data. More...
 
static sl_status_t zwave_command_class_version_handle_command_class_report_command (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_handle_capabilities_report_command (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_handle_software_report_command (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_handle_report_command (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_classes_version_handler_version_get (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_classes_version_handler_version_cc_get (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_classes_version_handler_capabilities_get (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_classes_version_handler_version_software_get (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_support_handler (const zwave_controller_connection_info_t *connection, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_control_handler (const zwave_controller_connection_info_t *connection, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_version_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static sl_status_t zwave_command_class_version_capabilities_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static sl_status_t zwave_command_class_version_software_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static void on_version_command_class_found_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
static void on_nif_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
static void on_zwave_cc_version_version_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
bool is_version_cc_found (attribute_store_node_t node)
 Checks we know that the version CC is supported by the node. More...
 
sl_status_t zwave_command_class_version_init ()
 Intitialize the Version Command Class control APIs. More...
 

Variables

static const attribute_store_type_t version_report_attribute [] = {ATTRIBUTE(VERSION_REPORT_DATA)}
 
static const attribute_store_type_t version_attributes_v3 []
 

Macro Definition Documentation

◆ ATTRIBUTE

#define ATTRIBUTE (   type)    ATTRIBUTE_CC_VERSION_##type

◆ DEFAULT_HARDWARE_VERSION

#define DEFAULT_HARDWARE_VERSION   1

◆ LOG_TAG

#define LOG_TAG   "zwave_command_class_version"

◆ NUM_FW_TARGETS

#define NUM_FW_TARGETS   1

◆ REPORT_FIRMWARE_0_SUB_VERSION_INDEX

#define REPORT_FIRMWARE_0_SUB_VERSION_INDEX   6

◆ REPORT_FIRMWARE_0_VERSION_INDEX

#define REPORT_FIRMWARE_0_VERSION_INDEX   5

◆ REPORT_FIRST_ADDITIONAL_TARGET_INDEX

#define REPORT_FIRST_ADDITIONAL_TARGET_INDEX   9

◆ REPORT_HARDWARE_VERSION_INDEX

#define REPORT_HARDWARE_VERSION_INDEX   7

◆ REPORT_LIBRARY_TYPE_INDEX

#define REPORT_LIBRARY_TYPE_INDEX   2

◆ REPORT_NUMBER_OF_TARGETS_INDEX

#define REPORT_NUMBER_OF_TARGETS_INDEX   8

◆ REPORT_ZWAVE_PROTOCOL_SUB_VERSION_INDEX

#define REPORT_ZWAVE_PROTOCOL_SUB_VERSION_INDEX   4

◆ REPORT_ZWAVE_PROTOCOL_VERSION_INDEX

#define REPORT_ZWAVE_PROTOCOL_VERSION_INDEX   3

Function Documentation

◆ add_command_class_version_attributes()

static void add_command_class_version_attributes ( zwave_command_class_t  command_class,
attribute_store_node_t  endpoint_node 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_or_create_firmware_id_node()

static attribute_store_node_t get_or_create_firmware_id_node ( attribute_store_node_t  version_report_data_node,
uint32_t  firmware_id 
)
static

Retrieves (and create if needed) the firmware ID node for a given ID under the version report data.

Parameters
version_report_data_nodeAttribute Store node for the Version Report data
firmware_idFirmware ID to look for and create
Returns
attribute_store_node_t
Here is the caller graph for this function:

◆ is_command_class_version_already_known()

static bool is_command_class_version_already_known ( attribute_store_node_t  node)
static

Visits other endpoints under the same NodeID and verify if a particular Command Class version is known.

If the version of a command class is known from another endpoint, it will be copied to the current endpoint.

Parameters
nodeCommand Class version attribute.
Returns
true if the version of a Command Class is known and has been copied from another endpoint
false otherwise
Here is the caller graph for this function:

◆ on_nif_attribute_update()

static void on_nif_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:

◆ on_version_command_class_found_attribute_update()

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

◆ on_zwave_cc_version_version_attribute_update()

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

◆ parse_nif_and_create_command_class_version_attributes()

static void parse_nif_and_create_command_class_version_attributes ( const uint8_t *  nif,
uint8_t  nif_length,
attribute_store_node_t  endpoint_node 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_version_capabilities_get()

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

◆ zwave_command_class_version_command_class_version_get()

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

◆ zwave_command_class_version_control_handler()

static sl_status_t zwave_command_class_version_control_handler ( const zwave_controller_connection_info_t connection,
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_version_create_cc_version_attributes()

static void zwave_command_class_version_create_cc_version_attributes ( zwave_node_id_t  node_id,
zwave_endpoint_id_t  endpoint_id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_command_class_version_get()

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

◆ zwave_command_class_version_handle_capabilities_report_command()

static sl_status_t zwave_command_class_version_handle_capabilities_report_command ( 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_version_handle_command_class_report_command()

static sl_status_t zwave_command_class_version_handle_command_class_report_command ( 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_version_handle_report_command()

static sl_status_t zwave_command_class_version_handle_report_command ( 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_version_handle_software_report_command()

static sl_status_t zwave_command_class_version_handle_software_report_command ( 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_version_software_get()

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

◆ zwave_command_class_version_support_handler()

static sl_status_t zwave_command_class_version_support_handler ( const zwave_controller_connection_info_t connection,
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_classes_version_handler_capabilities_get()

static sl_status_t zwave_command_classes_version_handler_capabilities_get ( 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_classes_version_handler_version_cc_get()

static sl_status_t zwave_command_classes_version_handler_version_cc_get ( 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_classes_version_handler_version_get()

static sl_status_t zwave_command_classes_version_handler_version_get ( 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_classes_version_handler_version_software_get()

static sl_status_t zwave_command_classes_version_handler_version_software_get ( 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:

Variable Documentation

◆ version_attributes_v3

const attribute_store_type_t version_attributes_v3[]
static
Initial value:
= {ATTRIBUTE(SDK_VERSION),
ATTRIBUTE(APPLICATION_FRAMEWORK_API_VERSION),
ATTRIBUTE(APPLICATION_FRAMEWORK_BUILD_NUMBER),
ATTRIBUTE(HOST_INTERFACE_VERSION),
ATTRIBUTE(HOST_INTERFACE_BUILD_NUMBER),
ATTRIBUTE(ZWAVE_PROTOCOL_BUILD_NUMBER),
ATTRIBUTE(APPLICATION_BUILD_NUMBER)}
#define ATTRIBUTE(type)
Definition: zwave_command_class_version.c:63

◆ version_report_attribute

const attribute_store_type_t version_report_attribute[] = {ATTRIBUTE(VERSION_REPORT_DATA)}
static