TCPIP_SNTP_TimeStampGet Function
C
TCPIP_SNTP_RESULT TCPIP_SNTP_TimeStampGet(
TCPIP_SNTP_TIME_STAMP* pTStamp,
uint32_t* pLastUpdate
);
Description
This function gets the last valid timestamp obtained from a NTP server.
Preconditions
The TCP/IP Stack should have been initialized.
Parameters
Parameters | Description |
---|---|
pTStamp | Pointer to a 64-bit buffer to store the last NTP timestamp. Could be NULL if the timestamp is not needed. |
pLastUpdate | Pointer to store the last timestamp. Update tick could be NULL if the update time is not needed. |
Returns
SNTP_RES_OK - If the call succeeded.
SNTP_RES_TSTAMP_STALE error code - If there is no recent timestamp.
SNTP_RES_TSTAMP_ERROR error code - If there is no available timestamp.
Remarks
The timestamp is returned in host order (Little Endian) with the most significant 32 bits representing seconds and the least significant 32 bits representing fraction of seconds (seconds/2^32).