diff --git a/.travis.yml b/.travis.yml index 846720a..f2e5cc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ before_install: - findAndReplace() { sed -i'' -e"s|$1|$2|g" "$3"; } - buildExampleSketch() { - EXAMPLE_SKETCH=$PWD/examples/iothub_ll_telemetry_sample/telemetry_sample.c.ino; + EXAMPLE_SKETCH=$PWD/examples/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.ino; arduino --verbose-build --verify --board $BOARD $EXAMPLE_SKETCH; } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..49255e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Microsoft Azure IoT SDKs +Copyright (c) Microsoft Corporation +All rights reserved. +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the ""Software""), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/library.properties b/library.properties index 670bbc0..48372d8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AzureIoTProtocol_HTTP -version=1.1.12 +version=1.3.8 author=Microsoft maintainer=Microsoft sentence=Azure HTTP protocol library for Arduino. For the Arduino MKR1000 or Zero and WiFi Shield 101, Adafruit Huzzah and Feather M0, or SparkFun Thing. diff --git a/src/AzureIoTProtocol_HTTP.h b/src/AzureIoTProtocol_HTTP.h index dae65e5..d77c0f8 100644 --- a/src/AzureIoTProtocol_HTTP.h +++ b/src/AzureIoTProtocol_HTTP.h @@ -4,6 +4,6 @@ #ifndef AZUREIOTPROTOCOLHTTP_H #define AZUREIOTPROTOCOLHTTP_H -#define AzureIoTProtocolHTTPVersion "1.1.12" +#define AzureIoTProtocolHTTPVersion "1.3.8" #endif //AZUREIOTPROTOCOLHTTP_H diff --git a/src/azure_uhttp_c/httpapi_compact.c b/src/azure_uhttp_c/httpapi_compact.c index e4b409b..ae6fade 100644 --- a/src/azure_uhttp_c/httpapi_compact.c +++ b/src/azure_uhttp_c/httpapi_compact.c @@ -6,6 +6,8 @@ #include #include #include + +#include "azure_macro_utils/macro_utils.h" #include "azure_c_shared_utility/gballoc.h" #include "azure_c_shared_utility/httpheaders.h" #include "azure_c_shared_utility/crt_abstractions.h" @@ -1202,33 +1204,33 @@ HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, HTTPAPI_REQUEST_TYPE r HTTPHeaders_GetHeaderCount(httpHeadersHandle, &headersCount) != HTTP_HEADERS_OK) { result = HTTPAPI_INVALID_ARG; - LogError("(result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("(result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_21_024: [ The HTTPAPI_ExecuteRequest shall open the transport connection with the host to send the request. ]*/ else if ((result = OpenXIOConnection(http_instance)) != HTTPAPI_OK) { - LogError("Open HTTP connection failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Open HTTP connection failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_21_026: [ If the open process succeed, the HTTPAPI_ExecuteRequest shall send the request message to the host. ]*/ else if ((result = SendHeadsToXIO(http_instance, requestType, relativePath, httpHeadersHandle, headersCount)) != HTTPAPI_OK) { - LogError("Send heads to HTTP failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Send heads to HTTP failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_21_042: [ The request can contain the a content message, provided in content parameter. ]*/ else if ((result = SendContentToXIO(http_instance, content, contentLength)) != HTTPAPI_OK) { - LogError("Send content to HTTP failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Send content to HTTP failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_21_030: [ At the end of the transmission, the HTTPAPI_ExecuteRequest shall receive the response from the host. ]*/ /*Codes_SRS_HTTPAPI_COMPACT_21_073: [ The message received by the HTTPAPI_ExecuteRequest shall starts with a valid header. ]*/ else if ((result = ReceiveHeaderFromXIO(http_instance, statusCode)) != HTTPAPI_OK) { - LogError("Receive header from HTTP failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Receive header from HTTP failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_21_074: [ After the header, the message received by the HTTPAPI_ExecuteRequest can contain addition information about the content. ]*/ else if ((result = ReceiveContentInfoFromXIO(http_instance, responseHeadersHandle, &bodyLength, &chunked)) != HTTPAPI_OK) { - LogError("Receive content information from HTTP failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Receive content information from HTTP failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } /*Codes_SRS_HTTPAPI_COMPACT_42_084: [ The message received by the HTTPAPI_ExecuteRequest should not contain http body. ]*/ else if (requestType != HTTPAPI_REQUEST_HEAD) @@ -1236,7 +1238,7 @@ HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, HTTPAPI_REQUEST_TYPE r /*Codes_SRS_HTTPAPI_COMPACT_21_075: [ The message received by the HTTPAPI_ExecuteRequest can contain a body with the message content. ]*/ if ((result = ReadHTTPResponseBodyFromXIO(http_instance, bodyLength, chunked, responseContent)) != HTTPAPI_OK) { - LogError("Read HTTP response body from HTTP failed (result = %s)", MU_ENUM_TO_STRING(HTTPAPI_RESULT, result)); + LogError("Read HTTP response body from HTTP failed (result = %" PRI_MU_ENUM ")", MU_ENUM_VALUE(HTTPAPI_RESULT, result)); } }