Skip to content

Commit 37d5393

Browse files
committed
Release v1.15.1
1 parent c8ea525 commit 37d5393

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/BootstrapManager.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class BootstrapManager {
5050
// using JsonDocument = StaticJsonDocument<BUFFER_SIZE>;
5151
StaticJsonDocument<BUFFER_SIZE> parseQueueMsg(char* topic, byte* payload, unsigned int length); // print the message arriving from the queue
5252
StaticJsonDocument<BUFFER_SIZE> parseHttpMsg(String payload, unsigned int length); // print the message arriving from HTTP
53+
void littleFsInit();
5354
void bootstrapSetup(void (*manageDisconnectionFunction)(), void (*manageHardwareButton)(), void (*callback)(char*, byte*, unsigned int)); // bootstrap setup()
55+
void bootstrapSetup(void (*manageDisconnectionFunction)(), void (*manageHardwareButton)(), void (*callback)(char*, byte*, unsigned int), bool waitImprov, void (*listener)()); // bootstrap setup()
5456
void bootstrapLoop(void (*manageDisconnectionFunction)(), void (*manageQueueSubscription)(), void (*manageHardwareButton)()); // bootstrap loop()
5557
static void setMQTTWill(const char *topic, const char *payload, int qos, boolean retain, boolean cleanSession); // set the last will parameters for mqtt
5658
static void publish(const char *topic, const char *payload, boolean retained); // send a message on the queue
@@ -69,8 +71,9 @@ class BootstrapManager {
6971
[[maybe_unused]] String readValueFromFile(const String& filenameToUse, const String& paramName); // read a param from a json file
7072
static bool isWifiConfigured(); // check if wifi is correctly configured
7173
void launchWebServerForOTAConfig(); // if no ssid available, launch web server to get config params via browser
74+
void launchWebServerCustom(bool waitImprov, void (*listener)()); // if no ssid available, launch web server to get config params via browser
7275
static int getWifiQuality(); // get the wifi quality
73-
76+
void manageImprov();
7477
};
7578

7679
#endif

src/QueueManager.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,12 @@ void QueueManager::mqttReconnect(void (*manageDisconnections)(), void (*manageQu
100100
Helpers::smartPrintln(F("MQTT attempts="));
101101
Helpers::smartPrintln(mqttReconnectAttemp);
102102
helper.smartDisplay();
103-
104-
if (mqttReconnectAttemp > 15) {
105-
// if fastDisconnectionManagement we need to execute the callback immediately,
106-
// example: power off a watering system can't wait MAX_RECONNECT attemps
107-
if (fastDisconnectionManagement) {
108-
manageDisconnections();
109-
Helpers::smartPrintln(F("Disconnecting WiFi."));
110-
WiFi.reconnect();
111-
}
112-
}
113-
114103
// after MAX_RECONNECT attemps all peripherals are shut down
115-
if (mqttReconnectAttemp >= MAX_RECONNECT) {
104+
if (mqttReconnectAttemp >= MAX_RECONNECT || fastDisconnectionManagement) {
116105
Helpers::smartPrintln(F("Max retry reached, powering off peripherals."));
117106
helper.smartDisplay();
118107
// Manage disconnections, powering off peripherals
119108
manageDisconnections();
120-
Helpers::smartPrintln(F("Disconnecting WiFi."));
121-
WiFi.reconnect();
122109
} else if (mqttReconnectAttemp > 10000) {
123110
mqttReconnectAttemp = 0;
124111
}

src/WifiManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class WifiManager {
120120

121121
static bool isWifiConfigured(); // check if wifi is correctly configured
122122
static void launchWebServerForOTAConfig(); // if no ssid available, launch web server to get config params via browser
123+
static void launchWebServerCustom(void (*listener)()); // if no ssid available, launch web server to get config params via browser
123124
void manageImprovWifi(); // if no ssid available, launch web server to get config params via browser
124125
void handleImprovPacket();
125126

0 commit comments

Comments
 (0)