rawSEconds
This commit is contained in:
@ -139,7 +139,13 @@ 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 = ntohl((localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff) - UNIX_NTP_EPOCH_DIFF;
|
||||
uint32_t xmtTopHalf = (localHandle->ntpMsg.xmt >> 32) & 0x0ffffffff;
|
||||
uint32_t rawSeconds =
|
||||
(xmtTopHalf & 0x0000000ff) << 24 |
|
||||
(xmtTopHalf & 0x00000ff00) << 8 |
|
||||
(xmtTopHalf & 0x000ff0000) >> 8 |
|
||||
(xmtTopHalf & 0x0ff000000) >> 24;
|
||||
localHandle->seconds = rawSeconds - UNIX_NTP_EPOCH_DIFF;
|
||||
coloredMsg(LOG_BLUE, "nes, seconds: %lu", localHandle->seconds);
|
||||
localHandle->sntpState = SNTP_STATE_DONE;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user