Network Component  Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
NetSNTP: SNTP Client

Events generated by the Network - SNTP Client functions. More...

Functions

__STATIC_INLINE void EvrNetSNTP_InitClient (uint8_t mode)
 Event on SNTP client initialize (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_GetSocketFailed (void)
 Event on SNTP failed to allocate UDP socket (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTime (uint8_t mode)
 Event on netSNTPc_GetTime (API) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimeInvalidParameter (void)
 Event on netSNTPc_GetTime invalid parameter (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimeWrongState (uint8_t state)
 Event on netSNTPc_GetTime wrong client state (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimeOpen (const uint8_t *ip4_addr)
 Event on netSNTPc_GetTime open broadcast receive (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimeClose (void)
 Event on netSNTPc_GetTime close broadcast receive (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimeServerUnknown (const uint8_t *ip4_addr)
 Event on netSNTPc_GetTime unknown server for unicast mode (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimexInvalidParameter (void)
 Event on netSNTPc_GetTimeX invalid parameter (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimexClientBusy (void)
 Event on netSNTPc_GetTimeX client busy (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimexServerNotValid (void)
 Event on netSNTPc_GetTimeX server name not valid (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_GetTimexDnsError (void)
 Event on netSNTPc_GetTimeX host name resolver error (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_SetMode (uint8_t mode)
 Event on netSNTPc_SetMode (API) More...
 
__STATIC_INLINE void EvrNetSNTP_SetModeInvalidParameter (void)
 Event on netSNTPc_SetMode invalid parameter (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_SetModeWrongState (uint8_t state)
 Event on netSNTPc_SetMode wrong client state (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_SendMessage (const uint8_t *ip4_addr)
 Event on SNTP send message to NTP server (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_ServerNotResponding (const uint8_t *ip4_addr)
 Event on SNTP send message timeout (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_ReceiveFrame (const uint8_t *ip4_addr, uint32_t length)
 Event on SNTP receive frame (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_WrongServerPort (uint16_t udp_port)
 Event on SNTP wrong server port (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_FrameTooShort (uint32_t length, uint32_t min_length)
 Event on SNTP receive frame is too short (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_WrongServerAddress (const uint8_t *ip4_addr)
 Event on SNTP wrong NTP server address (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_ModeNotServer (uint8_t mode)
 Event on SNTP message mode not server (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_ModeNotBroadcast (uint8_t mode)
 Event on SNTP message mode not broadcast (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_AnswerInWrongState (uint8_t state)
 Event on SNTP answer received in wrong state (Error) More...
 
__STATIC_INLINE void EvrNetSNTP_ShowTimeStamp (uint32_t ref_time, uint32_t utc_time)
 Event on SNTP display time stamp in seconds (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_TimeStampInvalid (uint32_t ref_time)
 Event on SNTP invalid time stamp (Op) More...
 
__STATIC_INLINE void EvrNetSNTP_UninitClient (void)
 Event on SNTP client de-initialize (Op) More...
 

Description

Events generated by the Network - SNTP Client functions.

The SNTP Client functions generate events that make it easier to troubleshoot errors, and allow the user to understand how the SNTP client works.

Function Documentation

◆ EvrNetSNTP_AnswerInWrongState()

__STATIC_INLINE void EvrNetSNTP_AnswerInWrongState ( uint8_t  state)

Event on SNTP answer received in wrong state (Error)

Parameters
stateclient state
  • 0: idle
  • 1: busy in unicast send
  • 2: open in broadcast receive

The event AnswerInWrongState is created when the network library receives an NTP response in an incompatible SNTP client state. The frame is discarded.

Value in the Event Recorder shows:

  • state: client status.

◆ EvrNetSNTP_FrameTooShort()

__STATIC_INLINE void EvrNetSNTP_FrameTooShort ( uint32_t  length,
uint32_t  min_length 
)

Event on SNTP receive frame is too short (Error)

Parameters
lengthframe length in bytes
min_lengthminimum length of the frame

The event FrameTooShort is created when the network library receives the NTP frame that is too short. The frame is discarded.

Value in the Event Recorder shows:

  • len: length of the received frame in bytes.
  • min: minimum valid frame length in bytes.

◆ EvrNetSNTP_GetSocketFailed()

__STATIC_INLINE void EvrNetSNTP_GetSocketFailed ( void  )

Event on SNTP failed to allocate UDP socket (Error)

The event GetSocketFailed is created when the SNTP client is initialized, that is, when the function netInitialize is executed, and the service could not assign the UDP socket. To resolve this error, you must increase the number of available UDP sockets in the UDP socket configuration.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_GetTime()

__STATIC_INLINE void EvrNetSNTP_GetTime ( uint8_t  mode)

Event on netSNTPc_GetTime (API)

Parameters
modeoperation mode of the client
  • 0: unicast
  • 1: broadcast

The event GetTime is created when the SNTP client starts the time retrieval process. This happens when the netSNTPc_GetTime or netSNTPc_GetTimeX function is executed.

Value in the Event Recorder shows:

  • mode: mode of operation (Unicast,Bcast).

◆ EvrNetSNTP_GetTimeClose()

__STATIC_INLINE void EvrNetSNTP_GetTimeClose ( void  )

Event on netSNTPc_GetTime close broadcast receive (Op)

The event GetTimeClose is created when the SNTP client stops the time retrieving process in broadcast mode.

Value in the Event Recorder shows:

  • stop

◆ EvrNetSNTP_GetTimeInvalidParameter()

__STATIC_INLINE void EvrNetSNTP_GetTimeInvalidParameter ( void  )

Event on netSNTPc_GetTime invalid parameter (Error)

The event GetTimeInvalidParameter is created when the SNTP client can not start the time retrieval process because the netSNTPc_GetTime function is called with an invalid input parameter.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_GetTimeOpen()

__STATIC_INLINE void EvrNetSNTP_GetTimeOpen ( const uint8_t *  ip4_addr)

Event on netSNTPc_GetTime open broadcast receive (Op)

Parameters
ip4_addrpointer to IPv4 address of NTP server

The event GetTimeOpen is created when the SNTP client starts the process of retrieving time in broadcast mode. If the IPv4 address of the server is not specified, the client receives time messages from any NTP server.

Value in the Event Recorder shows:

  • ntp: IPv4 address of the NTP server.

◆ EvrNetSNTP_GetTimeServerUnknown()

__STATIC_INLINE void EvrNetSNTP_GetTimeServerUnknown ( const uint8_t *  ip4_addr)

Event on netSNTPc_GetTime unknown server for unicast mode (Error)

Parameters
ip4_addrpointer to IPv4 address of NTP server

The event GetTimeServerUnknown is created when the SNTP client can not start the time retrieval process in unicast mode because the NTP server address is not specified.

Value in the Event Recorder shows:

  • ntp: IPv4 address of the NTP server.

◆ EvrNetSNTP_GetTimeWrongState()

__STATIC_INLINE void EvrNetSNTP_GetTimeWrongState ( uint8_t  state)

Event on netSNTPc_GetTime wrong client state (Error)

Parameters
stateclient state
  • 0: idle
  • 1: busy in unicast send
  • 2: open in broadcast receive

The event GetTimeWrongState is created when the SNTP client can not start the time retrieval process because the client is busy retrieving a previous request that has not yet completed.

Value in the Event Recorder shows:

  • state: client status (BUSY,OPEN).

◆ EvrNetSNTP_GetTimexClientBusy()

__STATIC_INLINE void EvrNetSNTP_GetTimexClientBusy ( void  )

Event on netSNTPc_GetTimeX client busy (Error)

The event GetTimexClientBusy is created when the SNTP client can not retrieve the time because the SNTP client is busy retrieving a previous request that has not yet completed.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_GetTimexDnsError()

__STATIC_INLINE void EvrNetSNTP_GetTimexDnsError ( void  )

Event on netSNTPc_GetTimeX host name resolver error (Error)

The event GetTimexDnsError is created when the SNTP client can not retrieve the time because the NTP server can not be resolved due to an error in the DNS resolution process. If the error was caused by a DNS server unresponsiveness or a network error, then calling the function netSNTPc_GetTimeX again will correct the error.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_GetTimexInvalidParameter()

__STATIC_INLINE void EvrNetSNTP_GetTimexInvalidParameter ( void  )

Event on netSNTPc_GetTimeX invalid parameter (Error)

The event GetTimexInvalidParameter is created when the SNTP client can not retrieve the time because the netSNTPc_GetTimeX function is called with an invalid input parameter.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_GetTimexServerNotValid()

__STATIC_INLINE void EvrNetSNTP_GetTimexServerNotValid ( void  )

Event on netSNTPc_GetTimeX server name not valid (Error)

The event GetTimexServerNotValid is created when the SNTP client can not retrieve the time because the NTP server name is not valid and the server IP address can not be resolved.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_InitClient()

__STATIC_INLINE void EvrNetSNTP_InitClient ( uint8_t  mode)

Event on SNTP client initialize (Op)

Parameters
modeoperation mode of the client
  • 0: unicast
  • 1: broadcast

The event InitClient is created when the SNTP client is initialized, that is, when the function netInitialize is executed.

Value in the Event Recorder shows:

  • mode: mode of operation (Unicast,Bcast).

◆ EvrNetSNTP_ModeNotBroadcast()

__STATIC_INLINE void EvrNetSNTP_ModeNotBroadcast ( uint8_t  mode)

Event on SNTP message mode not broadcast (Error)

Parameters
modemessage mode
  • 0: reserved
  • 1: symetric active
  • 2: symetric passive
  • 3: client
  • 4: server
  • 5: broadcast
  • 6: reserved
  • 7: reserved

The event ModeNotBroadcast is created when the network library receives the NTP frame and the mode label in the message is not set to broadcast mode. The frame is discarded.

Value in the Event Recorder shows:

  • mode: mode label in the received NTP frame.

◆ EvrNetSNTP_ModeNotServer()

__STATIC_INLINE void EvrNetSNTP_ModeNotServer ( uint8_t  mode)

Event on SNTP message mode not server (Error)

Parameters
modemessage mode
  • 0: reserved
  • 1: symetric active
  • 2: symetric passive
  • 3: client
  • 4: server
  • 5: broadcast
  • 6: reserved
  • 7: reserved

The event ModeNotServer is created when the network library receives the NTP frame and the mode label in the message is not set to server mode. The frame is discarded.

Value in the Event Recorder shows:

  • mode: mode label in the received NTP frame.

◆ EvrNetSNTP_ReceiveFrame()

__STATIC_INLINE void EvrNetSNTP_ReceiveFrame ( const uint8_t *  ip4_addr,
uint32_t  length 
)

Event on SNTP receive frame (Op)

Parameters
ip4_addrpointer to IPv4 address of the server
lengthframe length in bytes

The event ReceiveFrame is created when the network library receives the NTP frame.

Value in the Event Recorder shows:

  • ntp: address of the NTP server sending the message.
  • len: length of the received frame in bytes.

◆ EvrNetSNTP_SendMessage()

__STATIC_INLINE void EvrNetSNTP_SendMessage ( const uint8_t *  ip4_addr)

Event on SNTP send message to NTP server (Op)

Parameters
ip4_addrpointer to IPv4 address of NTP server

The event SendMessage is created when the SNTP client sends a time request message to the NTP server.

Value in the Event Recorder shows:

  • ntp: IPv4 address of the NTP server.

◆ EvrNetSNTP_ServerNotResponding()

__STATIC_INLINE void EvrNetSNTP_ServerNotResponding ( const uint8_t *  ip4_addr)

Event on SNTP send message timeout (Op)

Parameters
ip4_addrpointer to IPv4 address of NTP server

The event ServerNotResponding is created when the SNTP client does not receive a response from the NTP server after retrying the time request.

Value in the Event Recorder shows:

  • ntp: IPv4 address of the NTP server.

◆ EvrNetSNTP_SetMode()

__STATIC_INLINE void EvrNetSNTP_SetMode ( uint8_t  mode)

Event on netSNTPc_SetMode (API)

Parameters
modeoperation mode of the client
  • 0: unicast
  • 1: broadcast

The event SetMode is created when the SNTP client sets the operation mode of the client. This happens when the netSNTPc_SetMode function is executed.

Value in the Event Recorder shows:

  • mode: mode of operation (Unicast,Bcast).

◆ EvrNetSNTP_SetModeInvalidParameter()

__STATIC_INLINE void EvrNetSNTP_SetModeInvalidParameter ( void  )

Event on netSNTPc_SetMode invalid parameter (Error)

The event SetModeInvalidParameter is created when the SNTP client can not set the operation mode because the netSNTPc_SetMode function is called with an invalid input parameter.

Value in the Event Recorder shows:

  • error

◆ EvrNetSNTP_SetModeWrongState()

__STATIC_INLINE void EvrNetSNTP_SetModeWrongState ( uint8_t  state)

Event on netSNTPc_SetMode wrong client state (Error)

Parameters
stateclient state
  • 0: idle
  • 1: busy in unicast send
  • 2: open in broadcast receive

The event SetModeWrongState is created when the SNTP client can not set the operation mode because the client is busy retrieving a previous request that has not yet completed.

Value in the Event Recorder shows:

  • state: client status (BUSY,OPEN).

◆ EvrNetSNTP_ShowTimeStamp()

__STATIC_INLINE void EvrNetSNTP_ShowTimeStamp ( uint32_t  ref_time,
uint32_t  utc_time 
)

Event on SNTP display time stamp in seconds (Op)

Parameters
ref_timereference time (since Jan 1, 1900)
utc_timeutc time (since Jan 1, 1970)

The event ShowTimeStamp is created when the network library wants to display the received NTP time.

Value in the Event Recorder shows:

  • ref: reference time.
  • utc: utc time.

◆ EvrNetSNTP_TimeStampInvalid()

__STATIC_INLINE void EvrNetSNTP_TimeStampInvalid ( uint32_t  ref_time)

Event on SNTP invalid time stamp (Op)

Parameters
ref_timereference time (since Jan 1, 1900)

The event TimeStampInvalid is created when the network library receives an NTP response with a time that is not valid (before Jan 1, 1970).

Value in the Event Recorder shows:

  • ref: invalid reference time.

◆ EvrNetSNTP_UninitClient()

__STATIC_INLINE void EvrNetSNTP_UninitClient ( void  )

Event on SNTP client de-initialize (Op)

The event UninitClient is created when the function netUninitialize is executed.

Value in the Event Recorder shows:

  • sntp

◆ EvrNetSNTP_WrongServerAddress()

__STATIC_INLINE void EvrNetSNTP_WrongServerAddress ( const uint8_t *  ip4_addr)

Event on SNTP wrong NTP server address (Error)

Parameters
ip4_addrpointer to IPv4 address of NTP server

The event WrongServerAddress is created when the network library receives the NTP frame from an invalid NTP server. The frame is discarded.

Value in the Event Recorder shows:

  • ntp: address of the NTP server sending the message.

◆ EvrNetSNTP_WrongServerPort()

__STATIC_INLINE void EvrNetSNTP_WrongServerPort ( uint16_t  udp_port)

Event on SNTP wrong server port (Error)

Parameters
udp_portwrong UDP port number

The event WrongServerPort is created when the network library receives the NTP frame from invalid UDP server source port. The frame is discarded.

Value in the Event Recorder shows:

  • port: UDP source port of the server.