Device.h 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef BLUETOOTH_DEVICE_H
  2. #define BLUETOOTH_DEVICE_H
  3. #include <string>
  4. #include <vector>
  5. #include "Util/Timer.h"
  6. #include "Util/HttpClient.h"
  7. namespace PresenceDetection {
  8. namespace Bluetooth {
  9. class Device
  10. {
  11. public:
  12. Device(const std::string& inventoryURL, const std::string& target);
  13. ~Device();
  14. void Start();
  15. void Stop();
  16. void Wait();
  17. private:
  18. void UpdateDevicesFromInventory();
  19. void UpdatePresentDevices();
  20. void SendStateChange(bool present, const std::string& macAddress);
  21. private:
  22. Util::Timer m_deviceTimer;
  23. Util::Timer m_inventoryTimer;
  24. Util::HttpClient m_httpClient;
  25. std::vector<std::string> m_devices;
  26. std::string m_inventoryURL;
  27. std::string m_target;
  28. std::vector<std::string> m_presentDevices;
  29. };
  30. } // namespace Bluetooth
  31. } // namespace PresenceDetection
  32. #endif // BLUETOOTH_DEVICE_H