Z-Wave Protocol Controller Reference
Z-Wave Network Management

Z-Wave network management component. More...

Collaboration diagram for Z-Wave Network Management:

Modules

 Z-Wave Network Management Fixture
 Z-Wave Network Management Fixture.
 
 Callbacks used by the Z-Wave Network management
 Z-Wave Network Management callback functions.
 
 Z-Wave Network Management helpers
 Internal helper functions used with Network Management.
 
 Return Route Assignment Queue
 Small queue component for assigning return routes.
 

Macros

#define ADD_REMOVE_TIMEOUT   60000
 
#define NOP_FOR_REMOVE_FAILED_TIMEOUT   65000
 
#define SMART_START_SELF_DESTRUCT_TIMEOUT   3000
 
#define SET_DEFAULT_TIMEOUT   15000
 
#define LEARN_MODE_TIMEOUT   30000
 
#define SEND_DATA_TIMEOUT   125000
 
#define ADD_NODE_STATUS_ADDING_END_NODE_TIMEOUT   60000
 
#define ADD_NODE_PROTOCOL_NEIGHBOR_DISCOVERY_TIMEOUT    (76000 + ZW_MAX_NODES * (3517 + 732))
 
#define PRIORITY_ROUTE_SIZE   5
 4 hops + speed More...
 

Functions

zwave_network_management_state_t zwave_network_management_get_state ()
 Get the current state of the network management module. More...
 
sl_status_t zwave_network_management_abort ()
 Abort current state and return to idle if its possible. More...
 
sl_status_t zwave_network_management_add_node ()
 Put the Z-Wave controller in add node mode. More...
 
sl_status_t zwave_network_management_add_node_with_dsk (const zwave_dsk_t dsk, zwave_keyset_t granted_keys, zwave_protocol_t preferred_inclusion)
 Put the Z-Wave controller in SmartStart add node mode. More...
 
void zwave_network_management_enable_smart_start_add_mode (bool enabled)
 Set the controller in SmartStart Add mode. More...
 
void zwave_network_management_enable_smart_start_learn_mode (bool enabled)
 Configures if the Network Management module will enter SmartStart learn mode when it goes back to IDLE, we are alone in a network SmartStart Add mode is disabled. More...
 
sl_status_t zwave_network_management_keys_set (bool accept, bool csa, zwave_keyset_t granted_keys)
 Inform an S2 bootstrapping controller which keys must be granted to the node being bootstrapped. More...
 
sl_status_t zwave_network_management_dsk_set (zwave_dsk_t dsk)
 Indicate to the S2 bootstrapping controller whether the DSK is accepted and report the user input when needed. More...
 
sl_status_t zwave_network_management_remove_node ()
 Put the Z-Wave controller in remove node mode. More...
 
sl_status_t zwave_network_management_learn_mode (zwave_learn_mode_t mode)
 Put the Z-Wave controller in learn mode. More...
 
sl_status_t zwave_network_management_set_default (void)
 Reset the controller. More...
 
sl_status_t zwave_network_management_remove_failed (zwave_node_id_t nodeid)
 Remove a failed node. More...
 
zwave_home_id_t zwave_network_management_get_home_id ()
 Get the cached HomeID. More...
 
zwave_node_id_t zwave_network_management_get_node_id ()
 Get the cached NodeID. More...
 
uint16_t zwave_network_management_get_network_size ()
 Returns the number of nodes in our network. More...
 
void zwave_network_management_get_network_node_list (zwave_nodemask_t node_list)
 Get the cached Node List for the current network. More...
 
zwave_keyset_t zwave_network_management_get_granted_keys ()
 Return the currently granted keys. More...
 
bool zwave_network_management_is_zpc_sis ()
 Checks if we have the SIS role in the current network. More...
 
bool zwave_network_management_is_protocol_sending_frames_to_node (zwave_node_id_t node_id)
 Checks if the protocol may be sending some frames to a particular NodeID. More...
 
sl_status_t zwave_network_management_request_node_neighbor_discovery (zwave_node_id_t node_id)
 Request Node Neighbor Discovery. More...
 
sl_status_t zwave_network_management_start_proxy_inclusion (zwave_node_id_t node_id, zwave_node_info_t nif, uint8_t inclusion_step)
 Request the NM to perform proxy inclusion. More...
 
sl_status_t zwave_network_management_assign_return_route (zwave_node_id_t node_id, zwave_node_id_t destination_node_id)
 Assign static return routes to End Nodes. More...
 
bool zwave_network_management_is_busy ()
 Verify if we are carrying some network management operations. More...
 
bool we_have_return_routes_to_assign (zwave_node_id_t node_id)
 Checks if we have return routes to assign for a given NodeID. More...
 
sl_status_t zwave_network_management_set_priority_route (zwave_node_id_t node_id, const uint8_t *const priority_route)
 Assign a priority route to a node. More...
 

Detailed Description

Z-Wave network management component.

This component handles all logic related to changing the Z-Wave network, adding and removing nodes. It also handles destroying the network and joining the controller to an existing network. All Z-Wave secure inclusion steps are also handled from within this module. Secure inclusion initiated by an inclusion controller(proxy inclusion) is also passes through this component.

Macro Definition Documentation

◆ ADD_NODE_PROTOCOL_NEIGHBOR_DISCOVERY_TIMEOUT

#define ADD_NODE_PROTOCOL_NEIGHBOR_DISCOVERY_TIMEOUT    (76000 + ZW_MAX_NODES * (3517 + 732))

◆ ADD_NODE_STATUS_ADDING_END_NODE_TIMEOUT

#define ADD_NODE_STATUS_ADDING_END_NODE_TIMEOUT   60000

◆ ADD_REMOVE_TIMEOUT

#define ADD_REMOVE_TIMEOUT   60000

◆ LEARN_MODE_TIMEOUT

#define LEARN_MODE_TIMEOUT   30000

◆ NOP_FOR_REMOVE_FAILED_TIMEOUT

#define NOP_FOR_REMOVE_FAILED_TIMEOUT   65000

◆ PRIORITY_ROUTE_SIZE

#define PRIORITY_ROUTE_SIZE   5

4 hops + speed

◆ SEND_DATA_TIMEOUT

#define SEND_DATA_TIMEOUT   125000

Time that Send data (including e.g. sending NOP) will take as a maximum. Protocol that tries routing with FLiRS nodes takes very very long.

◆ SET_DEFAULT_TIMEOUT

#define SET_DEFAULT_TIMEOUT   15000

◆ SMART_START_SELF_DESTRUCT_TIMEOUT

#define SMART_START_SELF_DESTRUCT_TIMEOUT   3000

Function Documentation

◆ we_have_return_routes_to_assign()

bool we_have_return_routes_to_assign ( zwave_node_id_t  node_id)

Checks if we have return routes to assign for a given NodeID.

Parameters
node_idNodeID to look for in the return route queue
Returns
true or false
Here is the caller graph for this function:

◆ zwave_network_management_abort()

sl_status_t zwave_network_management_abort ( )

Abort current state and return to idle if its possible.

  • Abort the current network management operation and return to idle. Note that is not alway possible to abort the current operation.
Returns
sl_status_t FAILURE if it is not possible to go to idle now.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_network_management_add_node()

sl_status_t zwave_network_management_add_node ( )

Put the Z-Wave controller in add node mode.

When this function is activated Z-Wave controller will be open for adding nodes nodes who sends a node information frame or a NWI inclusion request.

Note that the controller will go back to idle state if no inclusion request has been received within a a RECOMMENDED timeout value of 60 seconds. Add Mode will timeout automatically after ADD_REMOVE_TIMEOUT seconds if no node gets included.

The following callbacks may be triggered asynchronous by this operation

  • on_state
  • on_error
  • on_add_node_started
  • on_node_added
Returns
sl_status_t FAILURE is state is not IDLE. No callbacks will be triggered
Here is the call graph for this function:

◆ zwave_network_management_add_node_with_dsk()

sl_status_t zwave_network_management_add_node_with_dsk ( const zwave_dsk_t  dsk,
zwave_keyset_t  granted_keys,
zwave_protocol_t  preferred_inclusion 
)

Put the Z-Wave controller in SmartStart add node mode.

This function should be called after receiving a SmartStart inclusion request to which we have a matching provision list entry.

The following callbacks may be triggered asynchronous by this operation:

  • on_state
  • on_error
  • on_add_node_started
  • on_node_added
Parameters
dskThe full DSK of the node to add
granted_keysThe S2 keys to grant to the new node.
preferred_inclusionThe preferred protocol to use for inclusion.
Returns
sl_status_t FAILURE is state is not IDLE
Here is the call graph for this function:

◆ zwave_network_management_assign_return_route()

sl_status_t zwave_network_management_assign_return_route ( zwave_node_id_t  node_id,
zwave_node_id_t  destination_node_id 
)

Assign static return routes to End Nodes.

Parameters
node_idNodeID for which return routes will be provided
destination_node_idDestination NodeID of the return routes
Returns
returns SL_STATUS_OK if the request was accepted.
Here is the call graph for this function:

◆ zwave_network_management_dsk_set()

sl_status_t zwave_network_management_dsk_set ( zwave_dsk_t  dsk)

Indicate to the S2 bootstrapping controller whether the DSK is accepted and report the user input when needed.

Parameters
dskThe full DSK of device to include.
Returns
sl_status_t false if the we not expecting waiting for this message

◆ zwave_network_management_enable_smart_start_add_mode()

void zwave_network_management_enable_smart_start_add_mode ( bool  enabled)

Set the controller in SmartStart Add mode.

When SmartStart is enabled the controller will open the Z-Wave controller for SmartStart inclusions. If an other network management operation is activated the SmartStart inclusion mode will be temporary suspended until the operation is done.

When a SmartStart inclusion request is received the SmartStart mode is automatically disabled. SmartStart mode must be re-enabled manually if a smart start inclusion is not stated as a response to a SmartStart inclusion request.

Parameters
enabled
  • TRUE the network will be kept open for SmartStart inclusions.
  • FALSE SmartStart inclusions are disabled.

◆ zwave_network_management_enable_smart_start_learn_mode()

void zwave_network_management_enable_smart_start_learn_mode ( bool  enabled)

Configures if the Network Management module will enter SmartStart learn mode when it goes back to IDLE, we are alone in a network SmartStart Add mode is disabled.

Parameters
enabled

◆ zwave_network_management_get_granted_keys()

zwave_keyset_t zwave_network_management_get_granted_keys ( )

Return the currently granted keys.

Returns
zwave_keyset_t indicating the granted keys for our Z-Wave module
Here is the call graph for this function:

◆ zwave_network_management_get_home_id()

zwave_home_id_t zwave_network_management_get_home_id ( )

Get the cached HomeID.

Returns
The current HomeID assigned to the Z-Wave Controller
Here is the caller graph for this function:

◆ zwave_network_management_get_network_node_list()

void zwave_network_management_get_network_node_list ( zwave_nodemask_t  node_list)

Get the cached Node List for the current network.

Parameters
[out]node_listPointer where the node list will be copied.

◆ zwave_network_management_get_network_size()

uint16_t zwave_network_management_get_network_size ( )

Returns the number of nodes in our network.

Returns
Number of nodes in our netowrk.

◆ zwave_network_management_get_node_id()

zwave_node_id_t zwave_network_management_get_node_id ( )

Get the cached NodeID.

Returns
The current NodeID assigned to the Z-Wave Controller
Here is the caller graph for this function:

◆ zwave_network_management_get_state()

zwave_network_management_state_t zwave_network_management_get_state ( )

Get the current state of the network management module.

Returns
zwave_network_management_state_t
Here is the caller graph for this function:

◆ zwave_network_management_is_busy()

bool zwave_network_management_is_busy ( )

Verify if we are carrying some network management operations.

Returns
true if we are busy doing something, false if IDLE.
Here is the caller graph for this function:

◆ zwave_network_management_is_protocol_sending_frames_to_node()

bool zwave_network_management_is_protocol_sending_frames_to_node ( zwave_node_id_t  node_id)

Checks if the protocol may be sending some frames to a particular NodeID.

Parameters
node_idThe Z-Wave NodeID that we want to check for.
Returns
true if the protocol is currently sending frames to the node, false if there is no operation that may trigger communications with the node.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_network_management_is_zpc_sis()

bool zwave_network_management_is_zpc_sis ( )

Checks if we have the SIS role in the current network.

Returns
true if we have the SIS role
false if we do not have the SIS role in this network
Here is the caller graph for this function:

◆ zwave_network_management_keys_set()

sl_status_t zwave_network_management_keys_set ( bool  accept,
bool  csa,
zwave_keyset_t  granted_keys 
)

Inform an S2 bootstrapping controller which keys must be granted to the node being bootstrapped.

Parameters
acceptThis field is used to indicate if the S2 bootstrapping process is accepted by the user and must continue
csaThis field is used to indicate if the S2 bootstrapping controller MUST allow CSA for Authentication.
granted_keysThis field is used to indicate which network keys were granted during bootstrapping.
Returns
sl_status_t false if the we not expecting wating for this message

◆ zwave_network_management_learn_mode()

sl_status_t zwave_network_management_learn_mode ( zwave_learn_mode_t  mode)

Put the Z-Wave controller in learn mode.

When this function is activated Z-Wave controller will be open for joining a new network to be removed from its current network to form a new blank network. If the controller enters a network where this is not already a SIS it assigns itself the SIS role.

Parameters
modeindicate the Learn Mode Intent (i.e., inclusion/exclusion, NWI, NWE and stop learn mode).
Returns
sl_status_t BUSY if the state is not IDLE
Here is the call graph for this function:

◆ zwave_network_management_remove_failed()

sl_status_t zwave_network_management_remove_failed ( zwave_node_id_t  nodeid)

Remove a failed node.

This function can be used for remove a failing node from Z-Wave network. NOP will be sent to the node to make sure that the Z-Wave protocol marks it failing on the controller and the subsequent remove failed call for that node will succeed.

The following callbacks may be triggered asynchronous by this operation

  • on_node_deleted
  • on_error
Parameters
nodeidNode id of failing node which will be removed
Returns
sl_status_t SL_STATUS_OK when remove failed is triggered, any other code if it failed
Here is the call graph for this function:

◆ zwave_network_management_remove_node()

sl_status_t zwave_network_management_remove_node ( )

Put the Z-Wave controller in remove node mode.

When this function is activated Z-Wave controller will be open for removing nodes nodes who sends a node information frame or a NWI exclusion request.

The following callbacks may be triggered asynchronous by this operation

  • on_state
  • on_error
  • on_node_removed
Returns
sl_status_t FAILURE is state is not IDLE
Here is the call graph for this function:

◆ zwave_network_management_request_node_neighbor_discovery()

sl_status_t zwave_network_management_request_node_neighbor_discovery ( zwave_node_id_t  node_id)

Request Node Neighbor Discovery.

Parameters
node_idthe NodeID of the node for which the neighbor discovery is requested
Returns
sl_status_t SL_STATUS_OK if the operation was accepted, any other code is case of failure
Here is the call graph for this function:

◆ zwave_network_management_set_default()

sl_status_t zwave_network_management_set_default ( void  )

Reset the controller.

The controller will reset its home id to a random value and assign itself node id 1. The controller will always assign itself the SIS role.

The following callbacks may be triggered asynchronous by this operation

  • on_state
  • on_new_network_entered
Returns
sl_status_t FAILURE is state is not IDLE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_network_management_set_priority_route()

sl_status_t zwave_network_management_set_priority_route ( zwave_node_id_t  node_id,
const uint8_t *const  priority_route 
)

Assign a priority route to a node.

This function will set a priority route to a given node. The priority route is a list with the NodeID of the hops that the Z-Wave controller will use as a preferred route to the node. The last byte is the route speed. See Z-Wave Host API Specification, section 4.4.3.14 for more information.

Parameters
node_idNodeID for which the priority route will be set
priority_routeArray of 4 NodeIDs for the priority route + 1 byte for the route speed.
Returns
sl_status_t SL_STATUS_OK if the operation was accepted, any other code in case of failure.
Here is the call graph for this function:

◆ zwave_network_management_start_proxy_inclusion()

sl_status_t zwave_network_management_start_proxy_inclusion ( zwave_node_id_t  node_id,
zwave_node_info_t  nif,
uint8_t  inclusion_step 
)

Request the NM to perform proxy inclusion.

Parameters
node_idthe NodeID of the node
nif
inclusion_step
Returns
sl_status_t SL_STATUS_OK if the operation was accepted, any other code is case of failure
Here is the call graph for this function: