BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
The class represents Belkin WeMo Link. Provides functions to control the bulbs. It means turn on, turn off, modify dim, get state of bulb. More...
#include <BelkinWemoLink.h>
Public Types | |
typedef Poco::SharedPtr < BelkinWemoLink > | Ptr |
typedef uint64_t | BulbID |
Public Member Functions | |
BelkinWemoLink (const Poco::Net::SocketAddress &address, const Poco::Timespan &httpTimeout) | |
Creates belkin wemo link. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. More... | |
std::list< BelkinWemoLink::BulbID > | requestDeviceList () |
Prepares SOAP message containing request device list command and sends it to device via HTTP. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. More... | |
bool | requestModifyState (const BelkinWemoLink::BulbID bulbID, const int capability, const std::string &value) |
Prepares SOAP message containing request modify state of proper device command and sends it to device via HTTP. If the device is not on network throws Poco::TimeoutException also in this case it is blocking. More... | |
std::string | requestDeviceState (const BelkinWemoLink::BulbID bulbID) |
Prepares SOAP message containing request state of proper device command and sends it to device via HTTP. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. Return the body of HTTP response. | |
Poco::Net::SocketAddress | address () const |
void | setAddress (const Poco::Net::SocketAddress &address) |
MACAddress | macAddress () const |
uint32_t | countOfBulbs () |
Poco::FastMutex & | lock () |
bool | operator== (const BelkinWemoLink &bwl) const |
It compares two links based on MAC address. | |
Friends | |
class | BelkinWemoBulb |
The class represents Belkin WeMo Link. Provides functions to control the bulbs. It means turn on, turn off, modify dim, get state of bulb.
BelkinWemoLink::BelkinWemoLink | ( | const Poco::Net::SocketAddress & | address, |
const Poco::Timespan & | httpTimeout | ||
) |
Creates belkin wemo link. If the device do not respond in specified timeout, Poco::TimeoutException is thrown.
&address | IP address and port where the device is listening. |
&timeout | HTTP timeout. |
std::list< BelkinWemoLink::BulbID > BelkinWemoLink::requestDeviceList | ( | ) |
Prepares SOAP message containing request device list command and sends it to device via HTTP. If the device do not respond in specified timeout, Poco::TimeoutException is thrown.
bool BelkinWemoLink::requestModifyState | ( | const BelkinWemoLink::BulbID | bulbID, |
const int | capability, | ||
const std::string & | value | ||
) |
Prepares SOAP message containing request modify state of proper device command and sends it to device via HTTP. If the device is not on network throws Poco::TimeoutException also in this case it is blocking.