| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef BLUETOOTH_DEVICE_H
- #define BLUETOOTH_DEVICE_H
- #include <string>
- #include <vector>
- #include "Util/Device.h"
- #include "Util/Timer.h"
- #include "Util/HttpClient.h"
- namespace PresenceDetection {
- namespace Bluetooth {
- class Device
- {
- public:
- Device(int timeout, const std::string& inventoryURL, const std::string& target, const std::vector<Util::Device>& devices);
- ~Device();
- void Start();
- void Stop();
- void Wait();
- private:
- void ClearDevices();
- void UpdateDevicesFromInventory();
- void UpdateOnlineDevices();
- void UpdateOfflineDevices();
- void UpdatePresentDevices(bool updateOnlineDevices);
- void SendStateChange(bool present, const std::string& macAddress);
- private:
- Util::Timer m_onlineDeviceTimer;
- Util::Timer m_offlineDeviceTimer;
- Util::Timer m_inventoryTimer;
- Util::HttpClient m_httpClient;
- std::vector<std::string> m_devices;
- int m_timeout;
- std::string m_inventoryURL;
- std::string m_target;
- std::vector<Util::Device> m_staticDevices;
- std::vector<std::string> m_presentDevices;
- };
- } // namespace Bluetooth
- } // namespace PresenceDetection
- #endif // BLUETOOTH_DEVICE_H
|