Z-Wave Protocol Controller Reference
zwave_network_management.h
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 *
5 *
6 * The licensor of this software is Silicon Laboratories Inc. Your use of this
7 * software is governed by the terms of Silicon Labs Master Software License
8 * Agreement (MSLA) available at
9 * www.silabs.com/about-us/legal/master-software-license-agreement. This
10 * software is distributed to you in Source Code format and is governed by the
11 * sections of the MSLA applicable to Source Code.
12 *
13 */
14
30#ifndef ZWAVE_NETWORK_MANAGEMENT_H
31#define ZWAVE_NETWORK_MANAGEMENT_H
32
33// Generic includes
34#include <stdint.h>
35#include <stdbool.h>
36
38#include "zwave_generic_types.h"
40
43// Interfaces
44#include "zwave_generic_types.h"
45
46// Unify includes
47#include "sl_status.h"
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
59
68
90
110 const zwave_dsk_t dsk,
111 zwave_keyset_t granted_keys,
112 zwave_protocol_t preferred_inclusion);
113
133
142
160 bool csa,
161 zwave_keyset_t granted_keys);
162
171
186
200
215
235
242
249
256
263
270
278
288
298
309 zwave_node_id_t node_id, zwave_node_info_t nif, uint8_t inclusion_step);
310
320 zwave_node_id_t node_id, zwave_node_id_t destination_node_id);
321
328
335
352 zwave_node_id_t node_id, const uint8_t *const priority_route);
353
354/* An application MUST time out waiting for the
355 * ADD_NODE_STATUS_NODE_FOUND status if it does not receive the indication
356 * after calling AddNodeToNetwork(ADD_NODE_ANY).
357 * Value: 60 seconds (60000 ms) Refer: Z-wave Appl. Programmers Guide */
358#define ADD_REMOVE_TIMEOUT 60000
359#define NOP_FOR_REMOVE_FAILED_TIMEOUT 65000
360#define SMART_START_SELF_DESTRUCT_TIMEOUT 3000 //3 seconds
361
362// How long do we wait for the Z-Wave API to callback after set default?
363#define SET_DEFAULT_TIMEOUT 15000
364
365// How long do we stay in Learn Mode before timing out and returning to IDLE in ms.
366#define LEARN_MODE_TIMEOUT 30000
367
370#define SEND_DATA_TIMEOUT 125000
371
372/* An application MUST time out waiting for the ADD_NODE_STATUS_ADDING_END_NODE
373 * status if it does not receive the indication within a time period after
374 * receiving the ADD_NODE_STATUS_NODE_FOUND status.
375 * The RECOMMENDED timeout interval is 60 sec. */
376#define ADD_NODE_STATUS_ADDING_END_NODE_TIMEOUT 60000
377
378/*
379 * INS13954 indicates that the timeout should be as follows:
380 * 1. for including an End Node:
381 * timeout = 76000 ms + listening nodes * 217 ms + FLiRS Nodes * 3517 ms
382 * 2. for including a Controller Node:
383 * timeout = 76000 ms + listening nodes * 217 ms + FLiRS Nodes * 3517 ms + network nodes * 732 ms
384 *
385 * This is the worst case scenario time out, we do not bother calculating the right timeout
386 */
387#define ADD_NODE_PROTOCOL_NEIGHBOR_DISCOVERY_TIMEOUT \
388 (76000 + ZW_MAX_NODES * (3517 + 732))
389
391#define PRIORITY_ROUTE_SIZE 5
392
393#ifdef __cplusplus
394}
395#endif
396
399#endif //ZWAVE_NETWORK_MANAGEMENT_H
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
bool zwave_network_management_is_zpc_sis()
Checks if we have the SIS role in the current network.
Definition: zwave_network_management.c:227
uint16_t zwave_network_management_get_network_size()
Returns the number of nodes in our network.
Definition: zwave_network_management.c:316
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 whe...
Definition: zwave_network_management.c:194
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.
Definition: zwave_network_management.c:238
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 IDL...
Definition: zwave_network_management.c:46
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.
Definition: zwave_network_management.c:173
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.
Definition: zwave_network_management.c:338
bool zwave_network_management_is_busy()
Verify if we are carrying some network management operations.
Definition: zwave_network_management.c:298
sl_status_t zwave_network_management_abort()
Abort current state and return to idle if its possible.
Definition: zwave_network_management.c:143
sl_status_t zwave_network_management_request_node_neighbor_discovery(zwave_node_id_t node_id)
Request Node Neighbor Discovery.
Definition: zwave_network_management.c:246
sl_status_t zwave_network_management_set_default(void)
Reset the controller.
Definition: zwave_network_management.c:79
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.
Definition: zwave_network_management.c:58
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.
Definition: zwave_network_management_return_route_queue.c:47
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.
Definition: zwave_network_management.c:263
sl_status_t zwave_network_management_learn_mode(zwave_learn_mode_t mode)
Put the Z-Wave controller in learn mode.
Definition: zwave_network_management.c:206
sl_status_t zwave_network_management_remove_node()
Put the Z-Wave controller in remove node mode.
Definition: zwave_network_management.c:116
zwave_network_management_state_t zwave_network_management_get_state()
Get the current state of the network management module.
Definition: zwave_network_management.c:53
sl_status_t zwave_network_management_add_node()
Put the Z-Wave controller in add node mode.
Definition: zwave_network_management.c:159
zwave_home_id_t zwave_network_management_get_home_id()
Get the cached HomeID.
Definition: zwave_network_management.c:306
void zwave_network_management_enable_smart_start_add_mode(bool enabled)
Set the controller in SmartStart Add mode.
Definition: zwave_network_management.c:39
sl_status_t zwave_network_management_remove_failed(zwave_node_id_t nodeid)
Remove a failed node.
Definition: zwave_network_management.c:99
zwave_node_id_t zwave_network_management_get_node_id()
Get the cached NodeID.
Definition: zwave_network_management.c:311
zwave_keyset_t zwave_network_management_get_granted_keys()
Return the currently granted keys.
Definition: zwave_network_management.c:333
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.
Definition: zwave_network_management.c:282
void zwave_network_management_get_network_node_list(zwave_nodemask_t node_list)
Get the cached Node List for the current network.
Definition: zwave_network_management.c:328
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
SL Status Codes.
Structure holding a Z-Wave node info frame.
Definition: zwave_controller_types.h:50
const zwave_node_id_t node_id