Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
diff -r 20949c0e7b72 -r c710dd7a4242 main.cpp
--- 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));
