mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Set internet available flags
This commit is contained in:
parent
ad6e604f17
commit
153778c3d2
4 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
1
GitOTA.h
1
GitOTA.h
|
|
@ -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;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue