Add Static Devices, Timeout and UniFi Port Directive
This commit is contained in:
+6
-2
@@ -4,6 +4,7 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "Util/Device.h"
|
||||
#include "Util/Timer.h"
|
||||
#include "Util/HttpClient.h"
|
||||
|
||||
@@ -14,7 +15,7 @@ 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& inventoryURL, const std::string& target);
|
||||
Device(const std::string& hostname, int port, const std::string& username, const std::string& password, const std::string& cookieFile, int timeout, const std::string& inventoryURL, const std::string& target, const std::vector<Util::Device>& devices);
|
||||
~Device();
|
||||
|
||||
void Start();
|
||||
@@ -25,6 +26,7 @@ private:
|
||||
bool Login();
|
||||
void Logout();
|
||||
|
||||
void ClearDevices();
|
||||
void UpdateDevicesFromInventory();
|
||||
void UpdatePresentDevices();
|
||||
void SendStateChange(bool present, const std::string& macAddress);
|
||||
@@ -37,15 +39,17 @@ private:
|
||||
std::mutex m_mutex;
|
||||
bool m_loggedIn;
|
||||
std::string m_hostname;
|
||||
int m_port;
|
||||
std::string m_username;
|
||||
std::string m_password;
|
||||
std::string m_cookieFile;
|
||||
|
||||
std::vector<std::string> m_devices;
|
||||
|
||||
int m_timeout;
|
||||
std::string m_inventoryURL;
|
||||
std::string m_target;
|
||||
int m_offlineTimeout;
|
||||
std::vector<Util::Device> m_staticDevices;
|
||||
|
||||
std::vector<std::string> m_presentDevices;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user