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

Abstract class representing generic Bluetooth Low Energy smart device. More...

#include <BLESmartDevice.h>

Inheritance diagram for BeeeOn::BLESmartDevice:
BeeeOn::PollableDevice BeeeOn::Loggable BeeeOn::BeeWiDevice BeeeOn::RevogiDevice BeeeOn::TabuLumenSmartLite BeeeOn::BeeWiSmartClim BeeeOn::BeeWiSmartDoor BeeeOn::BeeWiSmartLite BeeeOn::BeeWiSmartMotion BeeeOn::BeeWiSmartWatt BeeeOn::RevogiRGBLight BeeeOn::RevogiSmartPlug BeeeOn::RevogiSmartCandle BeeeOn::RevogiSmartLite

Public Types

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

Public Member Functions

 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 std::list< ModuleTypemoduleTypes () const =0
 
virtual std::string productName () const =0
 
virtual std::string vendor () const =0
 
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 bool pollable () const
 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.
 
virtual void requestModifyState (const ModuleID &moduleID, const double value)
 Modifies the device module given by moduleID to a given value. More...
 
virtual SensorData parseAdvertisingData (const std::vector< unsigned char > &data) const
 Transforms advertising data to SensorData. More...
 

Protected Attributes

DeviceID m_deviceId
 
MACAddress m_address
 
Poco::Timespan m_timeout
 
RefreshTime m_refresh
 
HciInterface::Ptr m_hci
 

Additional Inherited Members

- 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)
 

Detailed Description

Abstract class representing generic Bluetooth Low Energy smart device.

Constructor & Destructor Documentation

BLESmartDevice::BLESmartDevice ( const MACAddress address,
const Poco::Timespan &  timeout,
const RefreshTime refresh,
const HciInterface::Ptr  hci 
)
Parameters
&addressMAC address of the device
&timeouttimeout of actions as connect, read, write
hcireference to HCI

Member Function Documentation

DeviceID BLESmartDevice::id ( ) const
overridevirtual
Returns
ID of the device.

Implements BeeeOn::PollableDevice.

SensorData BLESmartDevice::parseAdvertisingData ( const std::vector< unsigned char > &  data) const
virtual

Transforms advertising data to SensorData.

Exceptions
ProtocolExceptionin case of bad received advertising data.
NotImplementedExceptionif the device does not support processing of its advertising data.

Reimplemented in BeeeOn::BeeWiSmartWatt, BeeeOn::BeeWiSmartLite, BeeeOn::BeeWiSmartDoor, BeeeOn::BeeWiSmartMotion, and BeeeOn::BeeWiSmartClim.

void BLESmartDevice::requestModifyState ( const ModuleID moduleID,
const double  value 
)
virtual

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 in BeeeOn::BeeWiSmartWatt, BeeeOn::TabuLumenSmartLite, BeeeOn::BeeWiSmartLite, BeeeOn::RevogiSmartCandle, BeeeOn::RevogiSmartPlug, and BeeeOn::RevogiSmartLite.


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