Paolo Patierno / Mbed 2 deprecated sht15_remote_monitoring

Dependencies:   EthernetInterface NTPClient SHTx iothub_amqp_transport iothub_client mbed-rtos mbed proton-c-mbed serializer wolfSSL

Fork of remote_monitoring by Azure IoT

Files at this revision

API Documentation at this revision

Comitter:
AzureIoTClient
Date:
Sat Sep 26 00:18:18 2015 -0700
Parent:
10:294858b1ab48
Child:
12:42aecf7d2472
Commit message:
v1.0.0-preview.3

Changed in this revision

remote_monitoring.c Show annotated file Show diff for this revision Revisions of this file
--- 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");
                         }