Official reference client implementation for Cumulocity SmartREST on u-blox C027.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Revision 31:912c140ee050, committed 2014-05-26
- Comitter:
- vwochnik
- Date:
- Mon May 26 08:26:01 2014 +0000
- Parent:
- 30:daa499571db7
- Child:
- 32:56804dd00193
- Commit message:
- prepare for device bootstrap
Changed in this revision
MbedSmartRest.lib | Show annotated file Show diff for this revision Revisions of this file |
program.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MbedSmartRest.lib Mon May 26 08:12:14 2014 +0000 +++ b/MbedSmartRest.lib Mon May 26 08:26:01 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/vwochnik/code/MbedSmartRestStreaming/#57dd24cb6620 +http://mbed.org/users/vwochnik/code/MbedSmartRestStreaming/#f76f9ae79195
--- a/program.cpp Mon May 26 08:12:14 2014 +0000 +++ b/program.cpp Mon May 26 08:26:01 2014 +0000 @@ -17,6 +17,11 @@ void analogMeasurement(long deviceId, Aggregator& aggr); void motionMeasurement(long deviceId, Aggregator& aggr); +char cUsername[48]; +char cPassword[48]; +char cDeviceIdentifier[48]; + +const char *srtplIdentifier = "com_u-blox_C027_REV-A_0.10_Test1233123"; StaticData srtpl( // get device by identity // Usage: 100,<SERIAL/NR> @@ -51,13 +56,20 @@ ); float interval = 120.0; // send measurements every two minutes -MbedSmartRest client("developer.cumulocity.com", 80, "vaillant/admin", "klanpi", "com_u-blox_C027_REV-A_0.10_Test1233123"); + +MbedSmartRest client("developer.cumulocity.com", 80, cUsername, cPassword, cDeviceIdentifier); int program(void) { long deviceId = 0; Timer timer; - lcd_tenant("vaillant"); + // copy credentials and identifier into fields + //TODO: implement bootstrap process + strcpy(cUsername, "vaillant/admin"); + strcpy(cPassword, "klanpi"); + strcpy(cDeviceIdentifier, srtplIdentifier); + + lcd_tenant(cUsername); puts("Hello!"); puts("Bootstrapping");