IoTHub raw messaging client sample using AMQP
Dependencies: iothub_client EthernetInterface NTPClient iothub_amqp_transport azure_c_shared_utility mbed-rtos mbed azure_uamqp_c wolfSSL
This sample showcases the usage of Azure IoT client libraries with the AMQP transport for sending/receiving raw messages from an IoT Hub.
Diff: iothub_client_sample_amqp.c
- Revision:
- 4:24cbfabe1b9d
- Parent:
- 0:eb1c7bc1f4f1
- Child:
- 8:5db3366b6f57
diff -r f29b78804d95 -r 24cbfabe1b9d iothub_client_sample_amqp.c --- a/iothub_client_sample_amqp.c Thu Sep 17 06:04:46 2015 +0000 +++ b/iothub_client_sample_amqp.c Wed Sep 16 23:54:55 2015 -0700 @@ -9,9 +9,10 @@ #include "crt_abstractions.h" #include "iothubtransportamqp.h" -#ifdef MBED_BUILD_TIMESTAMP -#include "certs.h" -#endif // MBED_BUILD_TIMESTAMP +#ifdef MBED_BUILD_TIMESTAMP +#include "certs.h" +#endif // MBED_BUILD_TIMESTAMP + static const char* connectionString = "[device connection string]"; static int callbackCounter; @@ -90,13 +91,13 @@ } else { -#ifdef MBED_BUILD_TIMESTAMP - // For mbed add the certificate information - if (IoTHubClient_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK) - { - printf("failure to set option \"TrustedCerts\"\r\n"); - } -#endif // MBED_BUILD_TIMESTAMP +#ifdef MBED_BUILD_TIMESTAMP + // For mbed add the certificate information + if (IoTHubClient_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK) + { + printf("failure to set option \"TrustedCerts\"\r\n"); + } +#endif // MBED_BUILD_TIMESTAMP /* Setting Notification call back, so we can receive Commands. */ if (IoTHubClient_SetNotificationCallback(iotHubClientHandle, ReceiveNotificationCallback, &receiveContext) != IOTHUB_CLIENT_OK)