mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
make NTP arduino3 ready
This commit is contained in:
@@ -36,7 +36,7 @@ void NTPStatus::ntpStatus(AsyncWebServerRequest * request) {
|
||||
time_t now = time(nullptr);
|
||||
|
||||
// only provide enabled/disabled status for now
|
||||
root["status"] = sntp_enabled() ? emsesp::EMSESP::system_.ntp_connected() ? 2 : 1 : 0;
|
||||
root["status"] = esp_sntp_enabled() ? emsesp::EMSESP::system_.ntp_connected() ? 2 : 1 : 0;
|
||||
|
||||
// the current time in UTC
|
||||
root["utc_time"] = toUTCTimeString(gmtime(&now));
|
||||
@@ -45,7 +45,7 @@ void NTPStatus::ntpStatus(AsyncWebServerRequest * request) {
|
||||
root["local_time"] = toLocalTimeString(localtime(&now));
|
||||
|
||||
// the sntp server name
|
||||
root["server"] = sntp_getservername(0);
|
||||
root["server"] = esp_sntp_getservername(0);
|
||||
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
|
||||
Reference in New Issue
Block a user