6

Click here to load reader

SNTP Simple 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

Embed Size (px)

Citation preview

Page 1: SNTP Simple 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

SNTPSimple Network Time Protocol

Page 2: SNTP Simple 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

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().

Page 3: SNTP Simple 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

Simple Network Time Protocol(SNTP)

• APIs– NAinstallSntpTime– NAinstallTimeZone– NArestartSntpServer– NAgetSntpTime

Page 4: SNTP Simple 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

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

Page 5: SNTP Simple 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

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

Page 6: SNTP Simple 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

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)