Azure IoT / Mbed 2 deprecated remote_monitoring

Dependencies:   azure_c_shared_utility EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed azure_uamqp_c serializer wolfSSL

Revision:
11:2d3ddf2a8d45
Parent:
9:a43d30a74a1b
Child:
13:ec77de4e43c7
--- a/remote_monitoring.c	Wed Sep 23 03:47:29 2015 +0000
+++ b/remote_monitoring.c	Sat Sep 26 00:18:18 2015 -0700
@@ -32,8 +32,9 @@
 
 DECLARE_MODEL(Thermostat,
 
-    /* Event data (proximity sensor value - can have the values 2 or 30) */
+    /* Event data (temperature, external temperature and humidity) */
 	WITH_DATA(double, Temperature),
+	WITH_DATA(double, ExternalTemperature),
 	WITH_DATA(double, Humidity),
 	WITH_DATA(ascii_char_ptr, DeviceId),
 
@@ -88,7 +89,7 @@
     free((void*)buffer);
 }
 
-/*this functiuon "links" IoTHub to the serialization library*/
+/*this function "links" IoTHub to the serialization library*/
 static IOTHUBMESSAGE_DISPOSITION_RESULT IoTHubMessage(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback)
 {
     IOTHUBMESSAGE_DISPOSITION_RESULT result;
@@ -218,6 +219,7 @@
                     }
 
 					thermostat->Temperature = 50.0;
+					thermostat->ExternalTemperature = 55.0;
 					thermostat->Humidity = 50.0;
 					thermostat->DeviceId = (char*)deviceId;
 
@@ -228,7 +230,7 @@
 
 						(void)printf("Sending sensor value Temperature = %02f, Humidity = %02f\r\n", thermostat->Temperature, thermostat->Humidity);
 
-                        if (SERIALIZE(&buffer, &bufferSize, thermostat->Temperature, thermostat->Humidity, thermostat->DeviceId) != IOT_AGENT_OK)
+                        if (SERIALIZE(&buffer, &bufferSize, thermostat->Temperature, thermostat->ExternalTemperature, thermostat->Humidity, thermostat->DeviceId) != IOT_AGENT_OK)
                         {
                             (void)printf("Failed sending sensor value\r\n");
                         }