Example program to connect to the internet via Ublox Cellular Shield and post MEMS sensor readings to M2X.
Dependencies: C027_Support M2XStreamClient Nucleo_Sensor_Shield jsonlite mbed-rtos mbed
Fork of Cellular_m2x-demo-all by
Diff: main.cpp
- Revision:
- 6:7a1e717a0d1e
- Parent:
- 5:df776765d890
- Child:
- 7:10d3cc37fe4c
--- a/main.cpp Thu Jun 05 09:13:43 2014 +0000 +++ b/main.cpp Thu Jun 05 11:26:57 2014 +0000 @@ -96,23 +96,25 @@ int response = m2xClient.post(feedId, streamName, 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); printf("Fetch response code: %d\r\n", response); if (response == -1) while (true) ; - +#endif // update location if (location_valid) { response = m2xClient.updateLocation(feedId, name, latitude, longitude, elevation); printf("updateLocation response code: %d\r\n", response); if (response == -1) while (true) ; } - +#ifdef READING // read location response = m2xClient.readLocation(feedId, on_location_found, NULL); printf("readLocation response code: %d\r\n", response); if (response == -1) while (true) ; +#endif } else { delay(100);