![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A simple IoTHub sample using HTTP as transport
Dependencies: EthernetInterface NTPClient iothub_client iothub_http_transport mbed-rtos mbed wolfSSL serializer azure_c_shared_utility
This sample showcases the usage of Azure IoT client libraries with the HTTP transport for sending/receiving raw messages from an IoT Hub.
Diff: simplesample_http.c
- Revision:
- 73:124496f755ab
- Parent:
- 64:0cdbc7c1cecc
- Child:
- 78:4b96969617b3
diff -r f8c9299f7c5b -r 124496f755ab simplesample_http.c --- a/simplesample_http.c Fri Aug 25 11:26:02 2017 -0700 +++ b/simplesample_http.c Mon Sep 11 09:26:15 2017 -0700 @@ -22,8 +22,12 @@ #endif #ifdef MBED_BUILD_TIMESTAMP +#define SET_TRUSTED_CERT_IN_SAMPLES +#endif // MBED_BUILD_TIMESTAMP + +#ifdef SET_TRUSTED_CERT_IN_SAMPLES #include "certs.h" -#endif // MBED_BUILD_TIMESTAMP +#endif // SET_TRUSTED_CERT_IN_SAMPLES /*String containing Hostname, Device Id & Device Key in the format: */ /* "HostName=<host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>" */ @@ -177,13 +181,13 @@ printf("failure to set option \"MinimumPollingTime\"\r\n"); } -#ifdef MBED_BUILD_TIMESTAMP +#ifdef SET_TRUSTED_CERT_IN_SAMPLES // 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 +#endif // SET_TRUSTED_CERT_IN_SAMPLES myWeather = CREATE_MODEL_INSTANCE(WeatherStation, ContosoAnemometer); if (myWeather == NULL)