sntp simple network time protocol. simple network time protocol (sntp) get accurate date and time...
TRANSCRIPT
SNTPSimple Network Time Protocol
Simple Network Time Protocol(SNTP)
• Get accurate date and time from SNTP server– i.e. 131.215.254.2
• Make Standard Time functions (ANSI C) to return accurate date and time– i.e. time() or localtime().
Simple Network Time Protocol(SNTP)
• APIs– NAinstallSntpTime– NAinstallTimeZone– NArestartSntpServer– NAgetSntpTime
Simple Network Time Protocol(SNTP)
• NAinstallSntpTime– Establish SNTP server connection– Start SNTP (run as a separate thread)– Setup SNTP for standard time functions
• User’s Callback– Used to notify user the SNTP status.– i.e. Time is successfully (unsuccessfully)
updated or obtained
Simple Network Time Protocol(SNTP)
• NAinstallTimeZone– Setup local time zone relative to GMT
• NArestartSntpServer– Restart SNTP with different NTP servers– It should be called in user’s callback function
Simple Network Time Protocol(SNTP)
• Define APP_USE_NETWORK_TIME in appconf.h to include SNTP in BSP– BSP will setup SNTP and time zone– SNTP server address & time zone are stored in NVRAM
• USA Eastern Standard Time is default time zone
• 5 hour is default time to re-synchronize SNTP server– Once time is obtained from SNTP server, use system clock (ticks)