Z-Wave Protocol Controller Reference
zwave_command_class_multi_channel.c File Reference
#include "zwave_command_class_multi_channel.h"
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include "ZW_classcmd.h"
#include "zwave_command_handler.h"
#include "zwave_controller_connection_info.h"
#include "zwave_controller_utils.h"
#include "zwave_command_class_indices.h"
#include "zwave_rx.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_unid.h"
#include "sl_log.h"
Include dependency graph for zwave_command_class_multi_channel.c:

Macros

#define LOG_TAG   "zwave_command_class_multi_channel"
 
#define REPORT_IDENTICAL_ENDPOINTS_MASK   0x40
 
#define REPORT_IDENTICAL_ENDPOINTS_INDEX   2
 
#define REPORT_INDIVIDUAL_ENDPOINTS_INDEX   3
 
#define REPORT_AGGREGATED_ENDPOINTS_INDEX   4
 
#define CAPABILITY_REPORT_ENDPOINT_INDEX   2
 
#define CAPABILITY_REPORT_GENERIC_DEVICE_CLASS_INDEX   3
 
#define CAPABILITY_REPORT_SPECIFIC_DEVICE_CLASS_INDEX   4
 
#define CAPABILITY_REPORT_COMMAND_CLASS_LIST_INDEX   5
 
#define CAPABILITY_REPORT_ENDPOINT_LIST_INDEX   5
 
#define AGGREGATED_MEMBER_REPORT_ENDPOINT_INDEX   2
 
#define AGGREGATED_MEMBER_REPORT_NUMBER_OF_BIT_MASKS_INDEX   3
 
#define AGGREGATED_MEMBER_REPORT_FIRST_BITMASK_INDEX   4
 

Functions

static attribute_store_node_t create_new_endpoint (attribute_store_node_t node_id_node, zwave_endpoint_id_t endpoint_id, bool is_aggregated)
 Creates a new endpoint in the attribute store. More...
 
static void create_aggregated_endpoints (attribute_store_node_t node_id_node)
 Creates aggregated endpoints for a Z-Wave Node. More...
 
static void check_if_all_individual_endpoints_are_found (attribute_store_node_t node_id_node)
 Counts in the attribute store if the number of individual endpoints attribute matches the current list of individual endpoints. More...
 
static sl_status_t zwave_command_class_multi_channel_handle_endpoint_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_multi_channel_handle_capability_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_multi_channel_handle_endpoint_find_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_multi_channel_handle_aggregated_members_report_command (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
sl_status_t zwave_command_class_multi_channel_control_handler (const zwave_controller_connection_info_t *connection_info, const uint8_t *frame_data, uint16_t frame_length)
 
static sl_status_t zwave_command_class_multi_channel_endpoint_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
sl_status_t zwave_command_class_multi_channel_capability_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 Resolves a Non-secure NIF for an Endpoint ID > 0. More...
 
static sl_status_t zwave_command_class_multi_channel_endpoint_find (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static sl_status_t zwave_command_class_multi_channel_aggregated_members_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
 
static void zwave_command_class_multi_channel_on_version_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change)
 
bool is_endpoint_aggregated (attribute_store_node_t endpoint_node)
 Checks if an endpoints is aggregated. More...
 
sl_status_t zwave_command_class_multi_channel_init ()
 Initialize the Multi Channel Command Class (handler) *. More...
 

Variables

static const attribute_store_type_t v3_attributes []
 
static const attribute_store_type_t v4_attributes [] = {ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_AGGREGATED_ENDPOINTS}
 

Macro Definition Documentation

◆ AGGREGATED_MEMBER_REPORT_ENDPOINT_INDEX

#define AGGREGATED_MEMBER_REPORT_ENDPOINT_INDEX   2

◆ AGGREGATED_MEMBER_REPORT_FIRST_BITMASK_INDEX

#define AGGREGATED_MEMBER_REPORT_FIRST_BITMASK_INDEX   4

◆ AGGREGATED_MEMBER_REPORT_NUMBER_OF_BIT_MASKS_INDEX

#define AGGREGATED_MEMBER_REPORT_NUMBER_OF_BIT_MASKS_INDEX   3

◆ CAPABILITY_REPORT_COMMAND_CLASS_LIST_INDEX

#define CAPABILITY_REPORT_COMMAND_CLASS_LIST_INDEX   5

◆ CAPABILITY_REPORT_ENDPOINT_INDEX

#define CAPABILITY_REPORT_ENDPOINT_INDEX   2

◆ CAPABILITY_REPORT_ENDPOINT_LIST_INDEX

#define CAPABILITY_REPORT_ENDPOINT_LIST_INDEX   5

◆ CAPABILITY_REPORT_GENERIC_DEVICE_CLASS_INDEX

#define CAPABILITY_REPORT_GENERIC_DEVICE_CLASS_INDEX   3

◆ CAPABILITY_REPORT_SPECIFIC_DEVICE_CLASS_INDEX

#define CAPABILITY_REPORT_SPECIFIC_DEVICE_CLASS_INDEX   4

◆ LOG_TAG

#define LOG_TAG   "zwave_command_class_multi_channel"

◆ REPORT_AGGREGATED_ENDPOINTS_INDEX

#define REPORT_AGGREGATED_ENDPOINTS_INDEX   4

◆ REPORT_IDENTICAL_ENDPOINTS_INDEX

#define REPORT_IDENTICAL_ENDPOINTS_INDEX   2

◆ REPORT_IDENTICAL_ENDPOINTS_MASK

#define REPORT_IDENTICAL_ENDPOINTS_MASK   0x40

◆ REPORT_INDIVIDUAL_ENDPOINTS_INDEX

#define REPORT_INDIVIDUAL_ENDPOINTS_INDEX   3

Function Documentation

◆ check_if_all_individual_endpoints_are_found()

static void check_if_all_individual_endpoints_are_found ( attribute_store_node_t  node_id_node)
static

Counts in the attribute store if the number of individual endpoints attribute matches the current list of individual endpoints.

It will write the value 1 to the ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_ALL_INDIVIDUAL_ENDPOINTS_FOUND attribute under endpoint 0 when it is the case.

Parameters
node_id_nodeThe attribute store node that represents the NodeID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_aggregated_endpoints()

static void create_aggregated_endpoints ( attribute_store_node_t  node_id_node)
static

Creates aggregated endpoints for a Z-Wave Node.

Call this function only when all the individual endpoints have been discovered. It will verify how many aggregated endpoints are reported under the endpoint 0 "number of aggregated endpoints" attribute, then create them in a consecutive range after the last individual endpoint.

Parameters
node_id_nodeThe attribute store node that represents the NodeID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_new_endpoint()

static attribute_store_node_t create_new_endpoint ( attribute_store_node_t  node_id_node,
zwave_endpoint_id_t  endpoint_id,
bool  is_aggregated 
)
static

Creates a new endpoint in the attribute store.

Creation will be skipped if the endpoint already exists.

Parameters
node_id_nodeThe attribute store node that represents the NodeID
endpoint_idEndpoint ID to create for the node.
is_aggregatedis the endpoint aggregated?
Returns
attribute_store_node_t of the endpoint created (or that already exists).
Here is the caller graph for this function:

◆ zwave_command_class_multi_channel_aggregated_members_get()

static sl_status_t zwave_command_class_multi_channel_aggregated_members_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_multi_channel_control_handler()

sl_status_t zwave_command_class_multi_channel_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_multi_channel_endpoint_find()

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

◆ zwave_command_class_multi_channel_endpoint_get()

static sl_status_t zwave_command_class_multi_channel_endpoint_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_multi_channel_handle_aggregated_members_report_command()

static sl_status_t zwave_command_class_multi_channel_handle_aggregated_members_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_multi_channel_handle_capability_report_command()

static sl_status_t zwave_command_class_multi_channel_handle_capability_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_multi_channel_handle_endpoint_find_report_command()

static sl_status_t zwave_command_class_multi_channel_handle_endpoint_find_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_multi_channel_handle_endpoint_report_command()

static sl_status_t zwave_command_class_multi_channel_handle_endpoint_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_multi_channel_on_version_attribute_update()

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

Variable Documentation

◆ v3_attributes

const attribute_store_type_t v3_attributes[]
static
Initial value:
= {ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_IDENTICAL_ENDPOINTS,
ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_INDIVIDUAL_ENDPOINTS,
ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_ALL_INDIVIDUAL_ENDPOINTS_FOUND}

◆ v4_attributes

const attribute_store_type_t v4_attributes[] = {ATTRIBUTE_COMMAND_CLASS_MULTI_CHANNEL_AGGREGATED_ENDPOINTS}
static