BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
The class represents Thermona Regulator VPT LAN v1.0. It provides functions to control the VPT and to gather data from its sensors. Each VPT regulator consists of up to 4 zones and 1 boiler. This means one instance of VPTDevice takes care of 5 devices. Each subdevice has own DeviceID. More...
#include <VPTDevice.h>
Public Types | |
enum | Action { PAIR = 0x01, READ, SET } |
typedef Poco::SharedPtr < VPTDevice > | Ptr |
Public Types inherited from BeeeOn::PollableDevice | |
typedef Poco::SharedPtr < PollableDevice > | Ptr |
Public Member Functions | |
VPTDevice (const Poco::Net::SocketAddress &address, const Poco::Timespan &httpTimeout, const Poco::Timespan &pingTimeout, const GatewayID &id, const RefreshTime &refresh, const DeviceCache::Ptr deviceCache) | |
Connects to specified address to fetch information for creating VPT Device. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. More... | |
DeviceID | id () const override |
RefreshTime | refresh () const override |
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain a valid time. | |
DeviceID | boilerID () const |
Poco::Net::SocketAddress | address () const |
void | setAddress (const Poco::Net::SocketAddress &address) |
void | setPassword (const std::string &pwd) |
Poco::FastMutex & | lock () |
void | poll (Distributor::Ptr distributor) override |
Perform polling for data and ship them via the given distributor. | |
std::string | generateStamp (const Action action) |
Creates a stamp that consists of gateway id, IP address of gateway's interface from whitch the VPT is available, time, and action. | |
void | stampVPT (const Action action) |
Sends stamp with aciton to the VPT. It serves to verify that the gateway communicates with the VPT. | |
void | requestModifyState (const DeviceID &id, const ModuleID module, const double value) |
std::vector< SensorData > | requestValues () |
Gathers data from all sensors of subdevices. More... | |
std::vector< DeviceDescription > | descriptions (const RefreshTime &refresh) const |
Returns list of new device commands of all subdevices. | |
bool | operator== (const VPTDevice &other) const |
Compares two VPTs based on DeviceID. | |
Static Public Member Functions | |
static DeviceID | createSubdeviceID (const int zone, const DeviceID &id) |
Creates DeviceID from VPT DeviceID and number of zone. | |
static DeviceID | omitSubdeviceFromDeviceID (const DeviceID &id) |
Returns DeviceID of real VPT. | |
static int | extractSubdeviceFromDeviceID (const DeviceID &id) |
Extracts subdevice number from DeviceID. | |
static std::string | extractNonce (const std::string &response) |
static std::string | generateHashPassword (const std::string &pwd, const std::string &response) |
Static Public Attributes | |
static const std::vector < std::string > | REG_BOILER_OPER_TYPE |
static const std::vector < std::string > | REG_BOILER_OPER_MODE |
static const std::vector < std::string > | REG_MAN_ROOM_TEMP |
static const std::vector < std::string > | REG_MAN_WATER_TEMP |
static const std::vector < std::string > | REG_MAN_TUV_TEMP |
static const std::vector < std::string > | REG_MOD_WATER_TEMP |
static const std::list < ModuleType > | ZONE_MODULE_TYPES |
static const std::list < ModuleType > | BOILER_MODULE_TYPES |
static const int | COUNT_OF_ZONES = 4 |
Additional Inherited Members | |
Protected Member Functions inherited from BeeeOn::Loggable | |
void | setupLogger (Poco::Logger *logger=0) const |
Poco::Logger & | logger () const |
Loggable (const ClassInfo &info) | |
Loggable (const std::type_info &info) | |
Static Protected Member Functions inherited from BeeeOn::Loggable | |
static Poco::Logger & | forMethod (const char *name) |
static Poco::Logger & | forClass (const ClassInfo &info) |
static Poco::Logger & | forClass (const std::type_info &info) |
template<typename T > | |
static Poco::Logger & | forInstance (const T *i) |
static void | configureSimple (Poco::Logger &logger, const std::string &level) |
static void | logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line) |
The class represents Thermona Regulator VPT LAN v1.0. It provides functions to control the VPT and to gather data from its sensors. Each VPT regulator consists of up to 4 zones and 1 boiler. This means one instance of VPTDevice takes care of 5 devices. Each subdevice has own DeviceID.
VPTDevice::VPTDevice | ( | const Poco::Net::SocketAddress & | address, |
const Poco::Timespan & | httpTimeout, | ||
const Poco::Timespan & | pingTimeout, | ||
const GatewayID & | id, | ||
const RefreshTime & | refresh, | ||
const DeviceCache::Ptr | deviceCache | ||
) |
Connects to specified address to fetch information for creating VPT Device. If the device do not respond in specified timeout, Poco::TimeoutException is thrown.
&address | IP address and port where the device is listening. |
httpTimeout | HTTP timeout. |
pingTimeout | ping timeout used to obtain the IP address of gateway's interface from which the VPT is available. |
id | Gateway id used in generating of stamp. |
|
overridevirtual |
Implements BeeeOn::PollableDevice.
void VPTDevice::requestModifyState | ( | const DeviceID & | id, |
const ModuleID | module, | ||
const double | value | ||
) |
id | Subdevice of VPT. |
module | Module of subdevice. |
value | Requested value. the success of the request |
vector< SensorData > VPTDevice::requestValues | ( | ) |
Gathers data from all sensors of subdevices.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |