Skip to content

Commit 153778c

Browse files
author
Robert Strouse
committed
Set internet available flags
1 parent ad6e604 commit 153778c

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

GitOTA.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ void GitUpdater::toJSON(JsonObject &obj) {
305305
obj["error"] = this->error;
306306
obj["cancelled"] = this->cancelled;
307307
obj["checkForUpdate"] = settings.checkForUpdate;
308+
obj["inetAvailable"] = this->inetAvailable;
308309
JsonObject fw = obj.createNestedObject("fwVersion");
309310
settings.fwVersion.toJSON(fw);
310311
JsonObject app = obj.createNestedObject("appVersion");
@@ -337,10 +338,12 @@ int GitUpdater::checkInternet() {
337338
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY || httpCode == HTTP_CODE_FOUND) {
338339
err = 0;
339340
Serial.printf("Internet is Available: %ldms\n", millis() - t);
341+
this->inetAvailable = true;
340342
}
341343
else {
342344
err = httpCode;
343345
Serial.printf("Internet is Unavailable: %d: %ldms\n", err, millis() - t);
346+
this->inetAvailable = false;
344347
}
345348
https->end();
346349
}

GitOTA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class GitUpdater {
4343
uint8_t status = 0;
4444
uint32_t lastCheck = 0;
4545
bool updateAvailable = false;
46+
bool inetAvailable = false;
4647
appver_t latest;
4748
bool cancelled = false;
4849
int16_t error = 0;

SomfyController.ino.esp32.bin

0 Bytes
Binary file not shown.

SomfyController.ino.esp32s3.bin

48 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)