Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 2902e0b

Browse files
authored
v1.8.2 to optimize code, etc.
### Release v1.8.2 1. Optimize code by using passing by `reference` instead of by `value` 2. Optional `Board_Name` in Menu. Check [option to remove board name from web page #25](khoih-prog/WiFiManager_NINA_Lite#25) 3. Add function `isConfigMode()` to signal system is in Config Portal mode.
1 parent cd01a3e commit 2902e0b

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

examples/ESPAsync_WiFi/ESPAsync_WiFi.ino

+9-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,21 @@
1414
#include "Credentials.h"
1515
#include "dynamicParams.h"
1616

17+
ESPAsync_WiFiManager_Lite* ESPAsync_WiFiManager;
18+
1719
void heartBeatPrint()
1820
{
1921
static int num = 1;
2022

2123
if (WiFi.status() == WL_CONNECTED)
22-
Serial.print(F("H")); // H means connected to WiFi
24+
Serial.print("H"); // H means connected to WiFi
2325
else
24-
Serial.print(F("F")); // F means not connected to WiFi
26+
{
27+
if (ESPAsync_WiFiManager->isConfigMode())
28+
Serial.print("C"); // C means in Config Mode
29+
else
30+
Serial.print("F"); // F means not connected to WiFi
31+
}
2532

2633
if (num == 80)
2734
{
@@ -48,8 +55,6 @@ void check_status()
4855
}
4956
}
5057

51-
ESPAsync_WiFiManager_Lite* ESPAsync_WiFiManager;
52-
5358
#if USING_CUSTOMS_STYLE
5459
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
5560
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";

examples/ESPAsync_WiFi/defines.h

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@
124124

125125
/////////////////////////////////////////////
126126

127+
// Optional, to use Board Name in Menu
128+
#define USING_BOARD_NAME true
129+
130+
/////////////////////////////////////////////
131+
127132
#include <ESPAsync_WiFiManager_Lite.h>
128133

129134
#if ESP8266

examples/ESPAsync_WiFi_MQTT/ESPAsync_WiFi_MQTT.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ void heartBeatPrint()
5252
static int num = 1;
5353

5454
if (WiFi.status() == WL_CONNECTED)
55-
Serial.print("W"); // W means connected to WiFi
55+
Serial.print("H"); // H means connected to WiFi
5656
else
57-
Serial.print("N"); // N means not connected to WiFi
57+
{
58+
if (ESPAsync_WiFiManager->isConfigMode())
59+
Serial.print("C"); // C means in Config Mode
60+
else
61+
Serial.print("F"); // F means not connected to WiFi
62+
}
5863

5964
if (num == 40)
6065
{

examples/ESPAsync_WiFi_MQTT/defines.h

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@
124124

125125
/////////////////////////////////////////////
126126

127+
// Optional, to use Board Name in Menu
128+
#define USING_BOARD_NAME true
129+
130+
/////////////////////////////////////////////
131+
127132
#include <ESPAsync_WiFiManager_Lite.h>
128133

129134
#if ESP8266

0 commit comments

Comments
 (0)