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
Diff: program.cpp
- Revision:
- 31:912c140ee050
- Parent:
- 26:26e9899e2cbe
- Child:
- 32:56804dd00193
--- 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");