GDP group 24 node core
Dependencies: EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue
Revision 28:9c8d472c44b7, committed 2015-01-28
- Comitter:
- Trumple
- Date:
- Wed Jan 28 20:52:44 2015 +0000
- Parent:
- 27:61e67ab47da5
- Child:
- 29:564b1eaf5b99
- Commit message:
- Change field ID to XBee MAC address of base node
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Jan 28 20:40:15 2015 +0000
+++ b/main.cpp Wed Jan 28 20:52:44 2015 +0000
@@ -11,9 +11,7 @@
time_t lastPollTime = 0;
time_t pollInterval = 30;
-
bool isBasenode = false;
-string fieldID = "testfield";
http h = http();
sensorinterface* sif;
@@ -80,7 +78,7 @@
#ifdef DEBUG
pc.printf( ("[MAIN] POSTing startup information: " + j.serialize() + "\r\n").c_str() );
#endif
- h.post("178.62.84.55", 8888, "/field/" + fieldID + "/" + address + "/startup/", j.serialize()).c_str();
+ h.post("178.62.84.55", 8888, "/field/" + string(localAddress) + "/" + address + "/startup/", j.serialize()).c_str();
snail::joinnetworkreply reply(request.source, time(NULL), localAddress);
xbee.send(reply, sizeof(reply));
@@ -105,7 +103,7 @@
pc.printf( ("[MAIN] POSTing sensor reading: " + j.serialize() + "\r\n").c_str() );
#endif
- h.post("178.62.84.55", 8888, "/field/" + fieldID + "/" + addressToString(d.source) + "/" + sensorID + "/", j.serialize()).c_str();
+ h.post("178.62.84.55", 8888, "/field/" + string(localAddress) + "/" + addressToString(d.source) + "/" + sensorID + "/", j.serialize()).c_str();
}
void handleNetworkParametersTimeout()
