BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BelkinWemoStandaloneDevice.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <Poco/SharedPtr.h>
6 #include <Poco/Timespan.h>
7 #include <Poco/URI.h>
8 #include <Poco/Net/SocketAddress.h>
9 
10 #include "belkin/BelkinWemoDevice.h"
11 #include "net/HTTPEntireResponse.h"
12 #include "net/MACAddress.h"
13 
14 namespace BeeeOn {
15 
21 public:
22  typedef Poco::SharedPtr<BelkinWemoStandaloneDevice> Ptr;
23 
25  const Poco::URI& uri,
26  const Poco::Timespan &httpTimeout,
27  const RefreshTime &refresh);
28 
35 
44  bool requestModifyBinaryState(const std::string& setModuleName,
45  const std::string& getModuleName, const int value) const;
46 
47  Poco::Net::SocketAddress address() const;
48  void setAddress(const Poco::Net::SocketAddress& address);
49 
50 private:
57  static MACAddress requestMacAddr(
58  const Poco::URI &uri,
59  const Poco::Timespan &httpTimeout);
60 
65  static DeviceID buildDeviceID(
66  const Poco::URI& uri,
67  const Poco::Timespan& httpTimeout);
68 
69 protected:
70  Poco::URI m_uri;
71  const Poco::Timespan m_httpTimeout;
72 };
73 
74 }
Abstract class representing generic BelkinWemo device.
Definition: BelkinWemoDevice.h:24
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
HTTPEntireResponse requestBinaryState() const
Prepares SOAP message containing GetBinaryState request and sends it to device via HTTP...
Definition: BelkinWemoStandaloneDevice.cpp:76
Definition: HTTPEntireResponse.h:13
Definition: MACAddress.h:8
bool requestModifyBinaryState(const std::string &setModuleName, const std::string &getModuleName, const int value) const
Prepares SOAP message containing SetBinaryState request and sends it to device via HTTP...
Definition: BelkinWemoStandaloneDevice.cpp:119
Definition: DeviceID.h:17
Abstract class representing generic BelkinWemo standalone device. The class implements sending messag...
Definition: BelkinWemoStandaloneDevice.h:20
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BelkinWemoDevice.cpp:30