Update UniFi Login

This commit is contained in:
2025-03-03 12:59:13 +01:00
parent dc17bbe535
commit 434eb25dda
5 changed files with 125 additions and 13 deletions
+33 -1
View File
@@ -1,9 +1,12 @@
#include "Bluetooth/Functions.h"
#include "Logic/Logic.h"
#include "Util/StaticDevice.h"
#include "WiFi/Driver.h"
#include "WiFi/Functions.h"
#include <INIReader.h>
#include <algorithm>
#include <iostream>
#include <signal.h>
#include <string>
@@ -86,11 +89,40 @@ void TestPing()
std::cout << "--------------------------------" << std::endl << std::endl;
}
void TestUniFi()
{
std::shared_ptr<PresenceDetection::WiFi::Driver> pWiFiDriver;
std::string hostname = "UniFi-Controller";
int port = 8443;
std::string username = "admin";
std::string password = "Wh1sK3y196909";
std::string cookiefile = "UniFi_Cookies";
int timeout = 60;
std::string inventoryURL = "http://DomoticaPi:8080/api/inventory/WirelessDevice";
std::string target = "";
std::vector<PresenceDetection::Util::StaticDevice> staticDevices;
pWiFiDriver = std::make_shared<PresenceDetection::WiFi::Driver>(hostname, port, username, password, cookiefile, timeout, inventoryURL, target, staticDevices);
sigset_t wset;
sigemptyset(&wset);
sigaddset(&wset,SIGHUP);
sigaddset(&wset,SIGINT);
sigaddset(&wset,SIGTERM);
int sig;
sigwait(&wset,&sig);
pWiFiDriver->Stop();
pWiFiDriver->Wait();
}
int main(int /*argc*/, char** /*argv[]*/)
{
//TestINIReader();
//TestLogic();
TestPing();
//TestPing();
TestUniFi();
return 0;
}