|
|
@ -14,7 +14,7 @@ XD0OTA::XD0OTA(String deviceName) : deviceName{deviceName} {} |
|
|
|
|
|
|
|
// Set time via NTP, as required for x.509 validation
|
|
|
|
void XD0OTA::setClock() { |
|
|
|
configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC
|
|
|
|
configTime(0, 0, "de.pool.ntp.org", "time.nist.gov"); // UTC
|
|
|
|
|
|
|
|
Serial.print(F("Waiting for NTP time sync: ")); |
|
|
|
time_t now = time(nullptr); |
|
|
@ -33,6 +33,10 @@ void XD0OTA::setClock() { |
|
|
|
gmtime_r(&now, &timeinfo); |
|
|
|
Serial.print(F("Current time: ")); |
|
|
|
Serial.print(asctime(&timeinfo)); |
|
|
|
|
|
|
|
// setenv("TZ", "CET-1CEST,M3.5.0/2,M10.5.0/3", 1);
|
|
|
|
// tzset();
|
|
|
|
// localtime_r(&now, &timeinfo);
|
|
|
|
} |
|
|
|
|
|
|
|
String XD0OTA::getMAC() { |
|
|
|