|
Z-Wave Protocol Controller Reference
|
Functions in the Z-Wave basis API. More...
Classes | |
| struct | tx_power_level_t |
Macros | |
| #define | ZW_INT_MASK_EXT1 0x02 |
| #define | ZW_AV_VERSION_MAJOR 1 |
| #define | ZW_AV_VERSION_MINOR 0 |
Enumerations | |
| enum | serial_api_setup_cmd_t { SERIAL_API_SETUP_CMD_UNSUPPORTED = 0x00 , SERIAL_API_SETUP_CMD_SUPPORTED = 0x01 , SERIAL_API_SETUP_CMD_TX_STATUS_REPORT = 0x02 , SERIAL_API_SETUP_CMD_MAX_LR_TX_PWR_SET = 0x03 , SERIAL_API_SETUP_CMD_TX_POWERLEVEL_SET = 0x04 , SERIAL_API_SETUP_CMD_MAX_LR_TX_PWR_GET = 0x05 , SERIAL_API_SETUP_CMD_TX_POWERLEVEL_GET = 0x08 , SERIAL_API_SETUP_CMD_MAXIMUM_PAYLOAD_SIZE_GET = 0x10 , SERIAL_API_SETUP_CMD_LR_MAXIMUM_PAYLOAD_SIZE_GET = 0x11 , SERIAL_API_SETUP_CMD_RF_REGION_GET = 0x20 , SERIAL_API_SETUP_CMD_RF_REGION_SET = 0x40 , SERIAL_API_SETUP_CMD_NODEID_BASETYPE_SET = 0x80 } |
| Bitflag definitions for FUNC_ID_SERIAL_API_SETUP command. More... | |
| enum | rf_power_level_t { NORMAL_POWER = 0 , MINUS_1_DBM , MINUS_2_DBM , MINUS_3_DBM , MINUS_4_DBM , MINUS_5_DBM , MINUS_6_DBM , MINUS_7_DBM , MINUS_8_DBM , MINUS_9_DBM , MINIMUM_POWER = MINUS_9_DBM } |
Functions | |
| sl_status_t | zwapi_set_rf_receive_mode (uint8_t mode) |
| Initialize the Z-Wave RF chip. More... | |
| sl_status_t | zwapi_send_node_information (zwave_node_id_t destNode, uint8_t txOptions, void(*completedFunc)(uint8_t)) |
| Create and transmit a "Node Information" frame. More... | |
| uint8_t | zwapi_get_zw_library_version (uint8_t *dst) |
| Get the Z-Wave library basis version. More... | |
| uint8_t | zwapi_get_zw_library_type (void) |
| Get the Z-Wave library type. More... | |
| rf_power_level_t | zwapi_set_rf_power_level (rf_power_level_t powerLevel) |
| Set the power level to used in RF transmissions. More... | |
| rf_power_level_t | zwapi_get_rf_power_level (void) |
| Get the current power level used in RF transmitting. More... | |
| sl_status_t | zwapi_set_tx_status_reporting (bool enable) |
| Configure whether zwapi_send_data callbacks should contain tx_status report information. More... | |
| sl_status_t | zwapi_set_tx_power_level (tx_power_level_t zw_txpowerlevel) |
| Set the current TX power level. More... | |
| tx_power_level_t | zwapi_get_tx_power_level (void) |
| Get the current TX power level in effect. More... | |
| sl_status_t | zwapi_set_max_lr_tx_power_level (int16_t level) |
| Set the current MAX Long Range TX power level. More... | |
| int16_t | zwapi_get_max_lr_tx_power_level (void) |
| Get the current MAX Long Range TX power level in effect. More... | |
| sl_status_t | zwapi_set_rf_region (zwave_rf_region_t rfregion) |
| Set the current RF region. More... | |
| zwave_rf_region_t | zwapi_get_rf_region (void) |
| Get the current RF region. More... | |
| bool | zwapi_is_pti_supported () |
| Check if PTI supported. More... | |
| bool | zwapi_is_pti_enabled () |
| Get the current state of pti. More... | |
| sl_status_t | zwapi_set_radio_pti (bool state) |
| Enable/disable the PTI on Z-Wave Radio. More... | |
| sl_status_t | zwapi_get_maximum_payload_size (uint8_t *maximum_size) |
| Get the maximum payload size allowed for sending frames in Z-Wave. More... | |
| sl_status_t | zwapi_get_lr_maximum_payload_size (uint8_t *maximum_size) |
| Get the maximum payload size allowed for sending frames in Z-Wave Long Range. More... | |
| sl_status_t | zwapi_set_node_id_basetype (zwave_node_id_basetype_t basetype) |
| Set Z-Wave node ID basetype, either 8 bits or 16 bits used to store a node ID. More... | |
| zwave_node_id_basetype_t | zwapi_get_node_id_basetype () |
| Get the current node ID basetype setting. More... | |
| sl_status_t | zwapi_soft_reset (void) |
| Reset the Z-Wave module. More... | |
| sl_status_t | zwapi_send_test_frame (zwave_node_id_t node_id, rf_power_level_t power_level, void(*callback_function)(uint8_t tx_status)) |
| Send a test frame to specified NodeID. More... | |
| uint8_t | zwapi_get_zw_protocol_status (void) |
| Report the status of the Z-Wave protocol. More... | |
| sl_status_t | zwapi_enable_watchdog () |
| Enable the Watchdog. More... | |
| sl_status_t | zwapi_disable_watchdog () |
| Disable the Watchdog. More... | |
| sl_status_t | zwapi_start_watchdog () |
| Enable Watchdog and start kicking it in the Z-Wave chip. More... | |
| sl_status_t | zwapi_get_random_word (uint8_t *random_buffer, uint8_t number_of_random_bytes) |
| Generate an array of random bytes using the random number generator (RNG) on the Z-Wave module. More... | |
| sl_status_t | zwapi_get_random_byte (uint8_t *user_byte) |
| Generate a random byte using the random number generator (RNG) on the Z-Wave module. More... | |
| sl_status_t | zwapi_explore_request_inclusion () |
| Transmit a request for inclusion via an explore frame. More... | |
| sl_status_t | zwapi_explore_request_exclusion () |
| Transmit a request for exclusion via an explore frame. More... | |
| sl_status_t | zwapi_get_background_rssi (uint8_t *rssi_values, uint8_t *values_length) |
| Get the latest value of the background RSSI. More... | |
| sl_status_t | zwapi_set_application_node_information (uint8_t listening, node_type_t node_type, const uint8_t *nodeParm, uint8_t parmLength) |
| Set ApplicationNodeInformation data to be used in subsequent calls to zwapi_send_node_information(). More... | |
| sl_status_t | zwapi_get_long_range_nodes (uint16_t *number_of_bytes, zwave_nodemask_t lr_node_list) |
| Get Z-Wave Long Range node list in ZW_LR_NODEMASK_OFFSET offset of zwave_nodemask_t. More... | |
| sl_status_t | zwapi_get_full_node_list (zwave_nodemask_t node_list) |
| Get the entire list of nodes in our network (both Z-Wave and Z-Wave Long Range) More... | |
| sl_status_t | zwapi_get_long_range_channel (uint8_t *lr_channel) |
| Get the Z-Wave Long Range radio channel in use. More... | |
| sl_status_t | zwapi_set_long_range_channel (uint8_t lr_channel) |
| Set the Z-Wave Long Range radio channel in use. More... | |
| sl_status_t | zwapi_enable_auto_program_mode (void) |
| Enable Auto Programming mode. More... | |
| bool | zwapi_supports_long_range () |
| Return whether the Z-Wave module supports Long Range. More... | |
| bool | zwapi_supports_nls (void) |
| Return whether the Z-Wave module supports Network Layer Security. More... | |
zwapi_nodeid_basetype_t | |
These definitions represent possible node id basetype settings for the Z-Wave module They are used with zwapi_set_node_id_basetype() | |
| enum | zwave_node_id_basetype_t { NODEID_8BITS = 1 , NODEID_16BITS = 2 } |
zwapi_get_zw_protocol_status() return value masks | |
| #define | ZW_PROTOCOL_STATUS_ROUTING 0x01 |
| #define | ZW_PROTOCOL_STATUS_SUC 0x02 |
Z-Wave Library Chip type | |
| #define | ZW_500_SERIES_CHIP_TYPE 5 |
| #define | ZW_500_SERIES_CHIP_REVISION 0 |
Chip type definitions for 700-series | |
| #define | ZW_GECKO_CHIP_TYPE(x) ((x == 7) || (x == 8)) |
| #define | ZW_GECKO_CHIP_700 7 |
| #define | ZW_GECKO_CHIP_REVISION 0 |
Device option mask values | |
| #define | APPLICATION_NODEINFO_NOT_LISTENING 0x00 |
| #define | APPLICATION_NODEINFO_LISTENING 0x01 |
| #define | APPLICATION_NODEINFO_OPTIONAL_FUNCTIONALITY 0x02 |
| #define | APPLICATION_FREQ_LISTENING_MODE_1000ms 0x10 |
| #define | APPLICATION_FREQ_LISTENING_MODE_250ms 0x20 |
Functions in the Z-Wave basis API.
Interface functions in this module are implemented within all Z-Wave nodes.
| #define APPLICATION_FREQ_LISTENING_MODE_1000ms 0x10 |
| #define APPLICATION_FREQ_LISTENING_MODE_250ms 0x20 |
| #define APPLICATION_NODEINFO_LISTENING 0x01 |
| #define APPLICATION_NODEINFO_NOT_LISTENING 0x00 |
| #define APPLICATION_NODEINFO_OPTIONAL_FUNCTIONALITY 0x02 |
| #define ZW_500_SERIES_CHIP_REVISION 0 |
| #define ZW_500_SERIES_CHIP_TYPE 5 |
| #define ZW_AV_VERSION_MAJOR 1 |
| #define ZW_AV_VERSION_MINOR 0 |
| #define ZW_GECKO_CHIP_700 7 |
| #define ZW_GECKO_CHIP_REVISION 0 |
| #define ZW_GECKO_CHIP_TYPE | ( | x | ) | ((x == 7) || (x == 8)) |
| #define ZW_INT_MASK_EXT1 0x02 |
Bit mask used as parameters for the API ZW_SetSleepMode to indicate which interrupt to mask out
| #define ZW_PROTOCOL_STATUS_ROUTING 0x01 |
| #define ZW_PROTOCOL_STATUS_SUC 0x02 |
| enum rf_power_level_t |
RF power level values used with zwapi_set_rf_power_level() and zwapi_get_rf_power_level()
Bitflag definitions for FUNC_ID_SERIAL_API_SETUP command.
| sl_status_t zwapi_disable_watchdog | ( | ) |
Disable the Watchdog.
aka ZW_WatchDogDisable
| sl_status_t zwapi_enable_auto_program_mode | ( | void | ) |
Enable Auto Programming mode.
aka ZW_AutoProgrammingEnable
| sl_status_t zwapi_enable_watchdog | ( | ) |
Enable the Watchdog.
aka ZW_WatchDogEnable
| sl_status_t zwapi_explore_request_exclusion | ( | ) |
Transmit a request for exclusion via an explore frame.
This function sends out an explorer frame requesting exclusion from the network. If the exclusion request is accepted by a controller in network wide exclusion mode, the application on this node will get notified through the callback from the zwapi_set_learn_mode() function. Once a callback is received from zwapi_set_learn_mode() saying that the exclusion process has started, the application should not make further calls to this function.
Tx: {REQ | 0x5E}
Rx: {RES | 0x5E | retVal}
aka ZW_ExploreRequestExclusion
| sl_status_t zwapi_explore_request_inclusion | ( | ) |
Transmit a request for inclusion via an explore frame.
This function sends out an explorer frame requesting inclusion into a network. If the inclusion request is accepted by a controller in network wide inclusion mode, the application on this node will get notified through the callback from the zwapi_set_learn_mode() function. Once a callback is received from zwapi_set_learn_mode() saying that the inclusion process has started, the application should not make further calls to this function.
Tx: {REQ | 0x5E}
Rx: {RES | 0x5E | retVal}
aka ZW_ExploreRequestInclusion
| sl_status_t zwapi_get_background_rssi | ( | uint8_t * | rssi_values, |
| uint8_t * | values_length | ||
| ) |
Get the latest value of the background RSSI.
| rssi_values | pointer to array where RSSI values are stored. |
| values_length | length in bytes of the rssi_values array |
Tx: {(no arguments)}
Rx: {RES | RSSI Ch0 | RSSI Ch1 | RSSI Ch2 (3CH systems only)}
aka ZW_GetBackgroundRSSI
| sl_status_t zwapi_get_full_node_list | ( | zwave_nodemask_t | node_list | ) |
Get the entire list of nodes in our network (both Z-Wave and Z-Wave Long Range)
| node_list | array of type zwave_nodemask_t |
| sl_status_t zwapi_get_long_range_channel | ( | uint8_t * | lr_channel | ) |
Get the Z-Wave Long Range radio channel in use.
| lr_channel | The Z-Wave Long Range radio channel currecntly in use |
aka GetLongRangeChannel
| sl_status_t zwapi_get_long_range_nodes | ( | uint16_t * | number_of_bytes, |
| zwave_nodemask_t | lr_node_list | ||
| ) |
Get Z-Wave Long Range node list in ZW_LR_NODEMASK_OFFSET offset of zwave_nodemask_t.
This function copies Long Range node list bimask at ZW_LR_NODEMASK_OFFSET offest of zwave_nodemask_t
| number_of_bytes | Number of bytes in the returned node list |
| lr_node_list | array of type zwave_nodemask_t |
aka SerialAPI_GetLRNodeList
| sl_status_t zwapi_get_lr_maximum_payload_size | ( | uint8_t * | maximum_size | ) |
Get the maximum payload size allowed for sending frames in Z-Wave Long Range.
| maximum_size | The value to indicate maximum payload size |
| int16_t zwapi_get_max_lr_tx_power_level | ( | void | ) |
Get the current MAX Long Range TX power level in effect.
Tx: {REQ | 0x0B | 0x05}
Rx: {RES | 0x0B | 0x05 | Max Long Range TX Powerlevel MSB | Max Long Range TX Powerlevel LSB}
aka ZW_MAXLRTXPowerLevelGet
| sl_status_t zwapi_get_maximum_payload_size | ( | uint8_t * | maximum_size | ) |
Get the maximum payload size allowed for sending frames in Z-Wave.
| maximum_size | The value to indicate maximum payload size |
| zwave_node_id_basetype_t zwapi_get_node_id_basetype | ( | ) |
Get the current node ID basetype setting.
| sl_status_t zwapi_get_random_byte | ( | uint8_t * | user_byte | ) |
Generate a random byte using the random number generator (RNG) on the Z-Wave module.
| user_byte | pointer to uint8_t variable where the random number will be copied. Nothing is copied if SL_STATUS_FAIL is returned. |
Tx: {HOST->ZW: REQ | 0x1D} Tx: {ZW->HOST: RES | 0x1D | rndNo}
aka ZW_Random(ZW_GetRandomArray)
| sl_status_t zwapi_get_random_word | ( | uint8_t * | random_buffer, |
| uint8_t | number_of_random_bytes | ||
| ) |
Generate an array of random bytes using the random number generator (RNG) on the Z-Wave module.
| random_buffer | pointer to buffer, which should receive the random bytes. |
| number_of_random_bytes | Number of random bytes to get into random_buffer. Max number is 32. |
Tx: {REQ | 0x1C | noRandomBytes}
Rx: {RES | 0x1C | randomGenerationSuccess | noRandomBytesGenerated | randombytes[]}
aka ZW_GetRandomWord (ZW_GetRandomArray)
| rf_power_level_t zwapi_get_rf_power_level | ( | void | ) |
Get the current power level used in RF transmitting.
Tx: {REQ | 0xBA}
Rx: {RES | 0xBA | powerlevel}
aka ZW_RFPowerLevelGet
| zwave_rf_region_t zwapi_get_rf_region | ( | void | ) |
Get the current RF region.
Tx: {REQ | 0x0B | 0x20}
Rx: {RES | 0x0B | 0x20 | RFRegion}
aka ZW_RFRegionGet
| tx_power_level_t zwapi_get_tx_power_level | ( | void | ) |
Get the current TX power level in effect.
Tx: {REQ | 0x0B | 0x08}
Rx: {RES | 0x0B | 0x08 | NormalTxPower | Measured0dBmPower}
aka ZW_TXPowerLevelGet
| uint8_t zwapi_get_zw_library_type | ( | void | ) |
Get the Z-Wave library type.
aka ZW_Type_Library
| uint8_t zwapi_get_zw_library_version | ( | uint8_t * | dst | ) |
Get the Z-Wave library basis version.
| dst | pointer to buffer where version string will be copied to. The buffer must be at least 14 bytes long. If it is NULL, nothing will be copied. |
aka ZW_Version
| uint8_t zwapi_get_zw_protocol_status | ( | void | ) |
Report the status of the Z-Wave protocol.
The function returns a mask telling which protocol function is currently running
Tx: {REQ | 0xBF}
Rx: {RES | 0xBF | retVal}
aka ZW_GetProtocolStatus
| bool zwapi_is_pti_enabled | ( | ) |
Get the current state of pti.
| bool zwapi_is_pti_supported | ( | ) |
Check if PTI supported.
| sl_status_t zwapi_send_node_information | ( | zwave_node_id_t | destNode, |
| uint8_t | txOptions, | ||
| void(*)(uint8_t) | completedFunc | ||
| ) |
Create and transmit a "Node Information" frame.
| destNode | is the destination Node ID (ZWAVE_BROADCAST_NODE_ID == all nodes) |
| txOptions | is transmit option flags. (see zwapi_send_data()) |
| completedFunc | is the transmit completed callback function. For information about the txStatus parameter see zwapi_send_data(). |
The Z Wave transport layer builds a frame, requests application node information (see ApplicationNodeInformation), and queues the "Node Information" frame for transmission. The completed call back function (completedFunc) is called when the transmission is complete.
The Node Information Frame is a protocol frame and will therefore not be directly available to the application on the receiver. The API call zwapi_set_learn_mode() can be used to instruct the protocol to pass the Node Information Frame to the application.
When zwapi_send_node_information() is used in learn mode for adding or removing the node from the network the transmit option TRANSMIT_OPTION_LOW_POWER should NOT be used.
Timeout: 65 s Exception recovery: Resume normal operation, no recovery needed
Tx: {REQ | 0x12 | destNode | txOptions | funcID}
Rx: {RES | 0x12 | retVal}
Rx: {REQ | 0x12 | funcID | txStatus}
aka ZW_SendNodeInformation
| sl_status_t zwapi_send_test_frame | ( | zwave_node_id_t | node_id, |
| rf_power_level_t | power_level, | ||
| void(*)(uint8_t tx_status) | callback_function | ||
| ) |
Send a test frame to specified NodeID.
| node_id | the NodeID destination the test frame will be transmitted to. |
| power_level | the power level to use for the RF transmission. |
| callback_function | is the callback function that will be called when the operation of this function is done. For information about the tx_status parameter, refer to zwapi_send_data |
Send a test frame directly to nodeID without any routing, RF transmission power is previously set to power level by calling zwapi_set_rf_power_level(). The test frame is acknowledged at the RF transmission power level indicated by the parameter power level by nodeID (if the test frame got through).This test will be done using 9600 kbit/s transmission rate.
Timeout: 200 ms Exception recovery: Resume normal operation, no recovery needed
aka ZW_SendTestFrame
| sl_status_t zwapi_set_application_node_information | ( | uint8_t | listening, |
| node_type_t | node_type, | ||
| const uint8_t * | nodeParm, | ||
| uint8_t | parmLength | ||
| ) |
Set ApplicationNodeInformation data to be used in subsequent calls to zwapi_send_node_information().
| listening | Set to APPLICATION_NODEINFO_LISTENING if this is a listening node, otherwise set to APPLICATION_NODEINFO_NOT_LISTENING. |
| node_type | the Z-Wave Device type (the .basic member is not used here) |
| nodeParm | the Device parameter buffer |
| parmLength | the number of Device parameter bytes |
aka SerialAPI_ApplicationNodeInformation
| sl_status_t zwapi_set_long_range_channel | ( | uint8_t | lr_channel | ) |
Set the Z-Wave Long Range radio channel in use.
| lr_channel | The value intended to set for current Z-Wave Long Range radio channel |
aka SetLongRangeChannel
| sl_status_t zwapi_set_max_lr_tx_power_level | ( | int16_t | level | ) |
Set the current MAX Long Range TX power level.
| level | TX power level settings The power level is in deci dBm. E.g. 1dBm output power will be 10 in and -2dBm will be -20 |
Tx: {REQ | 0x0B | 0x03 | Max Long Range TX Powerlevel MSB | Max Long Range TX Powerlevel LSB}
Rx: {RES | 0x0B | 0x03 | CmdRes}
aka ZW_MAXLRTXPowerLevelSet
| sl_status_t zwapi_set_node_id_basetype | ( | zwave_node_id_basetype_t | basetype | ) |
Set Z-Wave node ID basetype, either 8 bits or 16 bits used to store a node ID.
| basetype | zwave_node_id_basetype_t the basetype to be set, NODEID_8BITS or NODEID_16BITS |
aka SerialAPI_GetLRNodeList
| sl_status_t zwapi_set_radio_pti | ( | bool | state | ) |
Enable/disable the PTI on Z-Wave Radio.
zwapi_soft_reset() MUST be called after call to this function.
zwapi_is_pti_enabled() can be called to verify if the PTI is enabled
| state | True to enable, False to disable |
| rf_power_level_t zwapi_set_rf_power_level | ( | rf_power_level_t | powerLevel | ) |
Set the power level to used in RF transmissions.
| powerLevel | the power level to use in RF transmission. |
The RF power is dependent on the settings for transmit power level in App_RFSetup.a51. If this value is changed from using the default library value, the resulting power levels might differ from the intended values. The returned value is however always the one used.
Tx: {REQ | 0x17 | powerLevel}
Rx: {RES | 0x17 | retVal}
aka ZW_RFPowerLevelSet
| sl_status_t zwapi_set_rf_receive_mode | ( | uint8_t | mode | ) |
Initialize the Z-Wave RF chip.
| mode | is the Z-Wave Radio receiver mode = true : Set the RF chip in receive mode and starts the data sampling. = false : Set the RF chip in power down mode. |
aka ZW_SetRFReceiveMode
| sl_status_t zwapi_set_rf_region | ( | zwave_rf_region_t | rfregion | ) |
Set the current RF region.
| rfregion | the RF region |
Tx: {REQ | 0x0B | 0x40 | RFRegion}
Rx: {RES | 0x0B | 0x40 | CmdRes}
aka ZW_RFRegionSet
| sl_status_t zwapi_set_tx_power_level | ( | tx_power_level_t | zw_txpowerlevel | ) |
Set the current TX power level.
| zw_txpowerlevel | TX power level settings struct with the following members:
|
Tx: {REQ | 0x0B | 0x04 | NormalTxPower | Measured0dBmPower}
Rx: {RES | 0x0B | 0x04 | CmdRes}
aka ZW_TXPowerLevelSet
| sl_status_t zwapi_set_tx_status_reporting | ( | bool | enable | ) |
Configure whether zwapi_send_data callbacks should contain tx_status report information.
| enable | true will enabled tx_status reporting, false will disable it. |
| sl_status_t zwapi_soft_reset | ( | void | ) |
Reset the Z-Wave module.
Tx: {REQ | 0x08}
aka ZW_SoftReset
| sl_status_t zwapi_start_watchdog | ( | ) |
Enable Watchdog and start kicking it in the Z-Wave chip.
Tx: {REQ | 0xD2}
aka SerialAPI_WatchdogStart
| bool zwapi_supports_long_range | ( | ) |
Return whether the Z-Wave module supports Long Range.
aka SerialAPI_SupportsLR
| bool zwapi_supports_nls | ( | void | ) |
Return whether the Z-Wave module supports Network Layer Security.