coreSNTP v1.1.0
Client library for synchronizing device time with internet time using Simple Network Time Protocol (SNTP)
Enumerated Types

Enumerated types of the coreSNTP library. More...

Enumerations

enum  SntpStatus_t {
  SntpSuccess , SntpErrorBadParameter , SntpRejectedResponse , SntpRejectedResponseChangeServer ,
  SntpRejectedResponseRetryWithBackoff , SntpRejectedResponseOtherCode , SntpErrorBufferTooSmall , SntpInvalidResponse ,
  SntpZeroPollInterval , SntpErrorTimeNotSupported , SntpErrorDnsFailure , SntpErrorNetworkFailure ,
  SntpServerNotAuthenticated , SntpErrorAuthFailure , SntpErrorSendTimeout , SntpErrorResponseTimeout ,
  SntpNoResponseReceived , SntpErrorContextNotInitialized
}
 Enumeration of status codes that can be returned by the coreSNTP Library API. More...
 
enum  SntpLeapSecondInfo_t { NoLeapSecond = 0x00 , LastMinuteHas61Seconds = 0x01 , LastMinuteHas59Seconds = 0x02 , AlarmServerNotSynchronized = 0x03 }
 Enumeration for leap second information that an SNTP server can send its response to a time request. An SNTP server sends information about whether there is an upcoming leap second adjustment in the last day of the current month. More...
 

Detailed Description

Enumerated types of the coreSNTP library.

Enumeration Type Documentation

◆ SntpStatus_t

Enumeration of status codes that can be returned by the coreSNTP Library API.

Enumerator
SntpSuccess 

Successful operation of an SNTP API.

SntpErrorBadParameter 

Invalid parameter passed to an API function.

SntpRejectedResponse 

Server sent a Kiss-o'-Death message to reject the request for time. This status can be returned by the Sntp_ReceiveTimeResponse API.

SntpRejectedResponseChangeServer 

Server sent a Kiss-o'-Death message with non-retryable code (i.e. DENY or RSTR).

SntpRejectedResponseRetryWithBackoff 

Server sent a Kiss-o'-Death message with a RATE code, which means that client should back-off before retrying.

SntpRejectedResponseOtherCode 

Server sent a Kiss-o'-Death message with a code, specific to the server. Application can inspect the ASCII kiss-code from Sntp_DeserializeResponse API.

SntpErrorBufferTooSmall 

Application provided insufficient buffer space for serializing or de-serializing an SNTP packet. The minimum size of an SNTP packet is SNTP_PACKET_BASE_SIZE bytes.

SntpInvalidResponse 

Server response failed validation checks for expected data in SNTP packet.

SntpZeroPollInterval 

Poll interval value is under 1 second which cannot be calculated by Sntp_CalculatePollInterval.

SntpErrorTimeNotSupported 

SNTP timestamp cannot be converted to UNIX time as time does not lie in time range supported by Sntp_ConvertToUnixTime.

SntpErrorDnsFailure 

The user-defined DNS resolution interface, SntpResolveDns_t, failed to resolve address for a time server. This status is returned by the Sntp_SendTimeRequest API.

SntpErrorNetworkFailure 

Networking operation of sending or receiving SNTP packet through the user-defined UDP transport interface, UdpTransportInterface_t, failed. This status is returned by either of Sntp_SendTimeRequest OR Sntp_ReceiveTimeResponse APIs.

SntpServerNotAuthenticated 

Time server is not authenticated from the authentication data in its response. This status can be returned by the user-supplied definition of the SntpValidateServerAuth_t authentication interface.

SntpErrorAuthFailure 

Failure from the user-supplied authentication interface, SntpAuthenticationInterface_t, in either generating authentication data for SNTP request OR validating the authentication data in SNTP response from server.

SntpErrorSendTimeout 

A timeout occurred in sending time request packet over the network to a server through the Sntp_SendTimeRequest API.

SntpErrorResponseTimeout 

A timeout has occurred in receiving server response with the Sntp_ReceiveTimeResponse API.

SntpNoResponseReceived 

No SNTP packet for server response is received from the network by the Sntp_ReceiveTimeResponse API.

SntpErrorContextNotInitialized 

The SNTP context passed to Sntp_SendTimeRequest or Sntp_ReceiveTimeResponse APIs is is uninitialized.

◆ SntpLeapSecondInfo_t

Enumeration for leap second information that an SNTP server can send its response to a time request. An SNTP server sends information about whether there is an upcoming leap second adjustment in the last day of the current month.

Note
A leap second is an adjustment made in atomic clock time because Earth's rotation can be inconsistent. Leap seconds are usually incorporated as an extra second insertion or second deletion in the last minute before midnight i.e. in the minute of 23h:59m UTC on the last day of June or December. For more information on leap seconds, refer to https://www.nist.gov/pml/time-and-frequency-division/leap-seconds-faqs.
Enumerator
LastMinuteHas61Seconds 

There is no upcoming leap second adjustment.

<

LastMinuteHas59Seconds 

A leap second should be inserted in the last minute before midnight.

<

AlarmServerNotSynchronized 

A leap second should be deleted from the last minute before midnight.

<