A simple IoTHub sample using AMQP as transport
Dependencies: EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed azure_c_shared_utility serializer wolfSSL azure_uamqp_c
This sample showcases the usage of Azure IoT client libraries with the AMQP transport for sending/receiving raw messages from an IoT Hub.
Diff: simplesample_amqp.c
- Revision:
- 43:f179aa2ce96f
- Parent:
- 42:6bb5884a0648
- Child:
- 51:289ece2f210e
diff -r 6bb5884a0648 -r f179aa2ce96f simplesample_amqp.c --- a/simplesample_amqp.c Fri Jul 01 10:44:47 2016 -0700 +++ b/simplesample_amqp.c Mon Jul 18 16:46:58 2016 -0700 @@ -59,9 +59,9 @@ void sendCallback(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback) { - int messageTrackingId = (intptr_t)userContextCallback; + unsigned int messageTrackingId = (unsigned int)(uintptr_t)userContextCallback; - (void)printf("Message Id: %d Received.\r\n", messageTrackingId); + (void)printf("Message Id: %u Received.\r\n", messageTrackingId); (void)printf("Result Call Back Called! Result is: %s \r\n", ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result)); } @@ -145,6 +145,10 @@ srand((unsigned int)time(NULL)); int avgWindSpeed = 10; + // Turn on Log + bool trace = true; + (void)IoTHubClient_SetOption(iotHubClientHandle, "logtrace", &trace); + if (iotHubClientHandle == NULL) { (void)printf("Failed on IoTHubClient_Create\r\n");