fork from simple sample of mqtt

Dependencies:   azure_c_shared_utility azure_umqtt_c iothub_client iothub_mqtt_transport serializer wolfSSL

Fork of simplesample_mqtt by Azure IoT

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)