File nut/pro/sntp.c


Included Files


Preprocessor definitions

#define NUT_THREAD_SNTPSTACK 256

#define NTP_PORT 123

#define SNTP_PORT NTP_PORT


Typedef sntpframe

typedef struct _sntpframe sntpframe
See: Type struct _sntpframe

Type struct _sntpframe

struct _sntpframe
struct _sntpframe  
   {  
      uint8_t mode;  
      uint8_t stratum;  
      uint8_t poll;  
      uint8_t precision;  
      uint32_t root_delay;  
      uint32_t root_dispersion;  
      uint32_t reference_identifier;  
      uint32_t reference_ts_sec;  
      uint32_t reference_ts_frac;  
      uint32_t originate_ts_sec;  
      uint32_t originate_ts_frac;  
      uint32_t receive_ts_sec;  
      uint32_t receive_ts_frac;  
      uint32_t transmit_ts_sec;  
      uint32_t transmit_ts_frac;  
   }  

Type struct SNTP_resync_args

struct SNTP_resync_args
struct SNTP_resync_args  
   {  
      uint32_t server_addr;  
      uint32_t interval;  
   }  

Global Function NutSNTPGetTime()

int NutSNTPGetTime ( uint32_t* server_adr, time_t* t )
Prototyped in: nut/include/pro/sntp.h
Calls: NutUdpCreateSocket() nut/net/udpsock.c
  NutUdpDestroySocket() nut/net/udpsock.c
  NutUdpReceiveFrom() nut/net/udpsock.c
  NutUdpSendTo() nut/net/udpsock.c
  NutUdpSetSockOpt() nut/net/udpsock.c
  __byte_swap4() nut/boot/appload/utils.c
  free() nut/crt/malloc.c
  calloc()
Called by: NutAppMain() nut/app/tls_client/tls_client.c
  QueryDateAndTime() nut/app/pppc/pppc.c
  QueryTimeServer() nut/app/ftpd/ftpserv.c
  SNTP_resync() nut/pro/sntp.c

Global Function NutSNTPStartThread()

int NutSNTPStartThread ( uint32_t server_addr, uint32_t interval )
Prototyped in: nut/include/pro/sntp.h
Calls: NutThreadCreate() nut/arch/cm3/os/context.c
  free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
References Functions: SNTP_resync() nut/pro/sntp.c

Global Function SNTP_resync()

void SNTP_resync ( void* arg )
Prototyped in: nut/pro/sntp.c
Calls: NutSNTPGetTime() nut/pro/sntp.c
  NutSleep() nut/os/timer.c
  NutThreadSetPriority() nut/os/thread.c
  free() nut/crt/malloc.c
  stime() nut/crt/time.c
Used in: NutSNTPStartThread() nut/pro/sntp.c