mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
Merge commit '1db01f08e6c3cd627ea5decab31c687dee10c6e6'
This commit is contained in:
+9
-5
@@ -49,13 +49,11 @@ void WiFiManager::addParameter(WiFiManagerParameter *p) {
|
||||
DEBUG_WM(p->getID());
|
||||
}
|
||||
|
||||
void WiFiManager::setupConfigPortal(char const *apName, char const *apPassword) {
|
||||
void WiFiManager::setupConfigPortal() {
|
||||
dnsServer.reset(new DNSServer());
|
||||
server.reset(new ESP8266WebServer(80));
|
||||
|
||||
DEBUG_WM(F(""));
|
||||
_apName = apName;
|
||||
_apPassword = apPassword;
|
||||
start = millis();
|
||||
|
||||
DEBUG_WM(F("Configuring access point... "));
|
||||
@@ -130,13 +128,16 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
|
||||
//setup AP
|
||||
WiFi.mode(WIFI_AP);
|
||||
|
||||
_apName = apName;
|
||||
_apPassword = apPassword;
|
||||
|
||||
//notify we entered AP mode
|
||||
if ( _apcallback != NULL) {
|
||||
_apcallback();
|
||||
}
|
||||
|
||||
connect = false;
|
||||
setupConfigPortal(apName, apPassword);
|
||||
setupConfigPortal();
|
||||
DEBUG_WM("start loop");
|
||||
while (timeout == 0 || millis() < start + timeout) {
|
||||
//DNS
|
||||
@@ -205,6 +206,10 @@ String WiFiManager::getPassword() {
|
||||
return _pass;
|
||||
}
|
||||
|
||||
String WiFiManager::getConfigurationSSID() {
|
||||
return _apName;
|
||||
}
|
||||
|
||||
String WiFiManager::urldecode(const char *src)
|
||||
{
|
||||
String decoded = "";
|
||||
@@ -477,7 +482,6 @@ void WiFiManager::DEBUG_WM(Generic text) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int WiFiManager::getRSSIasQuality(int RSSI) {
|
||||
int quality = 0;
|
||||
|
||||
|
||||
+4
-1
@@ -67,6 +67,9 @@ class WiFiManager
|
||||
String getSSID();
|
||||
String getPassword();
|
||||
|
||||
// get the AP name of the config portal, so it can be used in the callback
|
||||
String getConfigurationSSID();
|
||||
|
||||
void resetSettings();
|
||||
//for convenience
|
||||
String urldecode(const char*);
|
||||
@@ -96,7 +99,7 @@ class WiFiManager
|
||||
|
||||
const String HTTP_HEAD = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/><title>{v}</title>";
|
||||
|
||||
void setupConfigPortal(char const *apName, char const *apPassword);
|
||||
void setupConfigPortal();
|
||||
|
||||
int _eepromStart;
|
||||
const char* _apName = "no-net";
|
||||
|
||||
Reference in New Issue
Block a user