7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
11 #include "bluetooth/BLESmartDevice.h"
12 #include "bluetooth/HciConnection.h"
13 #include "bluetooth/HciInterface.h"
14 #include "model/ModuleType.h"
15 #include "net/MACAddress.h"
31 typedef Poco::SharedPtr<RevogiDevice> Ptr;
46 static const std::string VENDOR_NAME;
57 const Poco::Timespan& timeout,
59 const std::string& productName,
60 const std::list<ModuleType>& moduleTypes,
61 const HciInterface::Ptr hci);
65 std::list<ModuleType> moduleTypes()
const override;
66 std::string vendor()
const override;
67 std::string productName()
const override;
70 void poll(Distributor::Ptr distributor)
override;
78 static bool match(
const std::string& modelID);
86 const Poco::Timespan& timeout,
88 const HciInterface::Ptr hci,
89 HciConnection::Ptr conn);
102 HciConnection::Ptr conn,
103 std::vector<unsigned char> payload,
104 const unsigned char checksum);
106 virtual void prependHeader(std::vector<unsigned char>& payload)
const = 0;
107 virtual void appendFooter(
108 std::vector<unsigned char>& payload,
109 const unsigned char checksum)
const;
112 std::string m_productName;
113 std::list<ModuleType> m_moduleTypes;
static const Poco::UUID UUID_DEVICE_NAME
Definition: RevogiDevice.h:45
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
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.
Definition: RevogiDevice.cpp:66
Definition: SensorData.h:20
static const Poco::UUID WRITE_VALUES_GATT
Definition: RevogiDevice.h:41
static const Poco::UUID ACTUAL_VALUES_GATT
Definition: RevogiDevice.h:37
Definition: MACAddress.h:8
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BLESmartDevice.cpp:31
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 B...
Definition: RevogiDevice.cpp:90
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...
Definition: RevogiDevice.cpp:85
static const std::vector< unsigned char > NOTIFY_DATA
Definition: RevogiDevice.h:52
Abstract class for Revogi devices.
Definition: RevogiDevice.h:29
bool pollable() const override
Returns true if the device is pollable, otherwise false.
Definition: RevogiDevice.cpp:50
Abstract class representing generic Bluetooth Low Energy smart device.
Definition: BLESmartDevice.h:26
virtual SensorData parseValues(const std::vector< unsigned char > &values) const =0
Convert actual setting of the device to SensorData.
void poll(Distributor::Ptr distributor) override
Perform polling for data and ship them via the given distributor.
Definition: RevogiDevice.cpp:55