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: C027_Support LM75B M2XStreamClient jsonlite mbed mbed-rtos
Fork of m2x-demo-all by
Revision 8:7ca1b7a712b7, committed 2014-09-07
- Comitter:
- mazgch
- Date:
- Sun Sep 07 01:34:16 2014 +0000
- Parent:
- 7:10d3cc37fe4c
- Child:
- 9:08fdd1036e93
- Commit message:
- publish rssi
Changed in this revision
| C027_Support.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/C027_Support.lib Fri Jun 06 15:20:44 2014 +0000 +++ b/C027_Support.lib Sun Sep 07 01:34:16 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/ublox/code/C027_Support/#3915192f6d7e +http://mbed.org/teams/ublox/code/C027_Support/#18aeacdae391
--- a/main.cpp Fri Jun 06 15:20:44 2014 +0000
+++ b/main.cpp Sun Sep 07 01:34:16 2014 +0000
@@ -24,7 +24,6 @@
char feedId[] = "81b9fcc5a8585c55ae622488f50d8de0"; // Feed you want to post to
char m2xKey[] = "1e1133cd475954868602c0f7503d4f22"; // Your M2X access key
-char streamName[] = "amb_temp"; // Stream you want to post to
char name[] = "<location name>"; // Name of current location of datasource
double latitude = 33.007872;
@@ -57,7 +56,7 @@
int main() {
MDMSerial mdm;
GPSI2C gps;
- //mdm.setDebug(4); // enable this for debugging issues
+ mdm.setDebug(4); // enable this for debugging issues
if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD))
return -1;
@@ -85,21 +84,22 @@
}
}
- if (tmr.read_ms() > 60000) {
+ if (tmr.read_ms() > 10000) {
tmr.reset();
tmr.start();
-
- // read temp
- sprintf(buf, "%0.2f", tmp.read());
+ int response;
- // post temperature
- int response = m2xClient.post(feedId, streamName, buf);
- printf("Post response code: %d\r\n", response);
- if (response == -1) while (true) ;
+ MDMParser::NetStatus status;
+ if (mdm.checkNetStatus(&status)) {
+ sprintf(buf, "%d", status.rssi);
+ response = m2xClient.post(feedId, "rssi", buf);
+ printf("Post response code: %d\r\n", response);
+ if (response == -1) while (true) ;
+ }
//#define READING
#ifdef READING
// read temperature
- response = m2xClient.fetchValues(feedId, streamName, on_data_point_found, NULL);
+ response = m2xClient.fetchValues(feedId, "rssi", on_data_point_found, NULL);
printf("Fetch response code: %d\r\n", response);
if (response == -1) while (true) ;
#endif
