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: EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue
Diff: main.cpp
- Revision:
- 27:61e67ab47da5
- Parent:
- 26:172b585fbb10
- Child:
- 28:9c8d472c44b7
diff -r 172b585fbb10 -r 61e67ab47da5 main.cpp
--- a/main.cpp Wed Jan 28 20:22:48 2015 +0000
+++ b/main.cpp Wed Jan 28 20:40:15 2015 +0000
@@ -238,12 +238,14 @@
pc.printf("\r\n");
#endif
sdcard sd = sdcard();
+ h.connect();
//commissioning button
commissioningInput.fall(commissioningFall);
commissioningInput.rise(commissioningRise);
//check if local node is basenode
+ isBasenode = h.isEthernetConnected();
#ifdef DEBUG
pc.printf("[MAIN] Basenode status: %i\r\n", isBasenode);
#endif
@@ -251,9 +253,7 @@
getLocalAddress();
if (isBasenode)
- {
- h.connect();
-
+ {
string timestampStr = h.get("time.bitnode.co.uk", 80, "/");
time_t timestamp = atoi(timestampStr.c_str());
