A simple IoTHub sample using MQTT as transport

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed wolfSSL azure_c_shared_utility iothub_client azure_umqtt_c iothub_mqtt_transport serializer

Revision:
6:55659b146374
Parent:
5:09ddfa234c6e
Child:
9:db94158204f8
--- a/simplesample_mqtt.c	Mon Mar 28 11:07:25 2016 -0700
+++ b/simplesample_mqtt.c	Tue Mar 29 17:30:02 2016 +0000
@@ -16,6 +16,10 @@
 #include "iothubtransportmqtt.h"
 #include "threadapi.h"
 #include "platform.h"
+#ifdef MBED_BUILD_TIMESTAMP
+#include "certs.h"
+#endif // MBED_BUILD_TIMESTAMP
+
 
 /*String containing Hostname, Device Id & Device Key in the format:             */
 /*  "HostName=<host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>"    */
@@ -149,6 +153,14 @@
             }
             else
             {
+#ifdef MBED_BUILD_TIMESTAMP
+                // For mbed add the certificate information
+                if (IoTHubClient_LL_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK)
+                {
+                    (void)printf("failure to set option \"TrustedCerts\"\r\n");
+                }
+#endif // MBED_BUILD_TIMESTAMP
+                
 
                 ContosoAnemometer* myWeather = CREATE_MODEL_INSTANCE(WeatherStation, ContosoAnemometer);
                 if (myWeather == NULL)