Z-Wave Protocol Controller Reference
zwave_command_class_granted_keys_resolver.c File Reference
#include "zwave_command_class_granted_keys_resolver.h"
#include "attribute_store_defined_attribute_types.h"
#include "zwave_keyset_definitions.h"
#include "zwave_node_id_definitions.h"
#include "zwave_helper_macros.h"
#include "zwave_utils.h"
#include "zpc_attribute_resolver.h"
#include "zpc_attribute_store_network_helper.h"
#include "zwave_tx.h"
#include "zwave_tx_scheme_selector.h"
#include "attribute_store.h"
#include "attribute_timeouts.h"
#include "attribute_store_helper.h"
#include "attribute_resolver.h"
#include "sl_log.h"
Include dependency graph for zwave_command_class_granted_keys_resolver.c:

Macros

#define LOG_TAG   "zwave_granted_keys_resolver"
 

Functions

static void exclude_combinations_with_protocol_from_discovery (attribute_store_node_t node_id_node, zwave_protocol_t protocol)
 Remove some discovery combinations if we know the protocol. More...
 
static bool is_nif_resolved (attribute_store_node_t node_id_node)
 Verifies if the Non-secure NIF is already resolved. More...
 
static void create_list_of_keys_protocol_to_resolve (attribute_store_node_t node_id_node, bool s2_support, bool s0_support)
 Create a list of keys/protocol objects to resolve. More...
 
void on_zwave_key_probe_send_data_complete (uint8_t status, const zwapi_tx_report_t *tx_info, void *user)
 
static void on_inclusion_protocol_update (attribute_store_node_t protocol_node, attribute_store_change_t change)
 Checks if the inclusion protocol just got updated to UNKNOWN, and undefine it if that's the case (because we know how to resolve it now) More...
 
static void on_granted_keys_update (attribute_store_node_t granted_keys_node, attribute_store_change_t change)
 Checks if the granted keys were just set to 0. In this case, we automatically adjust the Inclusion Protocol to be Z-Wave. More...
 
static void on_node_info_update (attribute_store_node_t node, attribute_store_change_t change)
 Reacts to Node Info Frame updates and verify that we will search for granted keys/inclusion protocol next. More...
 
static sl_status_t zwave_command_class_get_granted_keys (attribute_store_node_t keyset_node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_get_inclusion_protocol (attribute_store_node_t protocol_node, uint8_t *frame, uint16_t *frame_length)
 
static sl_status_t zwave_command_class_probe_key_and_protocol (attribute_store_node_t key_protocol_node, uint8_t *frame, uint16_t *frame_length)
 
void zwave_command_class_mark_key_protocol_as_supported (attribute_store_node_t node_id_node, zwave_controller_encapsulation_scheme_t encapsulation)
 Updates the Attribute Store to indicate that the Security key and Protocol that we just used are working with this node. More...
 
sl_status_t zwave_command_class_granted_keys_resolver_init ()
 Registers callbacks to the attribute store and rules to the attribute resolver to be able to resolve Node's capabilities. More...
 

Variables

const uint8_t s2_probe [] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_COMMANDS_SUPPORTED_GET}
 
const uint8_t s0_probe [] = {COMMAND_CLASS_SECURITY, SECURITY_COMMANDS_SUPPORTED_GET}
 

Macro Definition Documentation

◆ LOG_TAG

#define LOG_TAG   "zwave_granted_keys_resolver"

Function Documentation

◆ create_list_of_keys_protocol_to_resolve()

static void create_list_of_keys_protocol_to_resolve ( attribute_store_node_t  node_id_node,
bool  s2_support,
bool  s0_support 
)
static

Create a list of keys/protocol objects to resolve.

Parameters
node_id_nodeAttribute Store Node for the NodeID.
s2_supportflag indicating if S2 is in the NIF
s0_supportflag indicating if S0 is in the NIF
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exclude_combinations_with_protocol_from_discovery()

static void exclude_combinations_with_protocol_from_discovery ( attribute_store_node_t  node_id_node,
zwave_protocol_t  protocol 
)
static

Remove some discovery combinations if we know the protocol.

Combinations with a different protocols will be removed.

Parameters
node_id_nodeAttribute Store node for the NodeId
protocolZ-Wave Protocol that we want too keep.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_nif_resolved()

static bool is_nif_resolved ( attribute_store_node_t  node_id_node)
static

Verifies if the Non-secure NIF is already resolved.

Parameters
node_id_nodeAttribute Store for the NodeID.
Returns
if the NodeID's NIF is known and resolved, false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_granted_keys_update()

static void on_granted_keys_update ( attribute_store_node_t  granted_keys_node,
attribute_store_change_t  change 
)
static

Checks if the granted keys were just set to 0. In this case, we automatically adjust the Inclusion Protocol to be Z-Wave.

Parameters
granted_keys_nodeAttribute Store Node for the granted keys
changeAttribute Store change applied to the node.
Here is the caller graph for this function:

◆ on_inclusion_protocol_update()

static void on_inclusion_protocol_update ( attribute_store_node_t  protocol_node,
attribute_store_change_t  change 
)
static

Checks if the inclusion protocol just got updated to UNKNOWN, and undefine it if that's the case (because we know how to resolve it now)

Parameters
protocol_nodeAttribute Store Node for the inclusion protocol
changeAttribute Store change applied to the node.
Here is the caller graph for this function:

◆ on_node_info_update()

static void on_node_info_update ( attribute_store_node_t  node,
attribute_store_change_t  change 
)
static

Reacts to Node Info Frame updates and verify that we will search for granted keys/inclusion protocol next.

Parameters
nodeAttribute Store Node that is updated
changeAttribute Store changed applied to the node.
Here is the caller graph for this function:

◆ on_zwave_key_probe_send_data_complete()

void on_zwave_key_probe_send_data_complete ( uint8_t  status,
const zwapi_tx_report_t tx_info,
void *  user 
)
Here is the caller graph for this function:

◆ zwave_command_class_get_granted_keys()

static sl_status_t zwave_command_class_get_granted_keys ( attribute_store_node_t  keyset_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_get_inclusion_protocol()

static sl_status_t zwave_command_class_get_inclusion_protocol ( attribute_store_node_t  protocol_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_probe_key_and_protocol()

static sl_status_t zwave_command_class_probe_key_and_protocol ( attribute_store_node_t  key_protocol_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:

Variable Documentation

◆ s0_probe

const uint8_t s0_probe[] = {COMMAND_CLASS_SECURITY, SECURITY_COMMANDS_SUPPORTED_GET}

◆ s2_probe

const uint8_t s2_probe[] = {COMMAND_CLASS_SECURITY_2, SECURITY_2_COMMANDS_SUPPORTED_GET}