name
This commit is contained in:
parent
a5f20fc073
commit
be279e4421
@ -137,14 +137,20 @@ static void wizSNTPHandler(void *handle) {
|
|||||||
|
|
||||||
if (networkAvailable) {
|
if (networkAvailable) {
|
||||||
coloredMsg(LOG_BLUE, "wizsh, about to call SNTP");
|
coloredMsg(LOG_BLUE, "wizsh, about to call SNTP");
|
||||||
int8_t res = SNTP_run(&curTime);
|
uint8_t ntpServer[4];
|
||||||
coloredMsg(LOG_BLUE, "wizsh, res: %d", res);
|
if (wizDnsQuery(NTP_SERVER, &ntpServer)) {
|
||||||
if (res == 1) {
|
SNTP_init(SNTP_SOCK, NTP_SERVER, 0, sntpBuffer);
|
||||||
coloredMsg(LOG_BLUE, "wizsh, curTime: %04d-%02d-%02d %02d:%02d:%02d",
|
int8_t res = SNTP_run(&curTime);
|
||||||
curTime.yy, curTime.mo, curTime.dd,
|
coloredMsg(LOG_BLUE, "wizsh, res: %d", res);
|
||||||
curTime.hh, curTime.mm, curTime.ss);
|
if (res == 1) {
|
||||||
|
coloredMsg(LOG_BLUE, "wizsh, curTime: %04d-%02d-%02d %02d:%02d:%02d",
|
||||||
|
curTime.yy, curTime.mo, curTime.dd,
|
||||||
|
curTime.hh, curTime.mm, curTime.ss);
|
||||||
|
} else {
|
||||||
|
coloredMsg(LOG_BLUE, "wizsh, error when requesting time");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
coloredMsg(LOG_BLUE, "wizsh, error when requesting time");
|
coloredMsg(LOG_BLUE, "wizsh, error when querying ntp server name");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -179,7 +185,6 @@ static void wizPhyLinkHandler(void *handle) {
|
|||||||
dhcpInitialized = true;
|
dhcpInitialized = true;
|
||||||
|
|
||||||
|
|
||||||
SNTP_init(SNTP_SOCK, NTP_SERVER, 0, sntpBuffer);
|
|
||||||
schAdd(wizSNTPHandler, NULL, 0, 60*1000);
|
schAdd(wizSNTPHandler, NULL, 0, 60*1000);
|
||||||
coloredMsg(LOG_BLUE, "wizplh, SNTP handler scheduled");
|
coloredMsg(LOG_BLUE, "wizplh, SNTP handler scheduled");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user