Update Naming and Tests

This commit is contained in:
2021-07-28 16:23:27 +02:00
parent f03e90f5b9
commit 03b00fa6de
17 changed files with 566 additions and 104 deletions
+50
View File
@@ -0,0 +1,50 @@
#ifndef BLUETOOTH_DRIVER_H
#define BLUETOOTH_DRIVER_H
#include "Util/DynamicDevice.h"
#include "Util/StaticDevice.h"
#include <HttpClient.h>
#include <Timer.h>
#include <string>
#include <vector>
namespace PresenceDetection {
namespace Bluetooth {
class Driver
{
public:
Driver(int timeout, const std::string& inventoryURL, const std::string& target, const std::vector<Util::StaticDevice>& staticDevices);
~Driver();
void Start();
void Stop();
void Wait();
private:
void ClearDevices();
void UpdateDevicesFromInventory();
void UpdatePresentDevices();
void SendStateChange(bool present, const std::string& macAddress);
private:
Timer::Timer m_deviceTimer;
Timer::Timer m_inventoryTimer;
Http::HttpClient m_httpClient;
std::vector<Util::DynamicDevice> m_dynamicDevices;
int m_timeout;
int m_checkInterval;
std::string m_inventoryURL;
std::string m_target;
std::vector<Util::StaticDevice> m_staticDevices;
std::vector<std::string> m_presentDevices;
};
} // namespace Bluetooth
} // namespace PresenceDetection
#endif // BLUETOOTH_DRIVER_H