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

The class represents Belkin WeMo Switch F7C027fr. Provides functions to control the switch. It means turn on, turn off, get state. More...

#include <BelkinWemoSwitch.h>

Inheritance diagram for BeeeOn::BelkinWemoSwitch:
BeeeOn::BelkinWemoStandaloneDevice BeeeOn::BelkinWemoDevice BeeeOn::PollableDevice BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< BelkinWemoSwitch
Ptr
 
- Public Types inherited from BeeeOn::BelkinWemoStandaloneDevice
typedef Poco::SharedPtr
< BelkinWemoStandaloneDevice
Ptr
 
- Public Types inherited from BeeeOn::BelkinWemoDevice
typedef Poco::SharedPtr
< BelkinWemoDevice
Ptr
 
- Public Types inherited from BeeeOn::PollableDevice
typedef Poco::SharedPtr
< PollableDevice
Ptr
 

Public Member Functions

 BelkinWemoSwitch (const Poco::Net::SocketAddress &address, const Poco::Timespan &httpTimeout, const RefreshTime &refresh)
 Creates belkin wemo switch. If the device is not on network throws Poco::TimeoutException also in this case it is blocking. More...
 
bool requestModifyState (const ModuleID &moduleID, const double value) override
 It sets the switch to the given state.
 
SensorData requestState () override
 Prepares SOAP message containing request state 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. Request current state of the device and return it as SensorData. More...
 
std::list< ModuleTypemoduleTypes () const override
 
std::string name () const override
 
bool operator== (const BelkinWemoSwitch &bws) const
 It compares two switches based on DeviceID.
 
- Public Member Functions inherited from BeeeOn::BelkinWemoStandaloneDevice
 BelkinWemoStandaloneDevice (const Poco::URI &uri, const Poco::Timespan &httpTimeout, const RefreshTime &refresh)
 
HTTPEntireResponse requestBinaryState () const
 Prepares SOAP message containing GetBinaryState request and sends it to device via HTTP. If the device do not respond in specified timeout, Poco::TimeoutException is thrown.
 
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. If the device do not respond in specified timeout, Poco::TimeoutException is thrown. More...
 
Poco::Net::SocketAddress address () const
 
void setAddress (const Poco::Net::SocketAddress &address)
 
- Public Member Functions inherited from BeeeOn::BelkinWemoDevice
 BelkinWemoDevice (const DeviceID &id, const RefreshTime &refresh)
 
DeviceID deviceID () const
 
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.
 
void poll (Distributor::Ptr distributor) override
 Perform polling for data and ship them via the given distributor.
 
virtual Poco::FastMutex & lock ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BeeeOn::BelkinWemoDevice
static Poco::XML::Node * findNode (Poco::XML::NodeIterator &iterator, const std::string &name)
 Finds the first node with the given name and returns it's value. When the value of node si empty returns NULL. If the node with the given name does not exist Poco::NotFoundException is raised.
 
static std::list
< Poco::XML::Node * > 
findNodes (Poco::XML::NodeIterator &iterator, const std::string &name)
 Finds all nodes with the given name and returns their values.
 
- 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)
 
- Protected Attributes inherited from BeeeOn::BelkinWemoStandaloneDevice
Poco::URI m_uri
 
const Poco::Timespan m_httpTimeout
 
- Protected Attributes inherited from BeeeOn::BelkinWemoDevice
const DeviceID m_deviceId
 
RefreshTime m_refresh
 
Poco::FastMutex m_lock
 

Detailed Description

The class represents Belkin WeMo Switch F7C027fr. Provides functions to control the switch. It means turn on, turn off, get state.

Constructor & Destructor Documentation

BelkinWemoSwitch::BelkinWemoSwitch ( const Poco::Net::SocketAddress &  address,
const Poco::Timespan &  httpTimeout,
const RefreshTime refresh 
)

Creates belkin wemo switch. If the device is not on network throws Poco::TimeoutException also in this case it is blocking.

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

Member Function Documentation

SensorData BelkinWemoSwitch::requestState ( )
overridevirtual

Prepares SOAP message containing request state 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. Request current state of the device and return it as SensorData.

Returns
SensorData.

Implements BeeeOn::BelkinWemoDevice.


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