BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Friends
BeeeOn::BelkinWemoLink Class Reference

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
 

Detailed Description

The class represents Belkin WeMo Link. Provides functions to control the bulbs. It means turn on, turn off, modify dim, get state of bulb.

Constructor & Destructor Documentation

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.

Parameters
&addressIP address and port where the device is listening.
&timeoutHTTP timeout.

Member Function Documentation

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.

Returns
List of bulbIDs.
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.

Returns
If the request was successful or not.

The documentation for this class was generated from the following files: