BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BelkinWemoLink.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 
6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
9 #include <Poco/URI.h>
10 #include <Poco/Net/SocketAddress.h>
11 
12 #include "model/SensorData.h"
13 #include "net/MACAddress.h"
14 
15 namespace BeeeOn {
16 
23 public:
24  friend class BelkinWemoBulb;
25 
26  typedef Poco::SharedPtr<BelkinWemoLink> Ptr;
27  typedef uint64_t BulbID;
28 
36  const Poco::Net::SocketAddress& address,
37  const Poco::Timespan &httpTimeout);
38 
45  std::list<BelkinWemoLink::BulbID> requestDeviceList();
46 
54  bool requestModifyState(const BelkinWemoLink::BulbID bulbID,
55  const int capability, const std::string& value);
56 
63  std::string requestDeviceState(const BelkinWemoLink::BulbID bulbID);
64 
65  Poco::Net::SocketAddress address() const;
66  void setAddress(const Poco::Net::SocketAddress& address);
67  MACAddress macAddress() const;
68 
69  uint32_t countOfBulbs();
70  Poco::FastMutex& lock();
71 
75  bool operator==(const BelkinWemoLink& bwl) const;
76 
77 private:
78  void requestDeviceInfo();
79 
83  void incrementCountOfBulbs();
84 
88  void decrementCountOfBulbs();
89 
90 private:
91  Poco::Net::SocketAddress m_address;
92  MACAddress m_macAddr;
93  std::string m_udn;
94 
95  Poco::FastMutex m_lockCountOfBulbs;
96  int m_countOfBulbs;
97 
98  Poco::FastMutex m_lock;
99  Poco::Timespan m_httpTimeout;
100 };
101 
102 }
Definition: MACAddress.h:8
The class represents Belkin WeMo Led Light Bulb. It works with Belkin WeMo Link it uses his methods t...
Definition: BelkinWemoBulb.h:22