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

The class represents Revogi Delite-ED33 smart candle. It allows to control all its modules. More...

#include <RevogiSmartCandle.h>

Inheritance diagram for BeeeOn::RevogiSmartCandle:
BeeeOn::RevogiRGBLight BeeeOn::RevogiDevice BeeeOn::BLESmartDevice BeeeOn::PollableDevice BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< RevogiSmartCandle
Ptr
 
- Public Types inherited from BeeeOn::RevogiRGBLight
typedef Poco::SharedPtr
< RevogiRGBLight
Ptr
 
- Public Types inherited from BeeeOn::RevogiDevice
typedef Poco::SharedPtr
< RevogiDevice
Ptr
 
- Public Types inherited from BeeeOn::BLESmartDevice
typedef Poco::SharedPtr
< BLESmartDevice
Ptr
 
- Public Types inherited from BeeeOn::PollableDevice
typedef Poco::SharedPtr
< PollableDevice
Ptr
 

Public Member Functions

 RevogiSmartCandle (const std::string &name, const MACAddress &address, const Poco::Timespan &timeout, const RefreshTime &refresh, const HciInterface::Ptr hci)
 
void requestModifyState (const ModuleID &moduleID, const double value) override
 Modifies the device module given by moduleID to a given value. More...
 
- Public Member Functions inherited from BeeeOn::RevogiRGBLight
 RevogiRGBLight (const MACAddress &address, const Poco::Timespan &timeout, const std::string &productName, const std::list< ModuleType > &moduleTypes, const RefreshTime &refresh, const HciInterface::Ptr hci)
 
- Public Member Functions inherited from BeeeOn::RevogiDevice
 RevogiDevice (const MACAddress &address, const Poco::Timespan &timeout, const RefreshTime &refresh, const std::string &productName, const std::list< ModuleType > &moduleTypes, const HciInterface::Ptr hci)
 
std::list< ModuleTypemoduleTypes () const override
 
std::string vendor () const override
 
std::string productName () const override
 
bool pollable () const override
 Returns true if the device is pollable, otherwise false.
 
void poll (Distributor::Ptr distributor) override
 Perform polling for data and ship them via the given distributor.
 
- Public Member Functions inherited from BeeeOn::BLESmartDevice
 BLESmartDevice (const MACAddress &address, const Poco::Timespan &timeout, const RefreshTime &refresh, const HciInterface::Ptr hci)
 
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.
 
MACAddress macAddress () const
 
virtual void pair (Poco::SharedPtr< HciInterface::WatchCallback > callback)
 When the device supports processing of advertising data, it should call a watch() on the given HciInterface in this method and a unwatch() in the destructor. When the method is re-called it do not have any effect.
 
virtual SensorData parseAdvertisingData (const std::vector< unsigned char > &data) const
 Transforms advertising data to SensorData. More...
 

Static Public Attributes

static const std::set
< std::string > 
LIGHT_NAMES
 

Protected Member Functions

SensorData parseValues (const std::vector< unsigned char > &values) const override
 
- Protected Member Functions inherited from BeeeOn::RevogiRGBLight
void modifyStatus (const double value, const HciConnection::Ptr conn)
 
void modifyBrightness (const double value, const uint32_t rgb, const HciConnection::Ptr conn)
 
void modifyColor (const double value, const HciConnection::Ptr conn)
 
unsigned char brightnessFromPercents (const double percents) const
 
unsigned int brightnessToPercents (const double value) const
 
uint32_t retrieveRGB (const std::vector< unsigned char > &values) const
 Returns RGB contained in uint32_t. The components of RGB are retrieved from recived message contained actual setting of the light.
 
uint32_t colorChecksum (const uint8_t red, const uint8_t green, const uint8_t blue) const
 
void prependHeader (std::vector< unsigned char > &payload) const override
 
void appendFooter (std::vector< unsigned char > &payload, const unsigned char checksum) const override
 
- Protected Member Functions inherited from BeeeOn::RevogiDevice
void sendWriteRequest (HciConnection::Ptr conn, std::vector< unsigned char > payload, const unsigned char checksum)
 Prepends header and appends footer to payload and then sends it to device.
 
- 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)
 

Additional Inherited Members

- Static Public Member Functions inherited from BeeeOn::RevogiDevice
static bool match (const std::string &modelID)
 The method returns true if the model ID of the device may be model ID of some Revogi device. More...
 
static RevogiDevice::Ptr createDevice (const MACAddress &address, const Poco::Timespan &timeout, const RefreshTime &refresh, const HciInterface::Ptr hci, HciConnection::Ptr conn)
 Creates Revogi device according to device name located in the vendor specific characteristic of the BLE device.
 
- 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::BLESmartDevice
DeviceID m_deviceId
 
MACAddress m_address
 
Poco::Timespan m_timeout
 
RefreshTime m_refresh
 
HciInterface::Ptr m_hci
 
- Static Protected Attributes inherited from BeeeOn::RevogiDevice
static const Poco::UUID ACTUAL_VALUES_GATT = UUID("0000fff4-0000-1000-8000-00805f9b34fb")
 
static const Poco::UUID WRITE_VALUES_GATT = UUID("0000fff3-0000-1000-8000-00805f9b34fb")
 
static const Poco::UUID UUID_DEVICE_NAME = UUID("0000fff6-0000-1000-8000-00805f9b34fb")
 
static const std::string VENDOR_NAME = "Revogi"
 
static const std::vector
< unsigned char > 
NOTIFY_DATA
 

Detailed Description

The class represents Revogi Delite-ED33 smart candle. It allows to control all its modules.

Member Function Documentation

SensorData RevogiSmartCandle::parseValues ( const std::vector< unsigned char > &  values) const
overrideprotectedvirtual
| 4 B | rgb (3 B) | brightness/on_off (1 B) | 10 B |

Implements BeeeOn::RevogiDevice.

void RevogiSmartCandle::requestModifyState ( const ModuleID moduleID,
const double  value 
)
overridevirtual

Modifies the device module given by moduleID to a given value.

Exceptions
IOExceptionin case of communication failure.
NotImplementedExceptionif the device does not support modification of its state.

Reimplemented from BeeeOn::BLESmartDevice.

Field Documentation

const set< string > RevogiSmartCandle::LIGHT_NAMES
static
Initial value:
= {
"Delite-ED33",
"Delite-0870",
}

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