From 681c5d86951ed058980412d863cb1cf72322a392 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 28 Feb 2021 22:06:17 +0100 Subject: [PATCH] ntoh --- cube/User/Src/networkAbstractionLayer_lan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cube/User/Src/networkAbstractionLayer_lan.c b/cube/User/Src/networkAbstractionLayer_lan.c index fc1ff8e..a06cef9 100644 --- a/cube/User/Src/networkAbstractionLayer_lan.c +++ b/cube/User/Src/networkAbstractionLayer_lan.c @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -138,7 +139,7 @@ void networkSntpEngine(void *handle) { srcAddr[0], srcAddr[1], srcAddr[2], srcAddr[3], srcPort); coloredMsg(LOG_BLUE, "nes, received in the %d. cycles", localHandle->retryCount); - localHandle->seconds = ((localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff) - UNIX_NTP_EPOCH_DIFF; + localHandle->seconds = ntohl((localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff) - UNIX_NTP_EPOCH_DIFF; coloredMsg(LOG_BLUE, "nes, seconds: %lu", localHandle->seconds); localHandle->sntpState = SNTP_STATE_DONE; } else {