ZWaveSerialProber detects whether the device connected to a serial port is a Z-Wave controller. We try to obtain its version (and report it). If the version cannot be obtained an exception is thrown.
More...
#include <ZWaveSerialProber.h>
|
| ZWaveSerialProber (SerialPort &port) |
|
void | probe (const Poco::Timespan &timeout) |
| Probe the configured serial port and try to find a Z-Wave controller on the other side. We send NACK and then the version request. More...
|
|
|
static void | setupPort (SerialPort &port) |
| Configure the given serial port to settings typical for Z-Wave controllers.
|
|
|
std::string | buildMessage (const std::vector< uint8_t > payload) const |
| Build a message from the given payload. The header with SOF and size are prepended and the checksum is computed and appended.
|
|
void | checkTimeout (const Poco::Timespan &timeout) const |
| Check whether the given timeout is positive. Otherwise, we treate it as expired. More...
|
|
void | writeAll (const std::string &s, const Poco::Timespan &timeout) |
|
std::string | read (size_t max, const Poco::Timespan &timeout) |
|
void | writeAck (const Poco::Timespan &timeout) |
|
void | readAck (const Poco::Timespan &timeout) |
|
size_t | decodeHeader (const std::string &message) const |
|
void | writeRequest (const char id, const Poco::Timespan &timeout) |
|
std::string | readResponse (const Poco::Timespan &timeout) |
|
void | nack (const Poco::Timespan &timeout) |
|
std::string | version (const Poco::Timespan &timeout) |
|
ZWaveSerialProber detects whether the device connected to a serial port is a Z-Wave controller. We try to obtain its version (and report it). If the version cannot be obtained an exception is thrown.
void ZWaveSerialProber::checkTimeout |
( |
const Poco::Timespan & |
timeout | ) |
const |
|
protected |
Check whether the given timeout is positive. Otherwise, we treate it as expired.
- Exceptions
-
void ZWaveSerialProber::probe |
( |
const Poco::Timespan & |
timeout | ) |
|
Probe the configured serial port and try to find a Z-Wave controller on the other side. We send NACK and then the version request.
The whole probing process must fit into the given timeout. to prevent infinite waiting. The timeout must be a positive value.
- Exceptions
-
Poco::InvalidArgumentException | - when timeout is invalid |
Poco::TimeoutException | - when timeout exceeds while probing |
Poco::ProtocolException | - when the remote device gives unexpected results |
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/zwave/ZWaveSerialProber.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/zwave/ZWaveSerialProber.cpp