Initial Commit

This commit is contained in:
2018-12-18 12:07:12 +01:00
commit 7ad040c6c1
31 changed files with 1974 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
#ifndef UNIFI_DEVICE_H
#define UNIFI_DEVICE_H
#include <mutex>
#include <string>
#include <vector>
#include "Util/Timer.h"
#include "Util/HttpClient.h"
namespace PresenceDetection {
namespace UniFi {
class Device
{
public:
Device(const std::string& hostname, const std::string& username, const std::string& password, const std::string& cookieFile, const std::string& target);
~Device();
void Start();
void Stop();
void Wait();
private:
bool Login();
void Logout();
void UpdatePresentDevices();
private:
Util::Timer m_timer;
Util::HttpClient m_httpClient;
std::mutex m_mutex;
bool m_loggedIn;
std::string m_hostname;
std::string m_username;
std::string m_password;
std::string m_cookieFile;
std::string m_target;
int m_offlineTimeout;
std::vector<std::string> m_presentDevices;
};
} // namespace UniFi
} // namespace PresenceDetection
#endif // UNIFI_DEVICE_H