|
Z-Wave Protocol Controller Reference
|
API to connect and send frames to the Z-Wave module using the serial port. More...
#include "zwapi_internal.h"Go to the source code of this file.
Macros | |
| #define | RX_ACK_TIMEOUT_DEFAULT 1500 |
| #define | RX_BYTE_TIMEOUT_DEFAULT 1500 |
Enumerations | |
| enum | zwapi_connection_status_t { ZWAPI_CONNECTION_STATUS_IDLE , ZWAPI_CONNECTION_STATUS_FRAME_RECEIVED , ZWAPI_CONNECTION_STATUS_FRAME_SENT , ZWAPI_CONNECTION_STATUS_CHECKSUM_ERROR , ZWAPI_CONNECTION_STATUS_RX_TIMEOUT , ZWAPI_CONNECTION_STATUS_TX_TIMEOUT , ZWAPI_CONNECTION_STATUS_TX_NAK , ZWAPI_CONNECTION_STATUS_TX_CAN } |
| State of the connection to the Z-Wave module. More... | |
Functions | |
| int | zwapi_connection_init (const char *serial_port) |
| Initialize the zwapi_connection to the Z-Wave module. More... | |
| void | zwapi_connection_shutdown () |
| Close the zwapi_connection to the Z-Wave module. More... | |
| int | zwapi_connection_restart () |
| Closes and re-initializes the zwapi_connection to the Z-Wave module. More... | |
| void | zwapi_connection_tx (uint8_t cmd, uint8_t type, const uint8_t *Buf, uint8_t len, bool ack_needed) |
| Transmit a frame via serial port by adding SOF, Len, Type, cmd and Checksum. More... | |
| zwapi_connection_status_t | zwapi_connection_refresh () |
| Parses serial data sent from the Z-Wave module to the serial port. Should be frequently called by main loop. More... | |
| int | zwapi_connection_get_last_rx_frame (uint8_t *user_buffer, int user_buffer_length) |
| Provides the data of the serial buffer for the last received frame. More... | |
| const char * | zwapi_connection_status_to_string (zwapi_connection_status_t t) |
| make the zwapi_connection_status types human readable. More... | |
API to connect and send frames to the Z-Wave module using the serial port.
| #define RX_ACK_TIMEOUT_DEFAULT 1500 |
| #define RX_BYTE_TIMEOUT_DEFAULT 1500 |
State of the connection to the Z-Wave module.
| int zwapi_connection_get_last_rx_frame | ( | uint8_t * | user_buffer, |
| int | user_buffer_length | ||
| ) |
Provides the data of the serial buffer for the last received frame.
| user_buffer | a pointer to the user buffer in which the frame is to be copied |
| user_buffer_length | The length of the user buffer |
| int zwapi_connection_init | ( | const char * | serial_port | ) |
Initialize the zwapi_connection to the Z-Wave module.
| serial_port | String representing the serial device path |
aka ConInit
| zwapi_connection_status_t zwapi_connection_refresh | ( | ) |
Parses serial data sent from the Z-Wave module to the serial port. Should be frequently called by main loop.
aka ConUpdate
| int zwapi_connection_restart | ( | ) |
Closes and re-initializes the zwapi_connection to the Z-Wave module.
| void zwapi_connection_shutdown | ( | ) |
Close the zwapi_connection to the Z-Wave module.
aka ConDestroy
| const char * zwapi_connection_status_to_string | ( | zwapi_connection_status_t | t | ) |
make the zwapi_connection_status types human readable.
aka ConTypeToStr
| void zwapi_connection_tx | ( | uint8_t | cmd, |
| uint8_t | type, | ||
| const uint8_t * | Buf, | ||
| uint8_t | len, | ||
| bool | ack_needed | ||
| ) |
Transmit a frame via serial port by adding SOF, Len, Type, cmd and Checksum.
| cmd | The command to be executed by the Z-Wave module, using FUNC_ID defines |
| type | The type of frame, either Request 0x00 or Response 0x01 |
| Buf | A pointer to the command payload buffer |
| len | The length of the data contained in the payload buffer |
| ack_needed | true if we expect an Ack back for this frame. |
A frame on the serial line consist of: SOF-Len-Type-Cmd-DATA-Chksum, where:
aka ConTxFrame