BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BeeWiDevice.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 
6 #include <Poco/AtomicCounter.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
9 #include <Poco/UUID.h>
10 
11 #include "bluetooth/BLESmartDevice.h"
12 #include "bluetooth/HciConnection.h"
13 #include "model/ModuleType.h"
14 #include "net/MACAddress.h"
15 
16 namespace BeeeOn {
17 
22 class BeeWiDevice : public BLESmartDevice {
23 public:
24  typedef Poco::SharedPtr<BeeWiDevice> Ptr;
25 
26 private:
30  static const Poco::UUID LOCAL_TIME;
31  static const std::string VENDOR_NAME;
32 
33 public:
35  const MACAddress& address,
36  const Poco::Timespan& timeout,
37  const RefreshTime& refresh,
38  const std::string& productName,
39  const std::list<ModuleType>& moduleTypes,
40  const HciInterface::Ptr hci);
41 
42  ~BeeWiDevice();
43 
44  std::list<ModuleType> moduleTypes() const override;
45  std::string vendor() const override;
46  std::string productName() const override;
47 
48  void pair(
49  Poco::SharedPtr<HciInterface::WatchCallback> callback) override;
50 
51 protected:
58  void initLocalTime(HciConnection::Ptr conn) const;
59 
60 private:
61  std::string m_productName;
62  std::list<ModuleType> m_moduleTypes;
63  Poco::AtomicCounter m_paired;
64 };
65 
66 }
void pair(Poco::SharedPtr< HciInterface::WatchCallback > callback) override
When the device supports processing of advertising data, it should call a watch() on the given HciInt...
Definition: BeeWiDevice.cpp:50
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Definition: MACAddress.h:8
Abstract class for BeeWi devices. Some BeeWi devices need to set the time to stop blinking...
Definition: BeeWiDevice.h:22
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BLESmartDevice.cpp:31
Abstract class representing generic Bluetooth Low Energy smart device.
Definition: BLESmartDevice.h:26
void initLocalTime(HciConnection::Ptr conn) const
Sends and initilize local time of sensor. The local time is in format: ymdHMS.
Definition: BeeWiDevice.cpp:60