-
Notifications
You must be signed in to change notification settings - Fork 0
/
CaptivePortalManager.h
43 lines (32 loc) · 1.02 KB
/
CaptivePortalManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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;
// сохранение введённых значений пользовательских параметров
// ...
}