BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BeeWiSmartWatt.h
1 #pragma once
2 
3 #include <Poco/SharedPtr.h>
4 #include <Poco/UUID.h>
5 
6 #include "bluetooth/BeeWiDevice.h"
7 #include "bluetooth/HciConnection.h"
8 
9 namespace BeeeOn {
10 
15 class BeeWiSmartWatt : public BeeWiDevice {
16 public:
17  typedef Poco::SharedPtr<BeeWiSmartWatt> Ptr;
18 
19  static const std::string NAME;
20 
21 private:
25  static const Poco::UUID ACTUAL_VALUES;
29  static const Poco::UUID ON_OFF;
33  static const Poco::UUID LIGHT_ON_OFF;
34 
35 protected:
40  const MACAddress& address,
41  const Poco::Timespan& timeout,
42  const RefreshTime& refersh,
43  const HciInterface::Ptr hci);
44 
45 public:
47  const MACAddress& address,
48  const Poco::Timespan& timeout,
49  const RefreshTime& refersh,
50  const HciInterface::Ptr hci,
51  HciConnection::Ptr conn);
52  ~BeeWiSmartWatt();
53 
54  bool pollable() const override;
55  void poll(Distributor::Ptr distributor) override;
56 
57  void requestModifyState(
58  const ModuleID& moduleID,
59  const double value) override;
60 
67  const std::vector<unsigned char>& data) const override;
68 
69  static bool match(const std::string& modelID);
70 
71 protected:
77  SensorData parseValues(std::vector<unsigned char>& values) const;
78 };
79 
80 }
void requestModifyState(const ModuleID &moduleID, const double value) override
Modifies the device module given by moduleID to a given value.
Definition: BeeWiSmartWatt.cpp:70
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Definition: SensorData.h:20
The class represents BeeWi smart switch. It allows to gather and to control all its modules...
Definition: BeeWiSmartWatt.h:15
Definition: MACAddress.h:8
Abstract class for BeeWi devices. Some BeeWi devices need to set the time to stop blinking...
Definition: BeeWiDevice.h:22
Definition: ModuleID.h:12
BeeWiSmartWatt(const MACAddress &address, const Poco::Timespan &timeout, const RefreshTime &refersh, const HciInterface::Ptr hci)
SensorData parseValues(std::vector< unsigned char > &values) const
Definition: BeeWiSmartWatt.cpp:123
SensorData parseAdvertisingData(const std::vector< unsigned char > &data) const override
Definition: BeeWiSmartWatt.cpp:104
void poll(Distributor::Ptr distributor) override
Perform polling for data and ship them via the given distributor.
Definition: BeeWiSmartWatt.cpp:60
bool pollable() const override
Returns true if the device is pollable, otherwise false.
Definition: BeeWiSmartWatt.cpp:55