From d08fab14fa84e443f1536e2696888c52220e0c7d Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 28 Feb 2021 21:28:10 +0100 Subject: [PATCH] test --- cube/User/Src/networkAbstractionLayer_lan.c | 36 +++++++++------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/cube/User/Src/networkAbstractionLayer_lan.c b/cube/User/Src/networkAbstractionLayer_lan.c index d7becae..3614c41 100644 --- a/cube/User/Src/networkAbstractionLayer_lan.c +++ b/cube/User/Src/networkAbstractionLayer_lan.c @@ -113,28 +113,24 @@ void networkSntpEngine(void *handle) { sizeof(localHandle->ntpMsg), srcAddr, &srcPort); */ uint8_t buf[90]; + memset(buf, 0, sizeof(buf)); recvfrom(SNTP_SOCK, buf, sizeof(buf), srcAddr, &srcPort); uint8_t x = 0; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); - x += 8; - coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x", - buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7]); + coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", + buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7], + buf[x+8], buf[x+9], buf[x+10], buf[x+11], buf[x+12], buf[x+13], buf[x+14], buf[x+15]); + x += 16; + coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", + buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7], + buf[x+8], buf[x+9], buf[x+10], buf[x+11], buf[x+12], buf[x+13], buf[x+14], buf[x+15]); + x += 16; + coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", + buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7], + buf[x+8], buf[x+9], buf[x+10], buf[x+11], buf[x+12], buf[x+13], buf[x+14], buf[x+15]); + x += 16; + coloredMsg(LOG_BLUE, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", + buf[x+0], buf[x+1], buf[x+2], buf[x+3], buf[x+4], buf[x+5], buf[x+6], buf[x+7], + buf[x+8], buf[x+9], buf[x+10], buf[x+11], buf[x+12], buf[x+13], buf[x+14], buf[x+15]); close(SNTP_SOCK); coloredMsg(LOG_BLUE, "nes, msg received from %d.%d.%d.%d:%d",