Add Static Devices, Timeout and UniFi Port Directive

This commit is contained in:
2020-03-05 16:56:12 +01:00
parent 2fbec833a2
commit 7b8fcc9722
8 changed files with 556 additions and 35 deletions
+5 -1
View File
@@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include "Util/Device.h"
#include "Util/Timer.h"
#include "Util/HttpClient.h"
@@ -13,7 +14,7 @@ namespace Bluetooth {
class Device
{
public:
Device(const std::string& inventoryURL, const std::string& target);
Device(int timeout, const std::string& inventoryURL, const std::string& target, const std::vector<Util::Device>& devices);
~Device();
void Start();
@@ -21,6 +22,7 @@ public:
void Wait();
private:
void ClearDevices();
void UpdateDevicesFromInventory();
void UpdatePresentDevices();
void SendStateChange(bool present, const std::string& macAddress);
@@ -32,8 +34,10 @@ private:
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;
};