Constants defined in the coreSNTP library. More...
Macros | |
#define | SNTP_DEFAULT_SERVER_PORT ( 123U ) |
The default UDP port supported by SNTP/NTP servers for client-server communication. More... | |
#define | SNTP_PACKET_BASE_SIZE ( 48U ) |
The base packet size of request and response of the (S)NTP protocol. More... | |
#define | SNTP_FRACTION_VALUE_PER_MICROSECOND ( 4295U ) |
Number of SNTP timestamp fractions in 1 microsecond. More... | |
#define | SNTP_TIME_AT_UNIX_EPOCH_SECS ( 2208988800U ) |
The seconds part of SNTP time at the UNIX epoch time, which represents an offset of 70 years (in seconds) between SNTP epoch and UNIX epoch time. SNTP uses 1st Jan 1900 UTC as the epoch time, whereas UNIX standard uses 1st Jan 1970 UTC as the epoch time, thereby, causing an offset of 70 years between them. More... | |
#define | SNTP_TIME_AT_LARGEST_UNIX_TIME_SECS ( 61505151U ) |
The seconds value of SNTP timestamp for the largest UNIX time when using signed 32-bit integer for seconds. The largest time representable with a 32-bit signed integer in UNIX time is 19 Jan 2038 3h 14m 7s UTC. However, as the SNTP time overflows at 7 Feb 2036 6h 28m 16s UTC, therefore, the SNTP time for the largest UNIX time represents the time duration between the 2 timestamps. More... | |
#define | UNIX_TIME_SECS_AT_SNTP_ERA_1_SMALLEST_TIME ( 2085978496U ) |
The UNIX time (in seconds) at the smallest SNTP time in era 1, i.e. UNIX time at 7 Feb 2036 6:28:16 UTC/. More... | |
#define | SNTP_KISS_OF_DEATH_CODE_LENGTH ( 4U ) |
The fixed-length of any Kiss-o'-Death message ASCII code sent in an SNTP server response. More... | |
#define | SNTP_KISS_OF_DEATH_CODE_NONE ( 0U ) |
The value for the SntpResponseData_t.rejectedResponseCode member when that the server response packet does not contain a Kiss-o'-Death message, and therefore, does not have a "kiss code". The server sends a "kiss-code" only when it rejects an SNTP request with a Kiss-o'-Death message. | |
Constants defined in the coreSNTP library.
#define SNTP_DEFAULT_SERVER_PORT ( 123U ) |
The default UDP port supported by SNTP/NTP servers for client-server communication.
#define SNTP_PACKET_BASE_SIZE ( 48U ) |
The base packet size of request and response of the (S)NTP protocol.
#define SNTP_FRACTION_VALUE_PER_MICROSECOND ( 4295U ) |
Number of SNTP timestamp fractions in 1 microsecond.
The fraction's part of an SNTP timestamp is 32-bits wide, thereby, giving a resolution of 2^(-32) seconds ~ 232 picoseconds.
#define SNTP_TIME_AT_UNIX_EPOCH_SECS ( 2208988800U ) |
The seconds part of SNTP time at the UNIX epoch time, which represents an offset of 70 years (in seconds) between SNTP epoch and UNIX epoch time. SNTP uses 1st Jan 1900 UTC as the epoch time, whereas UNIX standard uses 1st Jan 1970 UTC as the epoch time, thereby, causing an offset of 70 years between them.
Difference of 70 years = ((70 * 365) + 17 leap days) * 24 * 3600 seconds
#define SNTP_TIME_AT_LARGEST_UNIX_TIME_SECS ( 61505151U ) |
The seconds value of SNTP timestamp for the largest UNIX time when using signed 32-bit integer for seconds. The largest time representable with a 32-bit signed integer in UNIX time is 19 Jan 2038 3h 14m 7s UTC. However, as the SNTP time overflows at 7 Feb 2036 6h 28m 16s UTC, therefore, the SNTP time for the largest UNIX time represents the time duration between the 2 timestamps.
SNTP Time at Largest Time Duration in the range Signed 32-bit UNIX time = [7 Feb 2036 6:28:16, 19 Jan 2038 3:14:07]
#define UNIX_TIME_SECS_AT_SNTP_ERA_1_SMALLEST_TIME ( 2085978496U ) |
The UNIX time (in seconds) at the smallest SNTP time in era 1, i.e. UNIX time at 7 Feb 2036 6:28:16 UTC/.
Time Duration = 7 Feb 6:28:16 UTC (SNTP Era 1 Epoch) - 1 Jan 1970 0:0:0 UTC (UNIX epoch) = 66 years, 37 days, 6 hours, 28 minutes and 16 seconds = ((66 * 365) + 16 leap days) * 24 * 3600) + (6 * 3600)
#define SNTP_KISS_OF_DEATH_CODE_LENGTH ( 4U ) |
The fixed-length of any Kiss-o'-Death message ASCII code sent in an SNTP server response.