We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0abeb8 commit 75ddfccCopy full SHA for 75ddfcc
src/ArduinoIoTCloud.cpp
@@ -29,7 +29,12 @@ static ConnectionManager *getTimeConnection = NULL;
29
30
static unsigned long getTime() {
31
if (!getTimeConnection) return 0;
32
- return getTimeConnection->getTime();
+ unsigned long time = getTimeConnection->getTime();
33
+ if (!NTPUtils::isTimeValid(time)) {
34
+ debugMessage("Bogus NTP time from API, fallback to UDP method", 0);
35
+ time = NTPUtils(getTimeConnection->getUDP()).getTime();
36
+ }
37
+ return time;
38
}
39
40
ArduinoIoTCloudClass::ArduinoIoTCloudClass() :
0 commit comments