mirror of
https://github.com/gunner47/GyverLamp.git
synced 2025-08-11 10:40:41 +03:00
Исправлены ошибки назначения статического IP адреса; Добавлен набросок WiFiManager Captive Portal для ввода пользовательских параметров и настроек
This commit is contained in:
43
firmware/GyverLamp_v1.4/CaptivePortalManager.h
Normal file
43
firmware/GyverLamp_v1.4/CaptivePortalManager.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <WiFiManager.h>
|
||||
|
||||
|
||||
class CaptivePortalManager
|
||||
{
|
||||
public:
|
||||
static bool captivePortalCalled;
|
||||
|
||||
CaptivePortalManager(WiFiManager *wifiManager);
|
||||
~CaptivePortalManager();
|
||||
static void captivePortalManagerCallback(WiFiManager *wifiManager);
|
||||
|
||||
private:
|
||||
WiFiManager *wifiManager = NULL;
|
||||
};
|
||||
|
||||
|
||||
CaptivePortalManager::CaptivePortalManager(WiFiManager *wifiManager)
|
||||
{
|
||||
this->wifiManager = wifiManager;
|
||||
|
||||
// добавление пользовательских параметров: id, placeholder, prompt/default value, length[, custom html]
|
||||
// ...
|
||||
|
||||
if (wifiManager != NULL)
|
||||
{
|
||||
wifiManager->setAPCallback(CaptivePortalManager::captivePortalManagerCallback);
|
||||
}
|
||||
}
|
||||
|
||||
CaptivePortalManager::~CaptivePortalManager()
|
||||
{
|
||||
this->wifiManager = NULL;
|
||||
}
|
||||
|
||||
void CaptivePortalManager::captivePortalManagerCallback(WiFiManager *wifiManager)
|
||||
{
|
||||
CaptivePortalManager::captivePortalCalled = true;
|
||||
// сохранение введённых значений пользовательских параметров
|
||||
// ...
|
||||
}
|
Reference in New Issue
Block a user