Z-Wave Protocol Controller Reference
nm_state_machine.c File Reference

state machine for zwave_network_management More...

#include <string.h>
#include <stdlib.h>
#include "state_logging.h"
#include "nm_state_machine.h"
#include "zwave_network_management.h"
#include "zwave_network_management_types.h"
#include "zwave_rx.h"
#include "zwave_network_management_process.h"
#include "zwave_network_management_helpers.h"
#include "zwave_network_management_callbacks.h"
#include "zwave_network_management_return_route_queue.h"
#include "zwave_helper_macros.h"
#include "ZW_classcmd.h"
#include "zwapi_protocol_controller.h"
#include "zwapi_protocol_mem.h"
#include "zwapi_init.h"
#include "zwave_controller_internal.h"
#include "zwave_controller_types.h"
#include "zwave_controller_utils.h"
#include "zwave_controller_storage.h"
#include "zwave_s0_network.h"
#include "zwave_s2_network.h"
#include "zwave_s2_keystore.h"
#include "zwave_tx.h"
#include "zwave_smartstart_management.h"
#include "sl_log.h"
#include "process.h"
#include "sys/etimer.h"
Include dependency graph for nm_state_machine.c:

Macros

#define LOG_TAG   "nm_state_machine"
 
#define ADD_NODE_HOME_ID   8
 
#define ADD_NODE_STOP   5
 
#define ADD_NODE_STOP_FAILED   6
 
#define OBFUSCATED_DSK_LEN   2
 
#define ACCEPT_DSK   1
 
#define REJECT_DSK   0
 

Functions

 PROCESS_NAME (zwave_network_management_process)
 
static uint8_t get_event_for_learn_status (uint8_t learn_info_status)
 
static void add_node_status_update (LEARN_INFO *inf)
 
static void on_secure_inclusion_complete (zwave_keyset_t granted_keys, zwave_kex_fail_type_t kex_fail_code)
 
static void on_keys_request (zwave_keyset_t requested_keys, bool csa)
 
static void on_dsk_challenge (zwave_keyset_t granted_keys, int dsk_length, zwave_dsk_t dsk)
 
static void on_s2_inclusion_started ()
 
static void on_remove_failed_status_update (uint8_t status)
 
static void on_remove_node_status_update (LEARN_INFO *remove_node_information)
 
static void dispatch_node_added ()
 Tell the Z-Wave Controller that a Network Inclusion operation has completed and returns the NM state machine to IDLE. More...
 
static void on_new_network (zwave_kex_fail_type_t kex_fail)
 This function is called at the end of a set default or after learnmode. More...
 
static void nop_send_done (uint8_t status, const zwapi_tx_report_t *tx_info, void *user)
 
void nm_state_machine_teardown ()
 Teardown the Z-Wave network management state machine Resets network_mgmt_state_t nms Sets the Network Management state to NM_IDLE Stops all ongoing Network management operations. More...
 
void nm_state_machine_init ()
 Initialize the Z-Wave network management state machine. More...
 
void nm_fsm_post_event (nm_event_t ev, void *event_data)
 

Variables

network_mgmt_state_t nms
 
static LEARN_INFO inf_bkup
 
static uint8_t info_buf [NODE_INFO_MAX_SIZE]
 

Detailed Description

state machine for zwave_network_management

License

Copyright 2021 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

Macro Definition Documentation

◆ ACCEPT_DSK

#define ACCEPT_DSK   1

◆ ADD_NODE_HOME_ID

#define ADD_NODE_HOME_ID   8

◆ ADD_NODE_STOP

#define ADD_NODE_STOP   5

◆ ADD_NODE_STOP_FAILED

#define ADD_NODE_STOP_FAILED   6

◆ LOG_TAG

#define LOG_TAG   "nm_state_machine"

◆ OBFUSCATED_DSK_LEN

#define OBFUSCATED_DSK_LEN   2

◆ REJECT_DSK

#define REJECT_DSK   0

Function Documentation

◆ add_node_status_update()

static void add_node_status_update ( LEARN_INFO inf)
static

Callback for zwapi_add_node_to_network()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dispatch_node_added()

static void dispatch_node_added ( )
static

Tell the Z-Wave Controller that a Network Inclusion operation has completed and returns the NM state machine to IDLE.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_event_for_learn_status()

static uint8_t get_event_for_learn_status ( uint8_t  learn_info_status)
static
Here is the caller graph for this function:

◆ nm_fsm_post_event()

void nm_fsm_post_event ( nm_event_t  ev,
void *  event_data 
)

If it is a SmartStart inclusion, we just start S2 bootstrapping

S2 inclusion starts, we set the flag to S2_ADD to ensure it is S2 inclusion

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_state_machine_init()

void nm_state_machine_init ( )

Initialize the Z-Wave network management state machine.

Sets zwave_s2_network_callbacks_t Calls zwave_s2_set_network_callbacks and zwave_s0_set_network_callbacks Resets network_mgmt_state_t nms Sets the Network Management state to NM_IDLE Print the HomeID, NodeID and DSK to console and Print node list Stops all ongoing Network management operations

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_state_machine_teardown()

void nm_state_machine_teardown ( )

Teardown the Z-Wave network management state machine Resets network_mgmt_state_t nms Sets the Network Management state to NM_IDLE Stops all ongoing Network management operations.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nop_send_done()

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

◆ on_dsk_challenge()

static void on_dsk_challenge ( zwave_keyset_t  granted_keys,
int  dsk_length,
zwave_dsk_t  dsk 
)
static
Here is the caller graph for this function:

◆ on_keys_request()

static void on_keys_request ( zwave_keyset_t  requested_keys,
bool  csa 
)
static
Here is the caller graph for this function:

◆ on_new_network()

static void on_new_network ( zwave_kex_fail_type_t  kex_fail)
static

This function is called at the end of a set default or after learnmode.

Parameters
kex_failS2 failure code if any
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_remove_failed_status_update()

static void on_remove_failed_status_update ( uint8_t  status)
static

Callback for Remove a failed / self-destructed node Notify the FSM of status of RemoveFailed

Parameters
statusOne of the zwapi_remove_failed_node() callback statuses: ZW_NODE_OK ZW_FAILED_NODE_REMOVED ZW_FAILED_NODE_NOT_REMOVED.
Here is the caller graph for this function:

◆ on_remove_node_status_update()

static void on_remove_node_status_update ( LEARN_INFO remove_node_information)
static
Here is the caller graph for this function:

◆ on_s2_inclusion_started()

static void on_s2_inclusion_started ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_secure_inclusion_complete()

static void on_secure_inclusion_complete ( zwave_keyset_t  granted_keys,
zwave_kex_fail_type_t  kex_fail_code 
)
static
Here is the caller graph for this function:

◆ PROCESS_NAME()

PROCESS_NAME ( zwave_network_management_process  )

Variable Documentation

◆ inf_bkup

LEARN_INFO inf_bkup
static

◆ info_buf

uint8_t info_buf[NODE_INFO_MAX_SIZE]
static

◆ nms