Z-Wave Protocol Controller Reference
Z-Wave Controller Utils

Various utilities for the Z-Wave Controller. More...

Collaboration diagram for Z-Wave Controller Utils:

Modules

 CRC-16 Calculation Utility
 CRC16 calculation function.
 
 Z-Wave Controller endian functions
 These macros have the same functionality as the well know ntohl and ntohs function from libc.
 

Macros

#define ZWAVE_CMD_CLASS_PROTOCOL   0x01 /* Z-Wave protocol class command */
 
#define ZWAVE_CMD_CLASS_PROTOCOL_LR   0x04 /* Z-Wave Long Range protocol class command */
 

Functions

sl_status_t zwave_send_nop_to_node (zwave_node_id_t node_id, uint32_t qos_priority, uint32_t discard_timeout_ms, const on_zwave_tx_send_data_complete_t on_send_complete, void *user)
 Send a Z-Wave NOP frame to Z-Wave NodeID. More...
 
void zwave_sl_log_frame_data (const zwave_controller_connection_info_t *connection_info, const zwave_rx_receive_options_t *rx_options, const uint8_t *frame_data, uint16_t frame_length)
 Log the Z-Wave received frame data using the sl_log system. More...
 
void zwave_sl_log_nif_data (zwave_node_id_t node_id, const zwave_node_info_t *node_info)
 Log the Z-Wave received NIF using the sl_log system. More...
 
void zwave_sl_log_dsk (const char *tag, const zwave_dsk_t dsk)
 Prints a DSK to the log, using the log. More...
 
void zwave_command_class_list_unpack (zwave_node_info_t *node_info, const uint8_t *nif, uint8_t nif_length)
 Unpack the given NIF and parse it into command class list in zwave_node_info and fill the length of resulted command class list. More...
 
void zwave_command_class_list_pack (const zwave_node_info_t *node_info, uint8_t *nif, uint8_t *nif_length)
 Pack the given NIF into a uint8_t array. More...
 
bool is_command_class_in_supported_list (zwave_command_class_t command_class, const uint8_t *nif, uint8_t nif_length)
 Verifies if a CC is in a raw array of Command Classes. More...
 
sl_status_t zwave_parse_nif (const uint8_t *nif, size_t nif_length, zwave_command_class_t *supported_command_classes, size_t *supported_command_classes_length, zwave_command_class_t *controlled_command_classes, size_t *controlled_command_classes_length)
 Parses a NIF byte array and converts it into a lists of supported/controlled Command Classes. More...
 
const char * zwave_network_scheme_str (zwave_controller_encapsulation_scheme_t scheme)
 Return a string representation of the Network Scheme. More...
 
zwave_controller_encapsulation_scheme_t zpc_highest_security_class ()
 Get the highest Security Class of the ZPC for the current network. More...
 

Detailed Description

Various utilities for the Z-Wave Controller.

Macro Definition Documentation

◆ ZWAVE_CMD_CLASS_PROTOCOL

#define ZWAVE_CMD_CLASS_PROTOCOL   0x01 /* Z-Wave protocol class command */

◆ ZWAVE_CMD_CLASS_PROTOCOL_LR

#define ZWAVE_CMD_CLASS_PROTOCOL_LR   0x04 /* Z-Wave Long Range protocol class command */

Function Documentation

◆ is_command_class_in_supported_list()

bool is_command_class_in_supported_list ( zwave_command_class_t  command_class,
const uint8_t *  nif,
uint8_t  nif_length 
)

Verifies if a CC is in a raw array of Command Classes.

Parameters
command_classThe Command Class to search for
nifA pointer to a byte array where to look for the CC
nif_lengthThe length of the data contained in the NIF array.
Returns
true if the Command Class is found, false otherwise.
Here is the caller graph for this function:

◆ zpc_highest_security_class()

zwave_controller_encapsulation_scheme_t zpc_highest_security_class ( )

Get the highest Security Class of the ZPC for the current network.

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

◆ zwave_command_class_list_pack()

void zwave_command_class_list_pack ( const zwave_node_info_t node_info,
uint8_t *  nif,
uint8_t *  nif_length 
)

Pack the given NIF into a uint8_t array.

Parameters
node_infoA pointer to a struct to convert to a byte array.
nifA pointer to a byte array where the node_info data will be written
nif_lengthA pointer where the length of the written data in the NIF buffer will be indicated
Here is the caller graph for this function:

◆ zwave_command_class_list_unpack()

void zwave_command_class_list_unpack ( zwave_node_info_t node_info,
const uint8_t *  nif,
uint8_t  nif_length 
)

Unpack the given NIF and parse it into command class list in zwave_node_info and fill the length of resulted command class list.

Parameters
[out]node_infoStruct where the parsed result is stored into
nifNIF as a byte array
nif_lengthLength of incoming NIF
Here is the caller graph for this function:

◆ zwave_network_scheme_str()

const char * zwave_network_scheme_str ( zwave_controller_encapsulation_scheme_t  scheme)

Return a string representation of the Network Scheme.

Parameters
scheme
Returns
const char*

◆ zwave_parse_nif()

sl_status_t zwave_parse_nif ( const uint8_t *  nif,
size_t  nif_length,
zwave_command_class_t supported_command_classes,
size_t *  supported_command_classes_length,
zwave_command_class_t controlled_command_classes,
size_t *  controlled_command_classes_length 
)

Parses a NIF byte array and converts it into a lists of supported/controlled Command Classes.

The passed arrays (supported_command_classes and controlled_command_classes) MUST be able to contain ZWAVE_MAX_NIF_SIZE elements.

Parameters
nifThe byte array containing Command Classes as received from the Z-Wave Protocol
nif_lengthThe number of bytes to parse from the NIF array.
supported_command_classesThe array where to write supported command classes found in the NIF array.
supported_command_classes_lengthA pointer where to write the number of elements that were written to the supported_command_classes array
controlled_command_classesThe array where to write controlled command classes found in the NIF array.
controlled_command_classes_lengthA pointer where to write the number of elements that were written to the controlled_command_classes array
Returns
SL_STATUS_OK if the parsing went well and the data copied in
SL_STATUS_FAIL if an error occurred.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_send_nop_to_node()

sl_status_t zwave_send_nop_to_node ( zwave_node_id_t  node_id,
uint32_t  qos_priority,
uint32_t  discard_timeout_ms,
const on_zwave_tx_send_data_complete_t  on_send_complete,
void *  user 
)

Send a Z-Wave NOP frame to Z-Wave NodeID.

Parameters
node_idDestination NodeID
qos_priorityQoS Priority of the NOP frame
discard_timeout_msDiscard timeout for the NOP frame
on_send_completeZ-Wave Tx on send complete callback
userUser data pointer
Returns
status code returned by zwave_tx_send_data
Here is the call graph for this function:

◆ zwave_sl_log_dsk()

void zwave_sl_log_dsk ( const char *  tag,
const zwave_dsk_t  dsk 
)

Prints a DSK to the log, using the log.

Parameters
tagLOG_TAG to use for sl_log_debug()
dskTo print out
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zwave_sl_log_frame_data()

void zwave_sl_log_frame_data ( const zwave_controller_connection_info_t connection_info,
const zwave_rx_receive_options_t rx_options,
const uint8_t *  frame_data,
uint16_t  frame_length 
)

Log the Z-Wave received frame data using the sl_log system.

This function takes the arguments from zwave_rx_callbacks_t on_frame_received callback from the Z-Wave RX and uses the sl_log to pretty print the data.

Parameters
connection_infoRefer to zwave_controller_connection_info_t
rx_optionsRefer to zwave_rx_receive_options_t
frame_dataPointer to de-encapsulated data
frame_lengthLength of data contained in the frame_data pointer.

◆ zwave_sl_log_nif_data()

void zwave_sl_log_nif_data ( zwave_node_id_t  node_id,
const zwave_node_info_t node_info 
)

Log the Z-Wave received NIF using the sl_log system.

This function takes the arguments from zwave_rx_callbacks_t on_node_information callback from the Z-Wave RX and uses the sl_log to pretty print the data.

Parameters
node_idNodeID of the node to which the NIF belongs
node_infoPointer to a zwave_node_info_t structure
Here is the caller graph for this function: