Skip to content

Commit

Permalink
Set internet available flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrouse committed Feb 4, 2024
1 parent ad6e604 commit 153778c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GitOTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ void GitUpdater::toJSON(JsonObject &obj) {
obj["error"] = this->error;
obj["cancelled"] = this->cancelled;
obj["checkForUpdate"] = settings.checkForUpdate;
obj["inetAvailable"] = this->inetAvailable;
JsonObject fw = obj.createNestedObject("fwVersion");
settings.fwVersion.toJSON(fw);
JsonObject app = obj.createNestedObject("appVersion");
Expand Down Expand Up @@ -337,10 +338,12 @@ int GitUpdater::checkInternet() {
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY || httpCode == HTTP_CODE_FOUND) {
err = 0;
Serial.printf("Internet is Available: %ldms\n", millis() - t);
this->inetAvailable = true;
}
else {
err = httpCode;
Serial.printf("Internet is Unavailable: %d: %ldms\n", err, millis() - t);
this->inetAvailable = false;
}
https->end();
}
Expand Down
1 change: 1 addition & 0 deletions GitOTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class GitUpdater {
uint8_t status = 0;
uint32_t lastCheck = 0;
bool updateAvailable = false;
bool inetAvailable = false;
appver_t latest;
bool cancelled = false;
int16_t error = 0;
Expand Down
Binary file modified SomfyController.ino.esp32.bin
Binary file not shown.
Binary file modified SomfyController.ino.esp32s3.bin
Binary file not shown.

0 comments on commit 153778c

Please sign in to comment.