Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Revision:
82:ca7430f50b2b
Parent:
81:4a7761914901
Child:
83:3c8ceb12b773
--- a/MbedAgent.cpp	Wed Mar 04 14:02:39 2015 +0000
+++ b/MbedAgent.cpp	Fri Mar 06 10:38:03 2015 +0000
@@ -12,13 +12,14 @@
     _client(MBED_AGENT_HOST, MBED_AGENT_PORT, MBED_AGENT_DEVICE_IDENTIFIER, mdm),
     _bootstrap(_client, _io, _deviceInfo, _deviceMemory),
     _integration(_client, _tpl, _deviceId, _deviceInfo),
+    _displayInfo(),
     _configurationSynchronization(_client, _tpl, _deviceId, _deviceMemory, _deviceConfiguration, _configurationProperties),
-    _signalQualityMeasurement(_client, _tpl, _deviceId, _deviceInfo, io, _bootstrap),
-    _temperatureMeasurement(_client, _tpl, _deviceId, _io.temperatureSensor(), io, deviceInfo, _bootstrap),
-    _accelerationMeasurement(_client, _tpl, _deviceId, _io.accelerometer(), io, deviceInfo, _bootstrap),
-    _analogMeasurement(_client, _tpl, _deviceId, _io.analog1(), _io.analog2(), io, deviceInfo, _bootstrap),
-    _locationUpdate(_client, _tpl, _deviceId, _io.gpsTracker(), io, deviceInfo, _bootstrap),
-    _operationSupport(_client, _tpl, _deviceId, _configurationSynchronization, _io),
+    _signalQualityMeasurement(_client, _tpl, _deviceId, _deviceInfo, io, _displayInfo),
+    _temperatureMeasurement(_client, _tpl, _deviceId, _io.temperatureSensor(), io, deviceInfo, _displayInfo),
+    _accelerationMeasurement(_client, _tpl, _deviceId, _io.accelerometer(), io, deviceInfo, _displayInfo),
+    _analogMeasurement(_client, _tpl, _deviceId, _io.analog1(), _io.analog2(), io, deviceInfo, _displayInfo),
+    _locationUpdate(_client, _tpl, _deviceId, _io.gpsTracker(), io, deviceInfo, _displayInfo),
+    _operationSupport(_client, _tpl, _deviceId, _configurationSynchronization, _io, _displayInfo),
     _deviceId(0)
 {
 }
@@ -82,6 +83,12 @@
     snprintf(status, sizeof(status), "ID: %ld", _deviceId);
     _io.lcdPrint("Connected", status);
 
+    char tenant[25];
+    const char* user= _bootstrap.username();
+    int len = strchr(user, '/')-user+1+8;  // 8: length of "Tenant: "
+    len = len <= 25 ? len : 25;
+    snprintf(tenant, len, "Tenant: %s", user);
+    _displayInfo.setFirstLine(tenant);
     loop();
 
     return true;