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:
- 56:68f0d4c20dea
- Parent:
- 52:595dd76f48d2
- Child:
- 64:a1b8a60c0a5b
--- a/simplesample_amqp.c Tue Jan 24 15:30:00 2017 -0800 +++ b/simplesample_amqp.c Sat Jan 28 09:37:04 2017 -0800 @@ -104,7 +104,7 @@ if (IoTHubMessage_GetByteArray(message, &buffer, &size) != IOTHUB_MESSAGE_OK) { printf("unable to IoTHubMessage_GetByteArray\r\n"); - result = EXECUTE_COMMAND_ERROR; + result = IOTHUBMESSAGE_ABANDONED; } else { @@ -113,11 +113,11 @@ if (temp == NULL) { printf("failed to malloc\r\n"); - result = EXECUTE_COMMAND_ERROR; + result = IOTHUBMESSAGE_ABANDONED; } else { - memcpy(temp, buffer, size); + (void)memcpy(temp, buffer, size); temp[size] = '\0'; EXECUTE_COMMAND_RESULT executeCommandResult = EXECUTE_COMMAND(userContextCallback, temp); result =