Device.h 718 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 UpdatePresentDevices();
  19. void SendStateChange(bool present, const std::string& macAddress);
  20. private:
  21. Util::Timer m_timer;
  22. Util::HttpClient m_httpClient;
  23. std::vector<std::string> m_devices;
  24. std::string m_target;
  25. std::vector<std::string> m_presentDevices;
  26. };
  27. } // namespace Bluetooth
  28. } // namespace PresenceDetection
  29. #endif // BLUETOOTH_DEVICE_H