Z-Wave Protocol Controller Reference
nm_state_machine.h
Go to the documentation of this file.
1#ifndef NM_STATE_MACHINE_H
2#define NM_STATE_MACHINE_H
3
4//#include <nm_stub.h>
6
10#include "sys/etimer.h"
11#include "sl_status.h"
12
13#define NODE_INFO_MAX_SIZE 64
14
19typedef struct network_mgmt_state {
20 // Cached information about our current network
24 // Bitmask cached from Get Controller Capabilities Command
26
34 /*This buffer is global, because the node info is only present in the */
37 int flags;
38
39 /* Used for testing when middleware has finished probing a newly
40 * included SmartStart node */
41
60
63
66
74
75 struct etimer timer;
76 // Requested Learn mode
83
87
89
90typedef struct smartstart_event_data {
95
96typedef struct route_event_data {
100
101void nm_fsm_post_event(nm_event_t ev, void *event_data);
102/*****************************************************************************/
109#define NMS_FLAG_S2_ADD 1
116#define NMS_FLAG_PROXY_INCLUSION 2
127#define NMS_FLAG_LEARNMODE_NEW 4
137#define NMS_FLAG_LEARNMODE_NWI 8
147#define NMS_FLAG_LEARNMODE_NWE 0x10
157#define NMS_FLAG_CONTROLLER_REPLICATION 0x20
165#define NMS_FLAG_SMART_START_INCLUSION 0x40
174#define NMS_FLAG_REPORT_DSK 0x80
180#define NMS_FLAG_CSA_INCLUSION 0x100
181
203
204#endif
uint32_t sl_status_t
Definition: sl_status.h:139
uint8_t zwave_dsk_t[ZWAVE_DSK_LENGTH]
Definition: zwave_controller_types.h:41
enum zwave_protocol zwave_protocol_t
Z-Wave Inclusion Protocol (Z-Wave / Z-Wave Long Range).
uint8_t zwave_keyset_t
Definition: zwave_keyset_definitions.h:32
zwave_learn_mode_t
Definition: zwave_network_management_types.h:104
zwave_network_management_state_t
States of the Network Management module.
Definition: zwave_network_management_types.h:119
zwave_kex_fail_type_t
Error codes used in S2 inclusion.
Definition: zwave_network_management_types.h:59
#define PRIORITY_ROUTE_SIZE
4 hops + speed
Definition: zwave_network_management.h:391
uint32_t zwave_home_id_t
Z-Wave HomeID type.
Definition: zwave_node_id_definitions.h:87
uint8_t zwave_nodemask_t[ZW_LR_MAX_NODEMASK_LENGTH]
Node mask.
Definition: zwave_node_id_definitions.h:81
uint16_t zwave_node_id_t
Z-Wave NodeID type.
Definition: zwave_node_id_definitions.h:84
void nm_state_machine_init()
Initialize the Z-Wave network management state machine.
Definition: nm_state_machine.c:302
network_mgmt_state_t nms
Definition: nm_state_machine.c:63
struct route_event_data route_event_data_t
void nm_state_machine_teardown()
Teardown the Z-Wave network management state machine Resets network_mgmt_state_t nms Sets the Network...
Definition: nm_state_machine.c:296
struct network_mgmt_state network_mgmt_state_t
struct smartstart_event_data smartstart_event_data_t
void nm_fsm_post_event(nm_event_t ev, void *event_data)
Definition: nm_state_machine.c:341
SL Status Codes.
Definition: nm_state_machine.h:19
zwave_keyset_t requested_keys
Requested keys keys requested by a node.
Definition: nm_state_machine.h:51
zwave_node_id_t node_id_being_handled
Definition: nm_state_machine.h:33
uint8_t is_controller
Indicates if the node being included is a controller.
Definition: nm_state_machine.h:79
zwave_dsk_t reported_dsk
The DSK reported by the node, this is pushed in libs2.
Definition: nm_state_machine.h:45
zwave_protocol_t inclusion_protocol
Definition: nm_state_machine.h:64
bool accepted_csa
If csa request is accepted.
Definition: nm_state_machine.h:57
zwave_dsk_t verified_dsk_input
Verified DSK input to be used in S2 inclusion for Authenticated Security Classes.
Definition: nm_state_machine.h:47
bool s0_inclusion_enabled
Whether S0 inclusion/bootstrapping is enabled.
Definition: nm_state_machine.h:85
zwave_learn_mode_t learn_mode_intent
Definition: nm_state_machine.h:77
zwave_keyset_t granted_keys
Definition: nm_state_machine.h:62
zwave_home_id_t cached_home_id
Definition: nm_state_machine.h:21
struct etimer timer
Definition: nm_state_machine.h:75
zwave_network_management_state_t state
Definition: nm_state_machine.h:35
zwave_dsk_t expected_dsk
The DSK we expect, this is used in SmartStart inclusion.
Definition: nm_state_machine.h:43
zwave_nodemask_t cached_node_list
Definition: nm_state_machine.h:23
bool smart_start_learn_mode_enabled
Definition: nm_state_machine.h:73
bool accepted_s2_bootstrapping
If the S2 bootstrapping is accepted.
Definition: nm_state_machine.h:55
bool s2_bootstrapping_started
Flag to keep track if S2 boostrapping has been initiated.
Definition: nm_state_machine.h:59
sl_status_t status
Definition: nm_state_machine.h:65
zwave_node_info_t node_info
Definition: nm_state_machine.h:67
bool smart_start_add_mode_enabled
True if SmartStart should be enabled after returning to idle.
Definition: nm_state_machine.h:69
uint8_t proxy_inclusion_step
Definition: nm_state_machine.h:82
uint8_t controller_capabilities_bitmask
Definition: nm_state_machine.h:25
int flags
Definition: nm_state_machine.h:37
uint8_t reported_dsk_blanked
Number of bytes in the reported dsk which has been blanked.
Definition: nm_state_machine.h:49
zwave_kex_fail_type_t kex_fail_type
Definition: nm_state_machine.h:61
bool requested_csa
If the node requested csa.
Definition: nm_state_machine.h:53
zwave_node_id_t cached_local_node_id
Definition: nm_state_machine.h:22
Definition: nm_state_machine.h:96
uint8_t route[PRIORITY_ROUTE_SIZE]
Definition: nm_state_machine.h:98
zwave_node_id_t node_id
Definition: nm_state_machine.h:97
Definition: nm_state_machine.h:90
zwave_keyset_t granted_keys
Definition: nm_state_machine.h:92
zwave_protocol_t preferred_inclusion
Definition: nm_state_machine.h:93
zwave_dsk_t dsk
Definition: nm_state_machine.h:91
Structure holding a Z-Wave node info frame.
Definition: zwave_controller_types.h:50
Z-Wave API for Z-Wave controllers (network setup and maintenance)
Interface to zwave_network_management_process.
nm_event_t
Definition: zwave_network_management_process.h:26