Staging:CC3120 Get Network Time

Overview
This application will demonstrate the usage of getting network time by using the SNTP (Simple Network Time Protocol) protocol.

Application Details
Get time application gives the current time in the configured time zone. This application can be used to get familiar with using UDP sockets to communicate with server.

Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. For more details, please refer to Wikipedia: Network Time Protocol.

Prerequisite

 * 1x CC3120BOOST
 * 1x CC31XXEMUBOOST
 * 1x Micro-USB cable
 * 1x Windows PC with:
 * Visaul Studio Community 2015 (minimum)
 * 1x 2.4GHz AP with internet access

Source Files Details

 * main.c - Application code. Initializes the device in default configuration and performs all application tasks.

Key Simplink API used

 * sl_Socket - creates UDP socket
 * sl_SendTo - sends UDP request to the NTP server
 * sl_Bind - binds UDP socket
 * sl_RecvFrom - receoves time information from the NTP server
 * sl_Close - closes the UDP socket
 * sl_DeviceSet - sets the Simplink system time
 * sl_DeviceGet - gets the Simplink system time

Setting the NTP server
At the top of the main.c file, you may change the NTP server to connect to.

Depending on your current time and time zone, you may change the following fields to reflect the settings. The default time zone being used here is CST.

Example use cses and outputs
Once confirming all the above information to be correct, connect the boards, compile, and run the application. Please refer to CC31xx SimpleLink Studio for setup details.



Limitations/Known Issues
None