NTP client app setting system time and X-NUCLEO-IDW01M1 Wi-Fi board time connecting to internet NTP UTC time server.
Dependencies: NTPClient NetworkSocketAPI X_NUCLEO_IDW01M1v2 mbed
Fork of NTPClient_HelloWorld by
Example of retrieval of current time using an NTP server.
Time is then used to perform a TLS secure connection to https://mbed.org.
The application is meant to be used with mbed OS 2 ("Classic") only (no mbedOS 5 support).
Diff: main.cpp
- Revision:
- 9:c710dd7a4242
- Parent:
- 7:a33ce4fe1b91
--- a/main.cpp Wed Jan 11 09:20:45 2017 +0000 +++ b/main.cpp Fri Jan 13 15:39:45 2017 +0000 @@ -35,6 +35,7 @@ printf ("\n\rConnecting to WiFi ...\n\r"); spwf.connect("STM","STMDemo", NSAPI_SECURITY_WPA2); + NTPClient ntp(spwf); printf("Initial System Time is: %s\r\n", ctime(&ctTime));