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:
- 56:99dabe3ce9ff
- Parent:
- 51:718bee5b02c2
- Child:
- 64:0cdbc7c1cecc
--- a/simplesample_http.c Tue Jan 24 15:30:22 2017 -0800 +++ b/simplesample_http.c Sat Jan 28 09:37:24 2017 -0800 @@ -106,7 +106,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 { @@ -115,13 +115,13 @@ if (temp == NULL) { printf("failed to malloc\r\n"); - result = EXECUTE_COMMAND_ERROR; + result = IOTHUBMESSAGE_ABANDONED; } else { EXECUTE_COMMAND_RESULT executeCommandResult; - memcpy(temp, buffer, size); + (void)memcpy(temp, buffer, size); temp[size] = '\0'; executeCommandResult = EXECUTE_COMMAND(userContextCallback, temp); result =