[修改] 增加freeRTOS

1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
2023-05-06 16:43:01 +00:00
commit a345df017b
20944 changed files with 11094377 additions and 0 deletions

View File

@ -0,0 +1,293 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/* Standard includes. */
#include <assert.h>
#include "http_demo_utils.h"
/* Exponential backoff retry include. */
#include "backoff_algorithm.h"
/*-----------------------------------------------------------*/
/**
* @brief The maximum number of retries for network operation with server.
*/
#define RETRY_MAX_ATTEMPTS ( 5U )
/**
* @brief The maximum back-off delay (in milliseconds) for retrying failed
* operation with server.
*/
#define RETRY_MAX_BACKOFF_DELAY_MS ( 5000U )
/**
* @brief The base back-off delay (in milliseconds) to use for network operation
* retry attempts.
*/
#define RETRY_BACKOFF_BASE_MS ( 500U )
/**
* @brief The separator between the "https" scheme and the host in a URL.
*/
#define SCHEME_SEPARATOR "://"
/**
* @brief The length of the "://" separator.
*/
#define SCHEME_SEPARATOR_LEN ( sizeof( SCHEME_SEPARATOR ) - 1 )
/*-----------------------------------------------------------*/
/**
* @brief Each compilation unit that consumes the NetworkContext must define it.
* It should contain a single pointer to the type of your desired transport.
* This utility is used by both TLS and plaintext HTTP demos, so define this pointer as void *.
*
* @note Transport stacks are defined in FreeRTOS-Plus/Source/Application-Protocols/network_transport.
*/
struct NetworkContext
{
void * pParams;
};
/*-----------------------------------------------------------*/
extern UBaseType_t uxRand();
/*-----------------------------------------------------------*/
BaseType_t connectToServerWithBackoffRetries( TransportConnect_t connectFunction,
NetworkContext_t * pxNetworkContext )
{
BaseType_t xReturn = pdFAIL;
/* Status returned by the retry utilities. */
BackoffAlgorithmStatus_t xBackoffAlgStatus = BackoffAlgorithmSuccess;
/* Struct containing the next backoff time. */
BackoffAlgorithmContext_t xReconnectParams;
uint16_t usNextBackoff = 0U;
assert( connectFunction != NULL );
/* Initialize reconnect attempts and interval */
BackoffAlgorithm_InitializeParams( &xReconnectParams,
RETRY_BACKOFF_BASE_MS,
RETRY_MAX_BACKOFF_DELAY_MS,
RETRY_MAX_ATTEMPTS );
/* Attempt to connect to the HTTP server. If connection fails, retry after a
* timeout. The timeout value will exponentially increase until either the
* maximum timeout value is reached or the set number of attempts are
* exhausted.*/
do
{
xReturn = connectFunction( pxNetworkContext );
if( xReturn != pdPASS )
{
/* Generate a random number and calculate backoff value (in milliseconds) for
* the next connection retry.
* Note: It is recommended to seed the random number generator with a device-specific
* entropy source so that possibility of multiple devices retrying failed network operations
* at similar intervals can be avoided. */
xBackoffAlgStatus = BackoffAlgorithm_GetNextBackoff( &xReconnectParams, uxRand(), &usNextBackoff );
if( xBackoffAlgStatus == BackoffAlgorithmSuccess )
{
LogWarn( ( "Connection to the HTTP server failed. "
"Retrying connection with backoff and jitter." ) );
LogInfo( ( "Retry attempt %lu out of maximum retry attempts %lu.",
xReconnectParams.attemptsDone,
RETRY_MAX_ATTEMPTS ) );
}
}
} while( ( xReturn == pdFAIL ) && ( xBackoffAlgStatus == BackoffAlgorithmSuccess ) );
if( xReturn == pdFAIL )
{
LogError( ( "Connection to the server failed, all attempts exhausted." ) );
}
return xReturn;
}
/*-----------------------------------------------------------*/
HTTPStatus_t getUrlPath( const char * pcUrl,
size_t xUrlLen,
const char ** pcPath,
size_t * pxPathLen )
{
HTTPStatus_t xHttpStatus = HTTPSuccess;
const char * pcHostStart = NULL;
const char * pcPathStart = NULL;
size_t xHostLen = 0, i = 0, xPathStartIndex = 0, xPathLen = 0;
if( ( pcUrl == NULL ) || ( pcPath == NULL ) || ( pxPathLen == NULL ) )
{
LogError( ( "NULL parameter passed to getUrlPath()." ) );
xHttpStatus = HTTPInvalidParameter;
}
if( xHttpStatus == HTTPSuccess )
{
xHttpStatus = getUrlAddress( pcUrl, xUrlLen, &pcHostStart, &xHostLen );
}
if( xHttpStatus == HTTPSuccess )
{
/* Search for the start of the path. */
for( i = ( pcHostStart - pcUrl ) + xHostLen; i < xUrlLen; i++ )
{
if( pcUrl[ i ] == '/' )
{
pcPathStart = &pcUrl[ i ];
xPathStartIndex = i;
break;
}
}
if( pcPathStart != NULL )
{
/* The end of the path will be either the start of the query,
* start of the fragment, or end of the URL. If this is an S3
* presigned URL, then there must be a query. */
for( i = xPathStartIndex; i < xUrlLen; i++ )
{
if( pcUrl[ i ] == '?' )
{
break;
}
}
xPathLen = i - xPathStartIndex;
}
if( xPathLen == 0 )
{
LogError( ( "Could not parse path from input URL %.*s",
( int32_t ) xUrlLen,
pcUrl ) );
xHttpStatus = HTTPNoResponse;
}
}
if( xHttpStatus == HTTPSuccess )
{
*pxPathLen = xPathLen;
*pcPath = pcPathStart;
}
if( xHttpStatus != HTTPSuccess )
{
LogError( ( "Error parsing the path from URL %s. Error code: %d",
pcUrl,
xHttpStatus ) );
}
return xHttpStatus;
}
/*-----------------------------------------------------------*/
HTTPStatus_t getUrlAddress( const char * pcUrl,
size_t xUrlLen,
const char ** pcAddress,
size_t * pxAddressLen )
{
HTTPStatus_t xHttpStatus = HTTPSuccess;
const char * pcHostStart = NULL;
const char * pcHostEnd = NULL;
size_t i = 0, xHostLen = 0;
if( ( pcUrl == NULL ) || ( pcAddress == NULL ) || ( pxAddressLen == NULL ) )
{
LogError( ( "NULL parameter passed to getUrlAddress()." ) );
xHttpStatus = HTTPInvalidParameter;
}
if( xHttpStatus == HTTPSuccess )
{
/* Search for the start of the hostname using the "://" separator. */
for( i = 0; i < ( xUrlLen - SCHEME_SEPARATOR_LEN ); i++ )
{
if( strncmp( &( pcUrl[ i ] ), SCHEME_SEPARATOR, SCHEME_SEPARATOR_LEN ) == 0 )
{
pcHostStart = pcUrl + i + SCHEME_SEPARATOR_LEN;
break;
}
}
if( pcHostStart == NULL )
{
LogError( ( "Could not find \"://\" scheme separator in input URL %.*s",
( int32_t ) xUrlLen,
pcUrl ) );
xHttpStatus = HTTPParserInternalError;
}
else
{
/* Search for the end of the hostname assuming that the object path
* is next. Assume that there is no port number as this is used for
* S3 presigned URLs. */
for( pcHostEnd = pcHostStart; pcHostEnd < ( pcUrl + xUrlLen ); pcHostEnd++ )
{
if( *pcHostEnd == '/' )
{
xHostLen = ( size_t ) ( pcHostEnd - pcHostStart );
break;
}
}
}
}
if( xHttpStatus == HTTPSuccess )
{
*pxAddressLen = xHostLen;
if( xHostLen == 0 )
{
LogError( ( "Could not find end of host in input URL %.*s",
( int32_t ) xUrlLen,
pcUrl ) );
xHttpStatus = HTTPNoResponse;
*pcAddress = NULL;
}
else
{
*pcAddress = pcHostStart;
}
}
if( xHttpStatus != HTTPSuccess )
{
LogError( ( "Error parsing the address from URL %s. Error code %d",
pcUrl,
xHttpStatus ) );
}
return xHttpStatus;
}

View File

@ -0,0 +1,127 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#ifndef HTTP_DEMO_UTILS_H
#define HTTP_DEMO_UTILS_H
/* Standard includes. */
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* HTTP API header. */
#include "core_http_client.h"
/**
* @brief Function pointer for establishing connection to a server.
*
* @param[out] pxNetworkContext Implementation-defined network context.
*
* @return pdFAIL on failure; pdPASS on successful connection.
*/
typedef BaseType_t ( * TransportConnect_t )( NetworkContext_t * pxNetworkContext );
/**
* @brief Connect to a server with reconnection retries.
*
* If connection fails, retry is attempted after a timeout. The timeout value
* will exponentially increase until either the maximum timeout value is reached
* or the set number of attempts are exhausted.
*
* @param[in] connectFunction Function pointer for establishing connection to a
* server.
* @param[out] pxNetworkContext Implementation-defined network context.
*
* @return pdFAIL on failure; pdPASS on successful connection.
*/
BaseType_t connectToServerWithBackoffRetries( TransportConnect_t connectFunction,
NetworkContext_t * pxNetworkContext );
/**
* @brief Retrieve the path from the input URL.
*
* This function retrieves the location and length of the path from within the
* input the URL. The query is not included in the length returned.
*
* The URL MUST start with "http://" or "https://" to find the path.
*
* For example, if pcUrl is:
* "https://www.somewebsite.com/path/to/item.txt?optionalquery=stuff"
*
* Then pcPath and pxPathLen will be the following:
* *pcPath = "/path/to/item.txt?optionalquery=stuff"
* *pxPathLen = 17
*
* @param[in] pcUrl URL string to parse.
* @param[in] xUrlLen The length of the URL string input.
* @param[out] pcPath pointer within input url that the path starts at.
* @param[out] pxPathLen Length of the path.
*
* @return The status of the parsing attempt:
* HTTPSuccess if the path was successfully parsed,
* HTTPParserInternalError if there was an error parsing the URL,
* or HTTPNoResponse if the path was not found.
*/
HTTPStatus_t getUrlPath( const char * pcUrl,
size_t xUrlLen,
const char ** pcPath,
size_t * pxPathLen );
/**
* @brief Retrieve the Address from the input URL.
*
* This function retrieves the location and length of the address from within
* the input URL. The path and query are not included in the length returned.
*
* The URL MUST start with "http://" or "https://" to find the address.
*
* For example, if pcUrl is:
* "https://www.somewebsite.com/path/to/item.txt?optionalquery=stuff"
*
* Then pcAddress and pxAddressLen will be the following:
* *pcAddress = "www.somewebsite.com/path/to/item.txt?optionalquery=stuff"
* *pxAddressLen = 19
*
* @param[in] pcUrl URL string to parse.
* @param[in] xUrlLen The length of the URL string input.
* @param[out] pcAddress pointer within input url that the address starts at.
* @param[out] pxAddressLen Length of the address.
*
* @return The status of the parsing attempt:
* HTTPSuccess if the path was successfully parsed,
* HTTPParserInternalError if there was an error parsing the URL,
* or HTTPNoResponse if the path was not found.
*/
HTTPStatus_t getUrlAddress( const char * pcUrl,
size_t xUrlLen,
const char ** pcAddress,
size_t * pxAddressLen );
#endif /* ifndef HTTP_DEMO_UTILS_H */

View File

@ -0,0 +1,49 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file aws_ota_codesigner_certificate.h
* @brief Code signer certificate as char array.
*
* Define this char array containing the PEM encode signing certificate.
* Note - It is highly recommended to use this for demo purpose and store
* certificates in secure location in production devices.
*/
#ifndef __CODESIGNER_CERTIFICATE__H__
#define __CODESIGNER_CERTIFICATE__H__
/*
* PEM-encoded code signer certificate
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"
* "...base64 data...\n"
* "-----END CERTIFICATE-----\n";
*/
static const char signingcredentialSIGNING_CERTIFICATE_PEM[] = "...Insert here...";
#endif

View File

@ -0,0 +1,45 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file code_signature_verification.h
* @brief Interface for code signature verification functions.
*
*/
#ifndef CODE_SIGNATURE_VERIFICATION_H
#define CODE_SIGNATURE_VERIFICATION_H
#include "FreeRTOS.h"
/**
* @brief Validate the integrity of the new image to be activated.
* @param[in] pFileContext pointer to File context
* @return OtaPalMainStatus_t , OtaPalSuccess if the signature of the image is valid.
*/
OtaPalMainStatus_t xValidateImageSignature( OtaFileContext_t* const pFileContext );
#endif

View File

@ -0,0 +1,465 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file code_signature_verification_mbedtls.c
* @brief Code signature verification using mbedtls crypto.
*
* The file demonstrates implements the code signature verification functionality on
* the specified file using mbedtls for SHA256 ECDSA.
*/
/* C runtime includes. */
#include <string.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
/* mbedTLS includes. */
#if !defined( MBEDTLS_CONFIG_FILE )
#include "mbedtls_config_v3.2.1.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/platform.h"
#include "mbedtls/sha256.h"
#include "mbedtls/sha1.h"
#include "mbedtls/pk.h"
#include "mbedtls/x509_crt.h"
/* OTA includes. */
#include "ota.h"
/* Signature verification includes. */
#include "code_signature_verification.h"
#include "aws_ota_codesigner_certificate.h"
/**
* @brief SHA256 buffer size for storing cryptographic hash computation results.
*/
#define SHA256_DIGEST_BYTES 32
/* Size of buffer used in file operations on this platform (Windows). */
#define OTA_PAL_WIN_BUF_SIZE ( ( size_t ) 4096UL )
/**
* @brief Library-independent cryptographic algorithm identifiers.
*/
#define HASH_ALGORITHM_SHA1 1
#define HASH_ALGORITHM_SHA256 2
#define ASYMMETRIC_ALGORITHM_RSA 1
#define ASYMMETRIC_ALGORITHM_ECDSA 2
/**
* @brief Internal signature verification context structure.
*/
typedef struct SignatureVerificationState
{
BaseType_t xAsymmetricAlgorithm;
BaseType_t xHashAlgorithm;
mbedtls_sha256_context xSHA256Context;
} SignatureVerificationState_t, * SignatureVerificationStatePtr_t;
/**
* @brief Initializes digital signature verification.
*
* @param[out] ppvContext Opaque context structure.
* @param[in] xAsymmetricAlgorithm Cryptographic public key cryptosystem.
* @param[in] xHashAlgorithm Cryptographic hash algorithm that was used for signing.
*
* @return pdTRUE if initialization succeeds, or pdFALSE otherwise.
*/
static BaseType_t prvSignatureVerificationStart(void** ppvContext,
BaseType_t xAsymmetricAlgorithm,
BaseType_t xHashAlgorithm);
/**
* @brief Updates a cryptographic hash computation with the specified byte array.
*
* @param[in] pvContext Opaque context structure.
* @param[in] pucData Byte array that was signed.
* @param[in] xDataLength Length in bytes of data that was signed.
*/
static void prvSignatureVerificationUpdate(void* pvContext,
const uint8_t* pucData,
size_t xDataLength);
/**
* @brief Verifies a digital signature computation using the public key from the
* specified certificate.
*
* @param[in] pvContext Opaque context structure.
* @param[in] pucSignerCertificate Base64 and DER encoded X.509 certificate of the
* signer.
* @param[in] xSignerCertificateLength Length in bytes of the certificate.
* @param[in] pucSignature Digital signature result to verify.
* @param[in] xSignatureLength in bytes of digital signature result.
*
* @return pdTRUE if the signature is correct or pdFALSE if the signature is invalid.
*/
static BaseType_t prvSignatureVerificationFinal(void* pvContext,
char* pcSignerCertificate,
size_t xSignerCertificateLength,
uint8_t* pucSignature,
size_t xSignatureLength);
/* Read the specified signer certificate from the filesystem into a local buffer. The allocated
* memory becomes the property of the caller who is responsible for freeing it.
*/
static uint8_t* otaPal_ReadAndAssumeCertificate(const uint8_t* const pucCertName,
uint32_t* const ulSignerCertSize)
{
FILE* pFile;
uint8_t* pucSignerCert = NULL;
uint8_t* pucCertData = NULL;
int32_t lSize = 0; /* For MISRA mandatory. */
int32_t lWindowsError;
pFile = fopen((const char*)pucCertName, "rb"); /*lint !e586
* C standard library call is being used for portability. */
if (pFile != NULL)
{
lWindowsError = fseek(pFile, 0, SEEK_END); /*lint !e586
* C standard library call is being used for portability. */
if (lWindowsError == 0) /* fseek returns a non-zero value on error. */
{
lSize = (int32_t)ftell(pFile); /*lint !e586 Allow call in this context. */
if (lSize != -1L) /* ftell returns -1 on error. */
{
lWindowsError = fseek(pFile, 0, SEEK_SET); /*lint !e586
* C standard library call is being used for portability. */
}
else /* ftell returned an error, pucSignerCert remains NULL. */
{
lWindowsError = -1L;
}
} /* else fseek returned an error, pucSignerCert remains NULL. */
if (lWindowsError == 0)
{
/* Allocate memory for the signer certificate plus a terminating zero so we can load and return it to the caller. */
pucSignerCert = pvPortMalloc(lSize + 1); /*lint !e732 !e9034 !e9079 Allow conversion. */
}
if (pucSignerCert != NULL)
{
if (fread(pucSignerCert, 1, lSize, pFile) == (size_t)lSize) /*lint !e586 !e732 !e9034
* C standard library call is being used for portability. */
{
/* The crypto code requires the terminating zero to be part of the length so add 1 to the size. */
*ulSignerCertSize = lSize + 1;
pucSignerCert[lSize] = 0;
}
else
{ /* There was a problem reading the certificate file so free the memory and abort. */
vPortFree(pucSignerCert);
pucSignerCert = NULL;
}
}
else
{
LogError(("Failed to allocate memory for signer cert contents.\r\n"));
/* Nothing special to do. */
}
lWindowsError = fclose(pFile); /*lint !e586
* C standard library call is being used for portability. */
if (lWindowsError != 0)
{
LogError(("File pointer operation failed.\r\n"));
pucSignerCert = NULL;
}
}
else
{
LogError(("No such certificate file: %s. Using aws_ota_codesigner_certificate.h.\r\n",
(const char*)pucCertName));
/* Allocate memory for the signer certificate plus a terminating zero so we can copy it and return to the caller. */
lSize = sizeof(signingcredentialSIGNING_CERTIFICATE_PEM);
pucSignerCert = pvPortMalloc(lSize); /*lint !e9029 !e9079 !e838 malloc proto requires void*. */
pucCertData = (uint8_t*)signingcredentialSIGNING_CERTIFICATE_PEM; /*lint !e9005 we don't modify the cert but it could be set by PKCS11 so it's not const. */
if (pucSignerCert != NULL)
{
memcpy(pucSignerCert, pucCertData, lSize);
*ulSignerCertSize = lSize;
}
else
{
LogError(("No memory for certificate of size %d!\r\n", lSize));
}
}
return pucSignerCert; /*lint !e480 !e481 fopen and fclose are being used by-design. */
}
/**
* @brief Verifies a cryptographic signature based on the signer
* certificate, hash algorithm, and the data that was signed.
*/
static BaseType_t prvVerifySignature(char* pcSignerCertificate,
size_t xSignerCertificateLength,
BaseType_t xHashAlgorithm,
uint8_t* pucHash,
size_t xHashLength,
uint8_t* pucSignature,
size_t xSignatureLength)
{
BaseType_t xResult = pdTRUE;
mbedtls_x509_crt xCertCtx;
mbedtls_md_type_t xMbedHashAlg = MBEDTLS_MD_SHA256;
(void)xHashAlgorithm;
memset(&xCertCtx, 0, sizeof(mbedtls_x509_crt));
/*
* Decode and create a certificate context
*/
mbedtls_x509_crt_init(&xCertCtx);
if (0 != mbedtls_x509_crt_parse(
&xCertCtx, (const unsigned char*)pcSignerCertificate, xSignerCertificateLength))
{
xResult = pdFALSE;
}
/*
* Verify the signature using the public key from the decoded certificate
*/
if (pdTRUE == xResult)
{
if (0 != mbedtls_pk_verify(
&xCertCtx.pk,
xMbedHashAlg,
pucHash,
xHashLength,
pucSignature,
xSignatureLength))
{
xResult = pdFALSE;
}
}
/*
* Clean-up
*/
mbedtls_x509_crt_free(&xCertCtx);
return xResult;
}
/**
* @brief Creates signature verification context.
*/
static BaseType_t prvSignatureVerificationStart(void** ppvContext,
BaseType_t xAsymmetricAlgorithm,
BaseType_t xHashAlgorithm)
{
BaseType_t xResult = pdTRUE;
SignatureVerificationState_t* pxCtx = NULL;
/*
* Allocate the context
*/
if (NULL == (pxCtx = (SignatureVerificationStatePtr_t)pvPortMalloc(
sizeof(*pxCtx)))) /*lint !e9087 Allow casting void* to other types. */
{
xResult = pdFALSE;
}
if (pdTRUE == xResult)
{
*ppvContext = pxCtx;
/*
* Store the algorithm identifiers
*/
pxCtx->xAsymmetricAlgorithm = xAsymmetricAlgorithm;
pxCtx->xHashAlgorithm = xHashAlgorithm;
/*
* Initialize the requested hash type
*/
mbedtls_sha256_init(&pxCtx->xSHA256Context);
(void)mbedtls_sha256_starts(&pxCtx->xSHA256Context, 0);
}
return xResult;
}
/**
* @brief Adds bytes to an in-progress hash for subsequent signature verification.
*/
static void prvSignatureVerificationUpdate(void* pvContext,
const uint8_t* pucData,
size_t xDataLength)
{
SignatureVerificationState_t* pxCtx = (SignatureVerificationStatePtr_t)pvContext; /*lint !e9087 Allow casting void* to other types. */
/*
* Add the data to the hash of the requested type
*/
(void)mbedtls_sha256_update(&pxCtx->xSHA256Context, pucData, xDataLength);
}
/**
* @brief Performs signature verification on a cryptographic hash.
*/
static BaseType_t prvSignatureVerificationFinal(void* pvContext,
char* pcSignerCertificate,
size_t xSignerCertificateLength,
uint8_t* pucSignature,
size_t xSignatureLength)
{
BaseType_t xResult = pdFALSE;
if (pvContext != NULL)
{
SignatureVerificationStatePtr_t pxCtx = (SignatureVerificationStatePtr_t)pvContext; /*lint !e9087 Allow casting void* to other types. */
uint8_t ucSHA256[SHA256_DIGEST_BYTES]; /* Reserve enough space for the larger for SHA256 results. */
uint8_t* pucHash = NULL;
size_t xHashLength = 0;
if ((pcSignerCertificate != NULL) &&
(pucSignature != NULL) &&
(xSignerCertificateLength > 0UL) &&
(xSignatureLength > 0UL))
{
/*
* Finish the hash.
*/
(void)mbedtls_sha256_finish(&pxCtx->xSHA256Context, ucSHA256);
pucHash = ucSHA256;
xHashLength = SHA256_DIGEST_BYTES;
/*
* Verify the signature.
*/
xResult = prvVerifySignature(pcSignerCertificate,
xSignerCertificateLength,
pxCtx->xHashAlgorithm,
pucHash,
xHashLength,
pucSignature,
xSignatureLength);
}
else
{
/* Allow function to be called with only the context pointer for cleanup after a failure. */
}
/*
* Clean-up
*/
vPortFree(pxCtx);
}
return xResult;
}
/* Verify the signature of the specified file. */
OtaPalMainStatus_t xValidateImageSignature(OtaFileContext_t* const C)
{
OtaPalMainStatus_t eResult = OtaPalSuccess;
uint32_t ulBytesRead;
uint32_t ulSignerCertSize;
uint8_t* pucBuf, * pucSignerCert;
void* pvSigVerifyContext;
/* Verify an ECDSA-SHA256 signature. */
if (pdFALSE == prvSignatureVerificationStart(&pvSigVerifyContext, ASYMMETRIC_ALGORITHM_ECDSA, HASH_ALGORITHM_SHA256))
{
eResult = OtaPalSignatureCheckFailed;
}
else
{
LogInfo(("Started %s signature verification, file: %s\r\n",
OTA_JsonFileSignatureKey, (const char*)C->pCertFilepath));
pucSignerCert = otaPal_ReadAndAssumeCertificate((const uint8_t* const)C->pCertFilepath, &ulSignerCertSize);
if (pucSignerCert != NULL)
{
pucBuf = pvPortMalloc( OTA_PAL_WIN_BUF_SIZE ); /*lint !e9079 Allow conversion. */
if (pucBuf != NULL)
{
/* Rewind the received file to the beginning. */
if (fseek(C->pFile, 0L, SEEK_SET) == 0) /*lint !e586
* C standard library call is being used for portability. */
{
do
{
ulBytesRead = fread(pucBuf, 1, OTA_PAL_WIN_BUF_SIZE, C->pFile); /*lint !e586
* C standard library call is being used for portability. */
/* Include the file chunk in the signature validation. Zero size is OK. */
prvSignatureVerificationUpdate(pvSigVerifyContext, pucBuf, ulBytesRead);
} while (ulBytesRead > 0UL);
if (pdFALSE == prvSignatureVerificationFinal(pvSigVerifyContext,
(char*)pucSignerCert,
(size_t)ulSignerCertSize,
C->pSignature->data,
C->pSignature->size)) /*lint !e732 !e9034 Allow comparison in this context. */
{
eResult = OtaPalSignatureCheckFailed;
}
pvSigVerifyContext = NULL; /* The context has been freed by prvSignatureVerificationFinal(). */
}
else
{
/* Nothing special to do. */
}
/* Free the temporary file page buffer. */
vPortFree(pucBuf);
}
else
{
LogError(("Failed to allocate buffer memory.\r\n"));
eResult = OtaPalOutOfMemory;
}
/* Free the signer certificate that we now own after prvReadAndAssumeCertificate(). */
vPortFree(pucSignerCert);
}
else
{
eResult = OtaPalBadSignerCert;
}
}
return eResult;
}

View File

@ -0,0 +1,419 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file ota_pal.c
* @brief OTA PAL implementation for Windows platform.
*/
/* Standard includes. */
#include <stdio.h>
#include <stdlib.h>
/* Kernel includes. */
#include "FreeRTOS.h"
/* Library config includes. */
#include "ota_config.h"
/* OTA Library include. */
#include "ota.h"
#include "ota_pal.h"
#include "code_signature_verification.h"
/* Specify the OTA signature algorithm we support on this platform. */
const char OTA_JsonFileSignatureKey[ OTA_FILE_SIG_KEY_STR_MAX_LENGTH ] = "sig-sha256-ecdsa";
static OtaPalMainStatus_t otaPal_CheckFileSignature( OtaFileContext_t * const C );
/*-----------------------------------------------------------*/
static inline BaseType_t prvContextValidate( OtaFileContext_t* pFileContext )
{
return( ( pFileContext != NULL ) &&
( pFileContext->pFile != NULL ) ); /*lint !e9034 Comparison is correct for file pointer type. */
}
/* Used to set the high bit of Windows error codes for a negative return value. */
#define OTA_PAL_INT16_NEGATIVE_MASK ( 1 << 15 )
/* Attempt to create a new receive file for the file chunks as they come in. */
OtaPalStatus_t otaPal_CreateFileForRx( OtaFileContext_t* const C )
{
OtaPalMainStatus_t mainErr = OtaPalUninitialized;
OtaPalSubStatus_t subErr = 0;
if( C != NULL )
{
if ( C->pFilePath != NULL )
{
C->pFile = fopen( ( const char * )C->pFilePath, "w+b" ); /*lint !e586
* C standard library call is being used for portability. */
if ( C->pFile != NULL )
{
mainErr = OtaPalSuccess;
LogInfo( ( "Receive file created.\r\n" ) );
}
else
{
mainErr = OtaPalRxFileCreateFailed;
subErr = errno;
LogError( ( "ERROR - Failed to start operation: already active!\r\n" ) );
}
}
else
{
mainErr = OtaPalRxFileCreateFailed;
LogError( ( "ERROR - Invalid filepath in filecontext.\r\n" ) );
}
}
else
{
mainErr = OtaPalRxFileCreateFailed;
LogError( ( "ERROR - Invalid file context provided.\r\n" ) );
}
return OTA_PAL_COMBINE_ERR(mainErr,subErr);
}
/* Abort receiving the specified OTA update by closing the file. */
OtaPalStatus_t otaPal_Abort( OtaFileContext_t * const C )
{
/* Set default return status to uninitialized. */
OtaPalMainStatus_t mainErr = OtaPalUninitialized;
OtaPalSubStatus_t subErr = 0;
int32_t lFileCloseResult;
if( NULL != C )
{
/* Close the OTA update file if it's open. */
if( NULL != C->pFile )
{
lFileCloseResult = fclose( C->pFile ); /*lint !e482 !e586
* Context file handle state is managed by this API. */
C->pFile = NULL;
if( 0 == lFileCloseResult )
{
LogInfo( ( "File closed.\r\n" ) );
mainErr = OtaPalSuccess;
}
else /* Failed to close file. */
{
LogError( ( "ERROR - Closing file failed.\r\n" ) );
mainErr = OtaPalFileAbort;
subErr = errno;
}
}
else
{
/* Nothing to do. No open file associated with this context. */
mainErr = OtaPalSuccess;
}
}
else /* Context was not valid. */
{
LogError( ( "ERROR - Invalid context.\r\n" ) );
mainErr = OtaPalFileAbort;
}
return OTA_PAL_COMBINE_ERR(mainErr,subErr);
}
/* Write a block of data to the specified file. */
int16_t otaPal_WriteBlock( OtaFileContext_t * const C,
uint32_t ulOffset,
uint8_t * const pacData,
uint32_t ulBlockSize )
{
int32_t lResult = 0;
if( prvContextValidate( C ) == pdTRUE )
{
lResult = fseek( C->pFile, ulOffset, SEEK_SET ); /*lint !e586 !e713 !e9034
* C standard library call is being used for portability. */
if( 0 == lResult )
{
lResult = fwrite( pacData, 1, ulBlockSize, C->pFile ); /*lint !e586 !e713 !e9034
* C standard library call is being used for portability. */
if( lResult < 0 )
{
LogError( ( "ERROR - fwrite failed\r\n" ) );
/* Mask to return a negative value. */
lResult = OTA_PAL_INT16_NEGATIVE_MASK | errno; /*lint !e40 !e9027
* Errno is being used in accordance with host API documentation.
* Bitmasking is being used to preserve host API error with library status code. */
}
}
else
{
LogError( ( "ERROR - fseek failed\r\n" ) );
/* Mask to return a negative value. */
lResult = OTA_PAL_INT16_NEGATIVE_MASK | errno; /*lint !e40 !e9027
* Errno is being used in accordance with host API documentation.
* Bitmasking is being used to preserve host API error with library status code. */
}
}
else /* Invalid context or file pointer provided. */
{
LogError( ( "ERROR - Invalid context.\r\n" ) );
lResult = -1; /*TODO: Need a negative error code from the PAL here. */
}
return ( int16_t ) lResult;
}
/* Close the specified file. This shall authenticate the file if it is marked as secure. */
OtaPalStatus_t otaPal_CloseFile( OtaFileContext_t * const C )
{
OtaPalMainStatus_t mainErr = OtaPalUninitialized;
OtaPalSubStatus_t subErr = 0;
int32_t lWindowsError = 0;
if( prvContextValidate( C ) == pdTRUE )
{
if( C->pSignature != NULL )
{
/* Verify the file signature, close the file and return the signature verification result. */
mainErr = otaPal_CheckFileSignature( C );
}
else
{
LogError( ( "NULL OTA Signature structure.\r\n" ) );
mainErr = OtaPalSignatureCheckFailed;
}
/* Close the file. */
lWindowsError = fclose( C->pFile ); /*lint !e482 !e586
* C standard library call is being used for portability. */
C->pFile = NULL;
if( lWindowsError != 0 )
{
LogError( ( "Failed to close OTA update file.\r\n" ) );
mainErr = OtaPalFileClose;
subErr = errno;
}
if( mainErr == OtaPalSuccess )
{
LogInfo( ( "%s signature verification passed.\r\n", OTA_JsonFileSignatureKey ) );
}
else
{
LogError( ( "Failed to pass %s signature verification: %d.\r\n",
OTA_JsonFileSignatureKey, OTA_PAL_COMBINE_ERR(mainErr,subErr) ) );
/* If we fail to verify the file signature that means the image is not valid. We need to set the image state to aborted. */
otaPal_SetPlatformImageState( C, OtaImageStateAborted );
}
}
else /* Invalid OTA Context. */
{
/* FIXME: Invalid error code for a null file context and file handle. */
LogError( ( "Invalid file context.\r\n" ) );
mainErr = OtaPalFileClose;
}
return OTA_PAL_COMBINE_ERR(mainErr,subErr);
}
/* Verify the signature of the specified file. */
static OtaPalMainStatus_t otaPal_CheckFileSignature( OtaFileContext_t* const C )
{
OtaPalMainStatus_t eResult = OtaPalSignatureCheckFailed;
if ( prvContextValidate( C ) == pdTRUE )
{
eResult = xValidateImageSignature( C );
}
else
{
LogError( ( "OTA image signature is invalid.\r\n" ) );
}
return eResult;
}
/*-----------------------------------------------------------*/
OtaPalStatus_t otaPal_ResetDevice( OtaFileContext_t* const pFileContext )
{
(void)pFileContext;
/* Return no error. Windows implementation does not reset device. */
return OTA_PAL_COMBINE_ERR(OtaPalSuccess,0);
}
/*-----------------------------------------------------------*/
OtaPalStatus_t otaPal_ActivateNewImage( OtaFileContext_t* const pFileContext )
{
(void)pFileContext;
/* Return no error. Windows implementation simply does nothing on activate.
* To run the new firmware image, double click the newly downloaded exe */
return OTA_PAL_COMBINE_ERR(OtaPalSuccess,0);
}
/*
* Set the final state of the last transferred (final) OTA file (or bundle).
* On Windows, the state of the OTA image is stored in PlaformImageState.txt.
*/
OtaPalStatus_t otaPal_SetPlatformImageState( OtaFileContext_t * const pFileContext, OtaImageState_t eState )
{
(void)pFileContext;
OtaPalMainStatus_t mainErr = OtaPalSuccess;
OtaPalSubStatus_t subErr = 0;
FILE * pstPlatformImageState;
if( eState != OtaImageStateUnknown && eState <= OtaLastImageState )
{
pstPlatformImageState = fopen( "PlatformImageState.txt", "w+b" ); /*lint !e586
* C standard library call is being used for portability. */
if( pstPlatformImageState != NULL )
{
/* Write the image state to PlatformImageState.txt. */
if( 1 != fwrite( &eState, sizeof( OtaImageState_t ), 1, pstPlatformImageState ) ) /*lint !e586 !e9029
* C standard library call is being used for portability. */
{
LogError( ( "Unable to write to image state file.\r\n" ) );
mainErr = OtaPalBadImageState;
subErr = errno;
}
/* Close PlatformImageState.txt. */
if( 0 != fclose( pstPlatformImageState ) ) /*lint !e586 Allow call in this context. */
{
LogError( ( "Unable to close image state file.\r\n" ) );
mainErr = OtaPalBadImageState;
subErr = errno;
}
}
else
{
LogError( ( "Unable to open image state file.\r\n" ) );
mainErr = OtaPalBadImageState;
subErr = errno;
}
} /*lint !e481 Allow fopen and fclose calls in this context. */
else /* Image state invalid. */
{
LogError( ( "ERROR - Invalid image state provided.\r\n" ) );
mainErr = OtaPalBadImageState;
}
return OTA_PAL_COMBINE_ERR(mainErr,subErr);
}
/* Get the state of the currently running image.
*
* On Windows, this is simulated by looking for and reading the state from
* the PlatformImageState.txt file in the current working directory.
*
* We read this at OTA_Init time so we can tell if the MCU image is in self
* test mode. If it is, we expect a successful connection to the OTA services
* within a reasonable amount of time. If we don't satisfy that requirement,
* we assume there is something wrong with the firmware and reset the device,
* causing it to rollback to the previous code. On Windows, this is not
* fully simulated as there is no easy way to reset the simulated device.
*/
OtaPalImageState_t otaPal_GetPlatformImageState( OtaFileContext_t * const pFileContext )
{
(void)pFileContext;
FILE * pstPlatformImageState;
OtaImageState_t eSavedAgentState = OtaImageStateUnknown;
OtaPalImageState_t ePalState = OtaPalImageStateUnknown;
pstPlatformImageState = fopen( "PlatformImageState.txt", "r+b" ); /*lint !e586
* C standard library call is being used for portability. */
if( pstPlatformImageState != NULL )
{
if( 1 != fread( &eSavedAgentState, sizeof(OtaImageState_t), 1, pstPlatformImageState ) ) /*lint !e586 !e9029
* C standard library call is being used for portability. */
{
/* If an error occurred reading the file, mark the state as aborted. */
LogError( ( "Unable to read image state file.\r\n" ) );
ePalState = ( OtaPalImageStateInvalid | (errno & OTA_PAL_ERR_MASK) );
}
else
{
switch (eSavedAgentState)
{
case OtaImageStateTesting:
ePalState = OtaPalImageStatePendingCommit;
break;
case OtaImageStateAccepted:
ePalState = OtaPalImageStateValid;
break;
case OtaImageStateRejected:
case OtaImageStateAborted:
default:
ePalState = OtaPalImageStateInvalid;
break;
}
}
if( 0 != fclose( pstPlatformImageState ) ) /*lint !e586
* C standard library call is being used for portability. */
{
LogError( ( "Unable to close image state file.\r\n" ) );
ePalState = (OtaPalImageStateInvalid | ( errno & OTA_PAL_ERR_MASK ) );
}
}
else
{
/* If no image state file exists, assume a factory image. */
ePalState = OtaPalImageStateValid; /*lint !e64 Allow assignment. */
}
return ePalState; /*lint !e64 !e480 !e481 I/O calls and return type are used per design. */
}
/*-----------------------------------------------------------*/
/* Provide access to private members for testing. */
#ifdef FREERTOS_ENABLE_UNIT_TESTS
#include "aws_ota_pal_test_access_define.h"
#endif

View File

@ -0,0 +1,207 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file ota_pal.h
* @brief Function declarations for ota_ptal.c.
*/
#ifndef _OTA_PAL_H_
#define _OTA_PAL_H_
#include "ota.h"
//static const char signingcredentialSIGNING_CERTIFICATE_PEM[] = "Paste code signing certificate here.";
/**
* @brief Abort an OTA transfer.
*
* Aborts access to an existing open file represented by the OTA file context C. This is only valid
* for jobs that started successfully.
*
* @note The input OtaFileContext_t C is checked for NULL by the OTA agent before this
* function is called.
* This function may be called before the file is opened, so the file pointer C->fileHandle may be NULL
* when this function is called.
*
* @param[in] C OTA file context information.
*
* @return The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent
* error codes information in ota.h.
*
* The file pointer will be set to NULL after this function returns.
* OTA_ERR_NONE is returned when aborting access to the open file was successful.
* OTA_ERR_FILE_ABORT is returned when aborting access to the open file context was unsuccessful.
*/
OtaPalStatus_t otaPal_Abort( OtaFileContext_t * const C );
/**
* @brief Create a new receive file for the data chunks as they come in.
*
* @note Opens the file indicated in the OTA file context in the MCU file system.
*
* @note The previous image may be present in the designated image download partition or file, so the partition or file
* must be completely erased or overwritten in this routine.
*
* @note The input OtaFileContext_t C is checked for NULL by the OTA agent before this
* function is called.
* The device file path is a required field in the OTA job document, so C->pFilePath is
* checked for NULL by the OTA agent before this function is called.
*
* @param[in] C OTA file context information.
*
* @return The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent
* error codes information in ota.h.
*
* OTA_ERR_NONE is returned when file creation is successful.
* OTA_ERR_RX_FILE_TOO_LARGE is returned if the file to be created exceeds the device's non-volatile memory size constraints.
* OTA_ERR_BOOT_INFO_CREATE_FAILED is returned if the bootloader information file creation fails.
* OTA_ERR_RX_FILE_CREATE_FAILED is returned for other errors creating the file in the device's non-volatile memory.
*/
OtaPalStatus_t otaPal_CreateFileForRx( OtaFileContext_t * const C );
/* @brief Authenticate and close the underlying receive file in the specified OTA context.
*
* @note The input OtaFileContext_t C is checked for NULL by the OTA agent before this
* function is called. This function is called only at the end of block ingestion.
* prvPAL_CreateFileForRx() must succeed before this function is reached, so
* C->fileHandle(or C->pFile) is never NULL.
* The certificate path on the device is a required job document field in the OTA Agent,
* so C->pCertFilepath is never NULL.
* The file signature key is required job document field in the OTA Agent, so C->pSignature will
* never be NULL.
*
* If the signature verification fails, file close should still be attempted.
*
* @param[in] C OTA file context information.
*
* @return The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent
* error codes information in ota.h.
*
* OTA_ERR_NONE is returned on success.
* OTA_ERR_SIGNATURE_CHECK_FAILED is returned when cryptographic signature verification fails.
* OTA_ERR_BAD_SIGNER_CERT is returned for errors in the certificate itself.
* OTA_ERR_FILE_CLOSE is returned when closing the file fails.
*/
OtaPalStatus_t otaPal_CloseFile( OtaFileContext_t * const C );
/**
* @brief Write a block of data to the specified file at the given offset.
*
* @note The input OtaFileContext_t C is checked for NULL by the OTA agent before this
* function is called.
* The file pointer/handle C->pFile, is checked for NULL by the OTA agent before this
* function is called.
* pacData is checked for NULL by the OTA agent before this function is called.
* ulBlockSize is validated for range by the OTA agent before this function is called.
* ulBlockIndex is validated by the OTA agent before this function is called.
*
* @param[in] C OTA file context information.
* @param[in] ulOffset Byte offset to write to from the beginning of the file.
* @param[in] pacData Pointer to the byte array of data to write.
* @param[in] ulBlockSize The number of bytes to write.
*
* @return The number of bytes written on a success, or a negative error code from the platform abstraction layer.
*/
int16_t otaPal_WriteBlock( OtaFileContext_t * const C,
uint32_t ulOffset,
uint8_t * const pcData,
uint32_t ulBlockSize );
/**
* @brief Activate the newest MCU image received via OTA.
*
* This function shall do whatever is necessary to activate the newest MCU
* firmware received via OTA. It is typically just a reset of the device.
*
* @note This function SHOULD not return. If it does, the platform does not support
* an automatic reset or an error occurred.
*
* @return The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent
* error codes information in ota.h.
*/
OtaPalStatus_t otaPal_ActivateNewImage( OtaFileContext_t * const C );
/**
* @brief Reset the device.
*
* This function shall reset the MCU and cause a reboot of the system.
*
* @note This function SHOULD not return. If it does, the platform does not support
* an automatic reset or an error occurred.
*
* @return The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent
* error codes information in ota.h.
*/
OtaPalStatus_t otaPal_ResetDevice( OtaFileContext_t * const C );
/**
* @brief Attempt to set the state of the OTA update image.
*
* Do whatever is required by the platform to Accept/Reject the OTA update image (or bundle).
* Refer to the PAL implementation to determine what happens on your platform.
*
* @param[in] eState The desired state of the OTA update image.
*
* @return The OtaErr_t error code combined with the MCU specific error code. See ota.h for
* OTA major error codes and your specific PAL implementation for the sub error code.
*
* Major error codes returned are:
*
* OTA_ERR_NONE on success.
* OTA_ERR_BAD_IMAGE_STATE: if you specify an invalid OtaImageState_t. No sub error code.
* OTA_ERR_ABORT_FAILED: failed to roll back the update image as requested by OtaImageStateAborted.
* OTA_ERR_REJECT_FAILED: failed to roll back the update image as requested by OtaImageStateRejected.
* OTA_ERR_COMMIT_FAILED: failed to make the update image permanent as requested by OtaImageStateAccepted.
*/
OtaPalStatus_t otaPal_SetPlatformImageState( OtaFileContext_t * const C,
OtaImageState_t eState );
/**
* @brief Get the state of the OTA update image.
*
* We read this at OTA_Init time and when the latest OTA job reports itself in self
* test. If the update image is in the "pending commit" state, we start a self test
* timer to assure that we can successfully connect to the OTA services and accept
* the OTA update image within a reasonable amount of time (user configurable). If
* we don't satisfy that requirement, we assume there is something wrong with the
* firmware and automatically reset the device, causing it to roll back to the
* previously known working code.
*
* If the update image state is not in "pending commit," the self test timer is
* not started.
*
* @return An OtaPalImageState_t. One of the following:
* OtaPalImageStatePendingCommit (the new firmware image is in the self test phase)
* OtaPalImageStateValid (the new firmware image is already committed)
* OtaPalImageStateInvalid (the new firmware image is invalid or non-existent)
*
* NOTE: OtaPalImageStateUnknown should NEVER be returned and indicates an implementation error.
*/
OtaPalImageState_t otaPal_GetPlatformImageState( OtaFileContext_t * const C );
#endif /* ifndef _OTA_PAL_H_ */

View File

@ -0,0 +1,170 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file subscription_manager.c
* @brief Functions for managing MQTT subscriptions.
*/
/* Standard includes. */
#include <string.h>
/* Subscription manager header include. */
#include "subscription_manager.h"
bool addSubscription( SubscriptionElement_t * pxSubscriptionList,
const char * pcTopicFilterString,
uint16_t usTopicFilterLength,
IncomingPubCallback_t pxIncomingPublishCallback,
void * pvIncomingPublishCallbackContext )
{
int32_t lIndex = 0;
size_t xAvailableIndex = SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS;
bool xReturnStatus = false;
if( ( pxSubscriptionList == NULL ) ||
( pcTopicFilterString == NULL ) ||
( usTopicFilterLength == 0U ) ||
( pxIncomingPublishCallback == NULL ) )
{
LogError( ( "Invalid parameter. pxSubscriptionList=%p, pcTopicFilterString=%p,"
" usTopicFilterLength=%u, pxIncomingPublishCallback=%p.",
pxSubscriptionList,
pcTopicFilterString,
( unsigned int ) usTopicFilterLength,
pxIncomingPublishCallback ) );
}
else
{
/* Start at end of array, so that we will insert at the first available index.
* Scans backwards to find duplicates. */
for( lIndex = ( int32_t ) SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS - 1; lIndex >= 0; lIndex-- )
{
if( pxSubscriptionList[ lIndex ].usFilterStringLength == 0 )
{
xAvailableIndex = lIndex;
}
else if( ( pxSubscriptionList[ lIndex ].usFilterStringLength == usTopicFilterLength ) &&
( strncmp( pcTopicFilterString, pxSubscriptionList[ lIndex ].pcSubscriptionFilterString, ( size_t ) usTopicFilterLength ) == 0 ) )
{
/* If a subscription already exists, don't do anything. */
if( ( pxSubscriptionList[ lIndex ].pxIncomingPublishCallback == pxIncomingPublishCallback ) &&
( pxSubscriptionList[ lIndex ].pvIncomingPublishCallbackContext == pvIncomingPublishCallbackContext ) )
{
LogWarn( ( "Subscription already exists.\n" ) );
xAvailableIndex = SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS;
xReturnStatus = true;
break;
}
}
}
if( xAvailableIndex < SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS )
{
pxSubscriptionList[ xAvailableIndex ].pcSubscriptionFilterString = pcTopicFilterString;
pxSubscriptionList[ xAvailableIndex ].usFilterStringLength = usTopicFilterLength;
pxSubscriptionList[ xAvailableIndex ].pxIncomingPublishCallback = pxIncomingPublishCallback;
pxSubscriptionList[ xAvailableIndex ].pvIncomingPublishCallbackContext = pvIncomingPublishCallbackContext;
xReturnStatus = true;
}
}
return xReturnStatus;
}
/*-----------------------------------------------------------*/
void removeSubscription( SubscriptionElement_t * pxSubscriptionList,
const char * pcTopicFilterString,
uint16_t usTopicFilterLength )
{
int32_t lIndex = 0;
if( ( pxSubscriptionList == NULL ) ||
( pcTopicFilterString == NULL ) ||
( usTopicFilterLength == 0U ) )
{
LogError( ( "Invalid parameter. pxSubscriptionList=%p, pcTopicFilterString=%p,"
" usTopicFilterLength=%u.",
pxSubscriptionList,
pcTopicFilterString,
( unsigned int ) usTopicFilterLength ) );
}
else
{
for( lIndex = 0; lIndex < SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS; lIndex++ )
{
if( pxSubscriptionList[ lIndex ].usFilterStringLength == usTopicFilterLength )
{
if( strncmp( pxSubscriptionList[ lIndex ].pcSubscriptionFilterString, pcTopicFilterString, usTopicFilterLength ) == 0 )
{
memset( &( pxSubscriptionList[ lIndex ] ), 0x00, sizeof( SubscriptionElement_t ) );
}
}
}
}
}
/*-----------------------------------------------------------*/
bool handleIncomingPublishes( SubscriptionElement_t * pxSubscriptionList,
MQTTPublishInfo_t * pxPublishInfo )
{
int32_t lIndex = 0;
bool isMatched = false, publishHandled = false;
if( ( pxSubscriptionList == NULL ) ||
( pxPublishInfo == NULL ) )
{
LogError( ( "Invalid parameter. pxSubscriptionList=%p, pxPublishInfo=%p,",
pxSubscriptionList,
pxPublishInfo ) );
}
else
{
for( lIndex = 0; lIndex < SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS; lIndex++ )
{
if( pxSubscriptionList[ lIndex ].usFilterStringLength > 0 )
{
MQTT_MatchTopic( pxPublishInfo->pTopicName,
pxPublishInfo->topicNameLength,
pxSubscriptionList[ lIndex ].pcSubscriptionFilterString,
pxSubscriptionList[ lIndex ].usFilterStringLength,
&isMatched );
if( isMatched == true )
{
pxSubscriptionList[ lIndex ].pxIncomingPublishCallback( pxSubscriptionList[ lIndex ].pvIncomingPublishCallbackContext,
pxPublishInfo );
publishHandled = true;
}
}
}
}
return publishHandled;
}

View File

@ -0,0 +1,150 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file subscription_manager.h
* @brief Functions for managing MQTT subscriptions.
*/
#ifndef SUBSCRIPTION_MANAGER_H
#define SUBSCRIPTION_MANAGER_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Logging related header files are required to be included in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL.
* 3. Include the header file "logging_stack.h".
*/
/* Include header that defines log levels. */
#include "logging_levels.h"
/* Logging configuration for the Subscription Manager module. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "Subscription Manager"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_ERROR
#endif
#include "logging_stack.h"
/* Demo config include. */
#include "demo_config.h"
/* core MQTT include. */
#include "core_mqtt.h"
/**
* @brief Maximum number of subscriptions maintained by the subscription manager
* simultaneously in a list.
*/
#ifndef SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS
#define SUBSCRIPTION_MANAGER_MAX_SUBSCRIPTIONS 10U
#endif
/**
* @brief Callback function called when receiving a publish.
*
* @param[in] pvIncomingPublishCallbackContext The incoming publish callback context.
* @param[in] pxPublishInfo Deserialized publish information.
*/
typedef void (* IncomingPubCallback_t )( void * pvIncomingPublishCallbackContext,
MQTTPublishInfo_t * pxPublishInfo );
/**
* @brief An element in the list of subscriptions.
*
* This subscription manager implementation expects that the array of the
* subscription elements used for storing subscriptions to be initialized to 0.
*
* @note This implementation allows multiple tasks to subscribe to the same topic.
* In this case, another element is added to the subscription list, differing
* in the intended publish callback. Also note that the topic filters are not
* copied in the subscription manager and hence the topic filter strings need to
* stay in scope until unsubscribed.
*/
typedef struct subscriptionElement
{
IncomingPubCallback_t pxIncomingPublishCallback;
void * pvIncomingPublishCallbackContext;
uint16_t usFilterStringLength;
const char * pcSubscriptionFilterString;
} SubscriptionElement_t;
/**
* @brief Add a subscription to the subscription list.
*
* @note Multiple tasks can be subscribed to the same topic with different
* context-callback pairs. However, a single context-callback pair may only be
* associated to the same topic filter once.
*
* @param[in] pxSubscriptionList The pointer to the subscription list array.
* @param[in] pcTopicFilterString Topic filter string of subscription.
* @param[in] usTopicFilterLength Length of topic filter string.
* @param[in] pxIncomingPublishCallback Callback function for the subscription.
* @param[in] pvIncomingPublishCallbackContext Context for the subscription callback.
*
* @return `true` if subscription added or exists, `false` if insufficient memory.
*/
bool addSubscription( SubscriptionElement_t * pxSubscriptionList,
const char * pcTopicFilterString,
uint16_t usTopicFilterLength,
IncomingPubCallback_t pxIncomingPublishCallback,
void * pvIncomingPublishCallbackContext );
/**
* @brief Remove a subscription from the subscription list.
*
* @note If the topic filter exists multiple times in the subscription list,
* then every instance of the subscription will be removed.
*
* @param[in] pxSubscriptionList The pointer to the subscription list array.
* @param[in] pcTopicFilterString Topic filter of subscription.
* @param[in] usTopicFilterLength Length of topic filter.
*/
void removeSubscription( SubscriptionElement_t * pxSubscriptionList,
const char * pcTopicFilterString,
uint16_t usTopicFilterLength );
/**
* @brief Handle incoming publishes by invoking the callbacks registered
* for the incoming publish's topic filter.
*
* @param[in] pxSubscriptionList The pointer to the subscription list array.
* @param[in] pxPublishInfo Info of incoming publish.
*
* @return `true` if an application callback could be invoked;
* `false` otherwise.
*/
bool handleIncomingPublishes( SubscriptionElement_t * pxSubscriptionList,
MQTTPublishInfo_t * pxPublishInfo );
#endif /* SUBSCRIPTION_MANAGER_H */

View File

@ -0,0 +1,249 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{4be4e103-5bf4-4a85-9656-ec20852a2b8e}</ProjectGuid>
<RootNamespace>OtaOverHttpDemo</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;_DEBUG;_CONSOLE;WIN32;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\Common\HTTP_Utils;..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;WIN32;NDEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\Common\HTTP_Utils;..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;_DEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\Common\HTTP_Utils;..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;NDEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\Common\HTTP_Utils;..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\coreHTTP\coreHTTP.vcxproj">
<Project>{ee39fa0f-cefb-4c29-a571-05a28fdd47fd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\FreeRTOS+TCP\FreeRTOS+TCP.vcxproj">
<Project>{c90e6cc5-818b-4c97-8876-0986d989387c}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\FreeRTOS-Kernel\FreeRTOS-Kernel.vcxproj">
<Project>{72c209c4-49a4-4942-a201-44706c9d77ec}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\Logging\Logging.vcxproj">
<Project>{be362ac0-b10b-4276-b84e-6304652ba228}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\MbedTLS\MbedTLS.vcxproj">
<Project>{e1016f3e-94e9-4864-9fd8-1d7c1fefbfd7}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\ports\freertos_plus_tcp\tcp_sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_base64.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_cbor.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_http.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_interface.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder_close_container_checked.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborerrorstrings.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser_dup_string.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty_stdio.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborvalidation.c" />
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c" />
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_command_pool.c" />
<ClCompile Include="..\Common\HTTP_Utils\http_demo_utils.c" />
<ClCompile Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification_mbedtls.c" />
<ClCompile Include="..\Common\Ota_PAL\Win32\ota_pal.c" />
<ClCompile Include="..\Common\subscription-manager\subscription_manager.c" />
<ClCompile Include="DemoTasks\OtaOverHttpDemoExample.c" />
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_message_interface.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include\tcp_sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_appversion32.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_base64_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_cbor_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_interface_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_os_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_platform_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.h" />
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cbor.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborinternal_p.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborjson.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\compilersupport_p.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\tinycbor-version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\utf8_p.h" />
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h" />
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_command_pool.h" />
<ClInclude Include="..\Common\HTTP_Utils\http_demo_utils.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\aws_ota_codesigner_certificate.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\ota_pal.h" />
<ClInclude Include="..\Common\subscription-manager\subscription_manager.h" />
<ClInclude Include="core_mqtt_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="ota_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Additional Network Transport Files">
<UniqueIdentifier>{d8a6eab8-52e5-4e4f-a9b9-cd5d8eb3454a}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries">
<UniqueIdentifier>{18d8589f-6af4-4627-b7fe-e1c9bdfecdd8}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA">
<UniqueIdentifier>{6eb6582b-1dce-411e-bc0b-841a09741615}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\Backoff Algorithm">
<UniqueIdentifier>{3d266f56-5fd1-4585-9a72-3eef3ee1ee53}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreJSON">
<UniqueIdentifier>{96471440-eb47-4085-a08f-8576fa6fac34}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT">
<UniqueIdentifier>{4e394147-c8cd-4245-b188-0b4827b1875e}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT-Agent">
<UniqueIdentifier>{4e2b22e6-880f-40a0-8b4e-be5e8d3471b2}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\TinyCBOR">
<UniqueIdentifier>{228e794f-fa2d-44ec-ad49-95d6820434a2}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA\portable">
<UniqueIdentifier>{71c883e5-7eb1-44fe-bbcb-5a2b6c3e4d15}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA\include">
<UniqueIdentifier>{b3aeb9e5-1b4f-4652-b24a-49a8c406113e}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\Backoff Algorithm\include">
<UniqueIdentifier>{163f3bc7-7054-4400-8c9e-7f8ac07307f8}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreJSON\include">
<UniqueIdentifier>{6db5c3a5-4750-40b1-9c8c-38e90fa37f9a}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT\include">
<UniqueIdentifier>{2e0ccf6e-a4ca-4349-93ed-5eafa843095b}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT\interface">
<UniqueIdentifier>{a8c75d87-1984-4285-af5c-15146e3dba37}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT-Agent\include">
<UniqueIdentifier>{5e99c65f-35d7-4c3d-9055-9c7759e6f26b}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\TinyCBOR\include">
<UniqueIdentifier>{d90df1a1-4234-4da5-b3c3-46aa7947a06d}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files">
<UniqueIdentifier>{b4d0329a-2859-4ba6-a690-ce91db59b325}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL">
<UniqueIdentifier>{86c10d39-5f4e-4818-aad7-c565dd268bef}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\Code Signature Verification MbedTLS">
<UniqueIdentifier>{a563c8c2-aada-4f3e-b77a-43db3cf9e26e}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\include">
<UniqueIdentifier>{b89e35af-5342-46c6-84f2-24aa5761e368}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\Code Signature Verification MbedTLS\include">
<UniqueIdentifier>{ed32e5c5-0bcb-49b9-9328-7b01d3becdf3}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\coreMQTT Agent Interface">
<UniqueIdentifier>{d1acbc8c-cc4d-4c81-8ee0-a68922cc6f1a}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\coreMQTT Agent Interface\include">
<UniqueIdentifier>{9df90bb5-248f-42cb-8a1c-4b657078898e}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{2638c698-6c61-4539-a1d6-778586efb3a4}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper">
<UniqueIdentifier>{db1fff46-e0ac-434a-afbd-fed44d1efcbb}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport">
<UniqueIdentifier>{0bac4135-5620-46bf-97bc-650637aa824b}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport\include">
<UniqueIdentifier>{8c7c47a6-bb49-46a0-b804-f569d3dca0f0}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper\include">
<UniqueIdentifier>{d491829c-c97e-4f26-84f4-ebabe1cf94b7}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper\ports">
<UniqueIdentifier>{1c33fa66-1e0e-45c6-98ad-29b3072f189e}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper\ports\freertos_plus_tcp">
<UniqueIdentifier>{691f4cfe-af00-47b6-bc4b-f988da6bedc3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="DemoTasks\OtaOverHttpDemoExample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Common\subscription-manager\subscription_manager.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_base64.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_cbor.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_http.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_interface.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_mqtt.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.c">
<Filter>Additional Libraries\AWS IoT OTA\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>Additional Libraries\Backoff Algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>Additional Libraries\coreJSON</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c">
<Filter>Additional Libraries\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c">
<Filter>Additional Libraries\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder_close_container_checked.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborerrorstrings.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser_dup_string.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty_stdio.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborvalidation.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\ota_pal.c">
<Filter>Port Files\OTA PAL</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification_mbedtls.c">
<Filter>Port Files\OTA PAL\Code Signature Verification MbedTLS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c">
<Filter>Port Files\coreMQTT Agent Interface</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_command_pool.c">
<Filter>Port Files\coreMQTT Agent Interface</Filter>
</ClCompile>
<ClCompile Include="..\Common\HTTP_Utils\http_demo_utils.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\ports\freertos_plus_tcp\tcp_sockets_wrapper.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper\ports\freertos_plus_tcp</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common\subscription-manager\subscription_manager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.h">
<Filter>Additional Libraries\AWS IoT OTA\portable</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_appversion32.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_base64_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_cbor_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_config_defaults.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_interface_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_os_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_platform_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>Additional Libraries\Backoff Algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>Additional Libraries\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>Additional Libraries\coreMQTT\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_message_interface.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cbor.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborinternal_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborjson.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\compilersupport_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\tinycbor-version.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\utf8_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\ota_pal.h">
<Filter>Port Files\OTA PAL\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification.h">
<Filter>Port Files\OTA PAL\Code Signature Verification MbedTLS\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h">
<Filter>Port Files\coreMQTT Agent Interface\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_command_pool.h">
<Filter>Port Files\coreMQTT Agent Interface\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\HTTP_Utils\http_demo_utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\aws_ota_codesigner_certificate.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="ota_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include\tcp_sockets_wrapper.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,109 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#ifndef CORE_MQTT_CONFIG_H
#define CORE_MQTT_CONFIG_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Include logging header files and define logging macros in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
* the logging configuration for MQTT.
* 3. Include the header file "logging_stack.h", if logging is enabled for MQTT.
*/
#include "logging_levels.h"
/* Logging configuration for the MQTT library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "MQTT"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_ERROR
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief The maximum number of MQTT PUBLISH messages that may be pending
* acknowledgement at any time.
*
* QoS 1 and 2 MQTT PUBLISHes require acknowledgment from the server before
* they can be completed. While they are awaiting the acknowledgment, the
* client must maintain information about their state. The value of this
* macro sets the limit on how many simultaneous PUBLISH states an MQTT
* context maintains.
*/
#define MQTT_STATE_ARRAY_MAX_COUNT 10U
/*********************** coreMQTT Agent Configurations **********************/
/**
* @brief The maximum number of pending acknowledgments to track for a single
* connection.
*
* @note The MQTT agent tracks MQTT commands (such as PUBLISH and SUBSCRIBE) th
* at are still waiting to be acknowledged. MQTT_AGENT_MAX_OUTSTANDING_ACKS set
* the maximum number of acknowledgments that can be outstanding at any one time.
* The higher this number is the greater the agent's RAM consumption will be.
*/
#define MQTT_AGENT_MAX_OUTSTANDING_ACKS ( 20U )
/**
* @brief Time in MS that the MQTT agent task will wait in the Blocked state (so
* not using any CPU time) for a command to arrive in its command queue before
* exiting the blocked state so it can call MQTT_ProcessLoop().
*
* @note It is important MQTT_ProcessLoop() is called often if there is known
* MQTT traffic, but calling it too often can take processing time away from
* lower priority tasks and waste CPU time and power.
*/
#define MQTT_AGENT_MAX_EVENT_QUEUE_WAIT_TIME ( 1000 )
/**
* @brief The number of command structures to allocate in the pool
* for the agent.
*/
#define MQTT_COMMAND_CONTEXTS_POOL_SIZE 10
#endif /* ifndef CORE_MQTT_CONFIG_H */

View File

@ -0,0 +1,326 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#ifndef DEMO_CONFIG_H
#define DEMO_CONFIG_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Include logging header files and define logging macros in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
* the logging configuration for DEMO.
* 3. Include the header file "logging_stack.h", if logging is enabled for DEMO.
*/
#include "logging_levels.h"
/* Logging configuration for the Demo. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "OTADemo"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_DEBUG
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief The version for the firmware which is running. OTA agent uses this
* version number to perform anti-rollback validation. The firmware version for the
* download image should be higher than the current version, otherwise the new image is
* rejected in self test phase.
*/
#define APP_VERSION_MAJOR 0
#define APP_VERSION_MINOR 9
#define APP_VERSION_BUILD 2
/**
* @brief The MQTT client identifier used in this example. Each client identifier
* must be unique so edit as required to ensure no two clients connecting to the
* same broker use the same client identifier.
*
*!!! Please note a #defined constant is used for convenience of demonstration
*!!! only. Production devices can use something unique to the device that can
*!!! be read by software, such as a production serial number, instead of a
*!!! hard coded constant.
*
* #define democonfigCLIENT_IDENTIFIER "...insert here..."
*/
#define democonfigCLIENT_IDENTIFIER "...insert here..."
/**
* @brief Endpoint of the MQTT broker to connect to.
*
* This demo application can be run with any MQTT broker, although it is
* recommended to use one that supports mutual authentication. If mutual
* authentication is not used, then #democonfigUSE_TLS should be set to 0.
*
* For AWS IoT MQTT broker, this is the Thing's REST API Endpoint.
*
* @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
* Settings/Custom Endpoint, or using the describe-endpoint REST API (with
* AWS CLI command line tool).
*
* #define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
*/
#define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections, and port 1883 if not
* using TLS.
*
* @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
* name. Using ALPN with this demo would require additional changes, including
* setting the `pAlpnProtos` member of the `NetworkCredentials_t` struct before
* forming the TLS connection. When using port 8883, ALPN is not required.
*
* #define democonfigMQTT_BROKER_PORT ( insert here. )
*/
#define democonfigMQTT_BROKER_PORT ( 8883 )
/**
* @brief Server's root CA certificate.
*
* For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT
* server and is publicly available. Refer to the AWS documentation available
* in the link below.
* https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs
*
* @note This certificate should be PEM-encoded.
*
* @note If you would like to setup an MQTT broker for running this demo,
* please see `mqtt_broker_setup.txt`.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigROOT_CA_PEM "...insert here..."
*/
/**
* @brief Client certificate.
*
* For AWS IoT MQTT broker, refer to the AWS documentation below for details
* regarding client authentication.
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This certificate should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigCLIENT_CERTIFICATE_PEM "...insert here..."
*/
/**
* @brief Client's private key.
*
*!!! Please note pasting a key into the header file in this manner is for
*!!! convenience of demonstration only and should not be done in production.
*!!! Never paste a production private key here!. Production devices should
*!!! store keys securely, such as within a secure element. Additionally,
*!!! we provide the corePKCS library that further enhances security by
*!!! enabling securely stored keys to be used without exposing them to
*!!! software.
*
* For AWS IoT MQTT broker, refer to the AWS documentation below for details
* regarding clientauthentication.
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This private key should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN RSA PRIVATE KEY-----\n"\
* "...base64 data...\n"\
* "-----END RSA PRIVATE KEY-----\n"
*
* #define democonfigCLIENT_PRIVATE_KEY_PEM "...insert here..."
*/
/*
* @brief Server's root CA certificate for TLS authentication with S3.
*
* The Amazon Root CA Certificate is defined below.
*
* @note This certificate should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
*/
#ifndef democonfigHTTPS_ROOT_CA_PEM
#define democonfigHTTPS_ROOT_CA_PEM \
"-----BEGIN CERTIFICATE-----\n" \
"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \
"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \
"b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n" \
"MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" \
"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" \
"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" \
"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" \
"IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" \
"VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" \
"93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" \
"jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" \
"AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" \
"A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" \
"U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" \
"N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" \
"o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" \
"5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \
"rqXRfboQnoZsG4q5WTP468SQvvG5\n" \
"-----END CERTIFICATE-----\n"
#endif /* ifndef democonfigHTTPS_ROOT_CA_PEM */
/**
* @brief AWS IoT Core server port number for HTTPS connections.
*
* For this demo, an X.509 certificate is used to verify the client.
*
* @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
* name being x-amzn-http-ca. When using port 8443, ALPN is not required.
*/
#define democonfigHTTPS_PORT 443
/**
* @brief An option to disable Server Name Indication.
*
* @note When using a local Mosquitto server setup, SNI needs to be disabled
* for an MQTT broker that only has an IP address but no hostname. However,
* SNI should be enabled whenever possible.
*/
#define democonfigDISABLE_SNI ( pdFALSE )
/**
* @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker.
*
* If username/password based authentication is used, the demo will use appropriate TLS ALPN and
* SNI configurations as required for the Custom Authentication feature of AWS IoT.
* For more information, refer to the following documentation:
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt
*
* #define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
*/
#define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
/**
* @brief The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_USERNAME "...insert here..."
*/
/**
* @brief The password value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_PASSWORD "...insert here..."
*/
/**
* @brief The name of the operating system that the application is running on.
* The current value is given as an example. Please update for your specific
* operating system.
*/
#define democonfigOS_NAME "FreeRTOS"
/**
* @brief The version of the operating system that the application is running
* on. The current value is given as an example. Please update for your specific
* operating system version.
*/
#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER
/**
* @brief The name of the hardware platform the application is running on. The
* current value is given as an example. Please update for your specific
* hardware platform.
*/
#define democonfigHARDWARE_PLATFORM_NAME "WinSim"
/**
* @brief The name of the MQTT library used and its version, following an "@"
* symbol.
*/
#define democonfigMQTT_LIB "core-mqtt@1.0.0"
/**
* @brief Whether to use mutual authentication. If this macro is not set to 1
* or not defined, then plaintext TCP will be used instead of TLS over TCP.
*/
#define democonfigUSE_TLS 1
/**
* @brief Set the stack size of the main demo task.
*
* In the Windows port, this stack only holds a structure. The actual
* stack is created by an operating system thread.
*/
#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,83 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/***
* See https://www.FreeRTOS.org/coremqtt for configuration and usage instructions.
***/
/* Standard includes. */
#include <stdio.h>
#include <time.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*-----------------------------------------------------------*/
extern void vOtaDemoTask( void * pvParameters );
extern void vPlatformInitIpStack( void );
/*-----------------------------------------------------------*/
int main( void )
{
vPlatformInitLogging();
xTaskCreate( vOtaDemoTask, /* Function that implements the task. */
"OTA Demo Task", /* Text name for the task - only used for debugging. */
democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */
NULL, /* Optional - task parameter - not used in this case. */
tskIDLE_PRIORITY + 1, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */
NULL ); /* Optional - used to pass out a handle to the created task. */
/* Initialize the FreeRTOS+TCP Stack */
vPlatformInitIpStack();
/* Start the RTOS scheduler. */
vTaskStartScheduler();
/* If all is well, the scheduler will now be running, and the following
* line will never be reached. If the following line does execute, then
* there was insufficient FreeRTOS heap memory available for the idle and/or
* timer tasks to be created. See the memory management section on the
* FreeRTOS web site for more details.
*/
for( ; ; )
{
configASSERT( pdFALSE );
}
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,200 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file ota_config.h
* @brief OTA user configurable settings.
*/
#ifndef OTA_CONFIG_H_
#define OTA_CONFIG_H_
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Logging related header files are required to be included in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL.
* 3. Include the header file "logging_stack.h".
*/
/* Include header that defines log levels. */
#include "logging_levels.h"
/* Configure name and log level for the OTA library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "OTA"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief Log base 2 of the size of the file data block message (excluding the header).
*
* 10 bits yields a data block size of 1KB.
*/
#define otaconfigLOG2_FILE_BLOCK_SIZE 11UL
/**
* @brief Size of the file data block message (excluding the header).
*
*/
#define otaconfigFILE_BLOCK_SIZE ( 1UL << otaconfigLOG2_FILE_BLOCK_SIZE )
/**
* @brief Milliseconds to wait for the self test phase to succeed before we force reset.
*/
#define otaconfigSELF_TEST_RESPONSE_WAIT_MS 16000U
/**
* @brief Milliseconds to wait before requesting data blocks from the OTA service if nothing is happening.
*
* The wait timer is reset whenever a data block is received from the OTA service so we will only send
* the request message after being idle for this amount of time.
*/
#define otaconfigFILE_REQUEST_WAIT_MS 10000U
/**
* @brief The maximum allowed length of the thing name used by the OTA agent.
*
* AWS IoT requires Thing names to be unique for each device that connects to the broker.
* Likewise, the OTA agent requires the developer to construct and pass in the Thing name when
* initializing the OTA agent. The agent uses this size to allocate static storage for the
* Thing name used in all OTA base topics. Namely $aws/things/<thingName>
*/
#define otaconfigMAX_THINGNAME_LEN 128U
/**
* @brief The maximum number of data blocks requested from OTA streaming service.
*
* This configuration parameter is sent with data requests and represents the maximum number of
* data blocks the service will send in response. The maximum limit for this must be calculated
* from the maximum data response limit (128 KB from service) divided by the block size.
* For example if block size is set as 1 KB then the maximum number of data blocks that we can
* request is 128/1 = 128 blocks. Configure this parameter to this maximum limit or lower based on
* how many data blocks response is expected for each data requests.
* Please note that this must be set larger than zero.
*
*/
#define otaconfigMAX_NUM_BLOCKS_REQUEST 4U
/**
* @brief The maximum number of requests allowed to send without a response before we abort.
*
* This configuration parameter sets the maximum number of times the requests are made over
* the selected communication channel before aborting and returning error.
*
*/
#define otaconfigMAX_NUM_REQUEST_MOMENTUM 32U
/**
* @brief The number of data buffers reserved by the OTA agent.
*
* This configurations parameter sets the maximum number of static data buffers used by
* the OTA agent for job and file data blocks received.
*/
#define otaconfigMAX_NUM_OTA_DATA_BUFFERS 5U
/**
* @brief How frequently the device will report its OTA progress to the cloud.
*
* Device will update the job status with the number of blocks it has received every certain
* number of blocks it receives. For example, 25 means device will update job status every 25 blocks
* it receives.
*/
#define otaconfigOTA_UPDATE_STATUS_FREQUENCY 25U
/**
* @brief Allow update to same or lower version.
*
* Set this to 1 to allow downgrade or same version update.This configurations parameter
* disables version check and allows update to a same or lower version.This is provided for
* testing purpose and it is recommended to always update to higher version and keep this
* configuration disabled.
*/
#define otaconfigAllowDowngrade 0U
/**
* @brief The protocol selected for OTA control operations.
*
* This configurations parameter sets the default protocol for all the OTA control
* operations like requesting OTA job, updating the job status etc.
*
* Note - Only MQTT is supported at this time for control operations.
*/
#define configENABLED_CONTROL_PROTOCOL ( OTA_CONTROL_OVER_MQTT )
/**
* @brief The protocol selected for OTA data operations.
*
* This configurations parameter sets the protocols selected for the data operations
* like requesting file blocks from the service.
*
* Note - Both MQTT and HTTP is supported for data transfer from service. This configuration parameter
* can be set to following -
* Enable data over MQTT - ( OTA_DATA_OVER_MQTT )
* Enable data over HTTP - ( OTA_DATA_OVER_HTTP)
*
* Note - Please check the OTA over MQTT demo which has the MQTT data transfer functionality and
* and this configuration is set to OTA_DATA_OVER_MQTT.
*/
#define configENABLED_DATA_PROTOCOLS ( OTA_DATA_OVER_HTTP )
/**
* @brief The preferred protocol selected for OTA data operations.
*
* Primary data protocol will be the protocol used for downloading file if more than
* one protocol is selected while creating OTA job. Default primary data protocol is MQTT
* and following update here to switch to HTTP as primary.
*
* Note - use OTA_DATA_OVER_HTTP for HTTP as primary data protocol.
*/
#define configOTA_PRIMARY_DATA_PROTOCOL ( OTA_DATA_OVER_HTTP )
#endif /* OTA_CONFIG_H_ */

View File

@ -0,0 +1,116 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ota_Over_Http_Demo", "Ota_Over_Http_Demo.vcxproj", "{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Statically Linked Libraries", "Statically Linked Libraries", "{9799AFF4-25E2-43CD-8829-C066177E3748}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeRTOS+TCP", "..\..\..\..\VisualStudio_StaticProjects\FreeRTOS+TCP\FreeRTOS+TCP.vcxproj", "{C90E6CC5-818B-4C97-8876-0986D989387C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ww", "..\..\..\..\VisualStudio_StaticProjects\FreeRTOS-Kernel\FreeRTOS-Kernel.vcxproj", "{72C209C4-49A4-4942-A201-44706C9D77EC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Logging", "..\..\..\..\VisualStudio_StaticProjects\Logging\Logging.vcxproj", "{BE362AC0-B10B-4276-B84E-6304652BA228}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MbedTLS", "..\..\..\..\VisualStudio_StaticProjects\MbedTLS\MbedTLS.vcxproj", "{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "coreHTTP", "..\..\..\..\VisualStudio_StaticProjects\coreHTTP\coreHTTP.vcxproj", "{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|Win32.ActiveCfg = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|Win32.Build.0 = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x64.ActiveCfg = Debug|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x64.Build.0 = Debug|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x86.ActiveCfg = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x86.Build.0 = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|Win32.ActiveCfg = Release|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|Win32.Build.0 = Release|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x64.ActiveCfg = Release|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x64.Build.0 = Release|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x86.ActiveCfg = Release|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x86.Build.0 = Release|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|Win32.ActiveCfg = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|Win32.Build.0 = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x64.ActiveCfg = Debug|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x64.Build.0 = Debug|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x86.ActiveCfg = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x86.Build.0 = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|Win32.ActiveCfg = Release|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|Win32.Build.0 = Release|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.ActiveCfg = Release|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.Build.0 = Release|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x86.ActiveCfg = Release|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x86.Build.0 = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|Win32.ActiveCfg = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|Win32.Build.0 = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x64.ActiveCfg = Debug|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x64.Build.0 = Debug|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x86.ActiveCfg = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x86.Build.0 = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|Win32.ActiveCfg = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|Win32.Build.0 = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.ActiveCfg = Release|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.Build.0 = Release|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x86.ActiveCfg = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x86.Build.0 = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|Win32.ActiveCfg = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|Win32.Build.0 = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x64.ActiveCfg = Debug|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x64.Build.0 = Debug|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x86.ActiveCfg = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x86.Build.0 = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|Win32.ActiveCfg = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|Win32.Build.0 = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x64.ActiveCfg = Release|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x64.Build.0 = Release|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x86.ActiveCfg = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x86.Build.0 = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|Win32.ActiveCfg = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|Win32.Build.0 = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x64.ActiveCfg = Debug|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x64.Build.0 = Debug|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x86.ActiveCfg = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x86.Build.0 = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|Win32.ActiveCfg = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|Win32.Build.0 = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x64.ActiveCfg = Release|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x64.Build.0 = Release|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x86.ActiveCfg = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x86.Build.0 = Release|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|Win32.ActiveCfg = Debug|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|Win32.Build.0 = Debug|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|x64.ActiveCfg = Debug|x64
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|x64.Build.0 = Debug|x64
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|x86.ActiveCfg = Debug|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Debug|x86.Build.0 = Debug|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|Win32.ActiveCfg = Release|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|Win32.Build.0 = Release|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|x64.ActiveCfg = Release|x64
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|x64.Build.0 = Release|x64
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|x86.ActiveCfg = Release|Win32
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C90E6CC5-818B-4C97-8876-0986D989387C} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{72C209C4-49A4-4942-A201-44706C9D77EC} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{BE362AC0-B10B-4276-B84E-6304652BA228} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{EE39FA0F-CEFB-4C29-A571-05A28FDD47FD} = {9799AFF4-25E2-43CD-8829-C066177E3748}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03800DFF-BAFA-4654-8E51-C4E654A54416}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,245 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{4be4e103-5bf4-4a85-9656-ec20852a2b8e}</ProjectGuid>
<RootNamespace>OtaOverMqttDemo</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Ota_Over_Mqtt_Demo</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>RTOSDemo</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;_DEBUG;_CONSOLE;WIN32;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h"</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;WIN32;NDEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h"</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;_DEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h"</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG;WIN32;__little_endian__=1;NDEBUG;_CONSOLE;MBEDTLS_CONFIG_FILE="mbedtls_config_v3.2.1.h"</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include;..\..\..\..\Source\Application-Protocols\network_transport;..\..\..\Common\coreMQTT_Agent_Interface\include;..\..\..\..\ThirdParty\tinycbor\src;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\AWS\ota\source\include;..\..\..\..\Source\AWS\ota\source\portable\os;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\Common\Ota_PAL\Win32\Code_Signature_Verification;..\Common\Ota_PAL\Win32;..\Common\subscription-manager;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\FreeRTOS+TCP\FreeRTOS+TCP.vcxproj">
<Project>{c90e6cc5-818b-4c97-8876-0986d989387c}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\FreeRTOS-Kernel\FreeRTOS-Kernel.vcxproj">
<Project>{72c209c4-49a4-4942-a201-44706c9d77ec}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\Logging\Logging.vcxproj">
<Project>{be362ac0-b10b-4276-b84e-6304652ba228}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\VisualStudio_StaticProjects\MbedTLS\MbedTLS.vcxproj">
<Project>{e1016f3e-94e9-4864-9fd8-1d7c1fefbfd7}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\ports\freertos_plus_tcp\tcp_sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_base64.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_cbor.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_http.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_interface.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder_close_container_checked.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborerrorstrings.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser_dup_string.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty_stdio.c" />
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborvalidation.c" />
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c" />
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_command_pool.c" />
<ClCompile Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification_mbedtls.c" />
<ClCompile Include="..\Common\Ota_PAL\Win32\ota_pal.c" />
<ClCompile Include="..\Common\subscription-manager\subscription_manager.c" />
<ClCompile Include="DemoTasks\OtaOverMqttDemoExample.c" />
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_message_interface.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include\tcp_sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_appversion32.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_base64_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_cbor_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_interface_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_os_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_platform_interface.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_private.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.h" />
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cbor.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborinternal_p.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborjson.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\compilersupport_p.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\tinycbor-version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\utf8_p.h" />
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h" />
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_command_pool.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\aws_ota_codesigner_certificate.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification.h" />
<ClInclude Include="..\Common\Ota_PAL\Win32\ota_pal.h" />
<ClInclude Include="..\Common\subscription-manager\subscription_manager.h" />
<ClInclude Include="core_mqtt_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="ota_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,330 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Additional Network Transport Files">
<UniqueIdentifier>{d8a6eab8-52e5-4e4f-a9b9-cd5d8eb3454a}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries">
<UniqueIdentifier>{18d8589f-6af4-4627-b7fe-e1c9bdfecdd8}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA">
<UniqueIdentifier>{6eb6582b-1dce-411e-bc0b-841a09741615}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\Backoff Algorithm">
<UniqueIdentifier>{3d266f56-5fd1-4585-9a72-3eef3ee1ee53}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreJSON">
<UniqueIdentifier>{96471440-eb47-4085-a08f-8576fa6fac34}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT">
<UniqueIdentifier>{4e394147-c8cd-4245-b188-0b4827b1875e}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT-Agent">
<UniqueIdentifier>{4e2b22e6-880f-40a0-8b4e-be5e8d3471b2}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\TinyCBOR">
<UniqueIdentifier>{228e794f-fa2d-44ec-ad49-95d6820434a2}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA\portable">
<UniqueIdentifier>{71c883e5-7eb1-44fe-bbcb-5a2b6c3e4d15}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\AWS IoT OTA\include">
<UniqueIdentifier>{b3aeb9e5-1b4f-4652-b24a-49a8c406113e}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\Backoff Algorithm\include">
<UniqueIdentifier>{163f3bc7-7054-4400-8c9e-7f8ac07307f8}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreJSON\include">
<UniqueIdentifier>{6db5c3a5-4750-40b1-9c8c-38e90fa37f9a}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT\include">
<UniqueIdentifier>{2e0ccf6e-a4ca-4349-93ed-5eafa843095b}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT\interface">
<UniqueIdentifier>{a8c75d87-1984-4285-af5c-15146e3dba37}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\coreMQTT-Agent\include">
<UniqueIdentifier>{5e99c65f-35d7-4c3d-9055-9c7759e6f26b}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Libraries\TinyCBOR\include">
<UniqueIdentifier>{d90df1a1-4234-4da5-b3c3-46aa7947a06d}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files">
<UniqueIdentifier>{b4d0329a-2859-4ba6-a690-ce91db59b325}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL">
<UniqueIdentifier>{86c10d39-5f4e-4818-aad7-c565dd268bef}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\Code Signature Verification MbedTLS">
<UniqueIdentifier>{a563c8c2-aada-4f3e-b77a-43db3cf9e26e}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\include">
<UniqueIdentifier>{b89e35af-5342-46c6-84f2-24aa5761e368}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\OTA PAL\Code Signature Verification MbedTLS\include">
<UniqueIdentifier>{ed32e5c5-0bcb-49b9-9328-7b01d3becdf3}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\coreMQTT Agent Interface">
<UniqueIdentifier>{d1acbc8c-cc4d-4c81-8ee0-a68922cc6f1a}</UniqueIdentifier>
</Filter>
<Filter Include="Port Files\coreMQTT Agent Interface\include">
<UniqueIdentifier>{9df90bb5-248f-42cb-8a1c-4b657078898e}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{9d109ee1-e478-4150-98b3-e76597cecb83}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper">
<UniqueIdentifier>{146d613c-d6d6-428a-8506-82924c74a9c9}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport">
<UniqueIdentifier>{7e781ff5-e562-4412-b8e9-8b215c6d7c39}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport\include">
<UniqueIdentifier>{b44e49dc-4b85-41cc-a37a-22c6d33950f1}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper\include">
<UniqueIdentifier>{041aed9a-2876-41f7-859d-e257a7faf509}</UniqueIdentifier>
</Filter>
<Filter Include="Additional Network Transport Files\TCP Sockets Wrapper\ports">
<UniqueIdentifier>{5fe3deb2-b82c-4366-98c5-51742c6c1228}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Common\subscription-manager\subscription_manager.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_base64.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_cbor.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_http.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_interface.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_mqtt.c">
<Filter>Additional Libraries\AWS IoT OTA</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.c">
<Filter>Additional Libraries\AWS IoT OTA\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>Additional Libraries\Backoff Algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>Additional Libraries\coreJSON</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>Additional Libraries\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c">
<Filter>Additional Libraries\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c">
<Filter>Additional Libraries\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborencoder_close_container_checked.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborerrorstrings.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborparser_dup_string.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborpretty_stdio.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\tinycbor\src\cborvalidation.c">
<Filter>Additional Libraries\TinyCBOR</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\ota_pal.c">
<Filter>Port Files\OTA PAL</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification_mbedtls.c">
<Filter>Port Files\OTA PAL\Code Signature Verification MbedTLS</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c">
<Filter>Port Files\coreMQTT Agent Interface</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_command_pool.c">
<Filter>Port Files\coreMQTT Agent Interface</Filter>
</ClCompile>
<ClCompile Include="DemoTasks\OtaOverMqttDemoExample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\ports\freertos_plus_tcp\tcp_sockets_wrapper.c">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper\ports</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common\subscription-manager\subscription_manager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.h">
<Filter>Additional Libraries\AWS IoT OTA\portable</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_appversion32.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_base64_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_cbor_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_config_defaults.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_interface_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_os_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_platform_interface.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_private.h">
<Filter>Additional Libraries\AWS IoT OTA\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>Additional Libraries\Backoff Algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>Additional Libraries\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>Additional Libraries\coreMQTT\interface</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>Additional Libraries\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_message_interface.h">
<Filter>Additional Libraries\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cbor.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborinternal_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\cborjson.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\compilersupport_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\tinycbor-version.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\tinycbor\src\utf8_p.h">
<Filter>Additional Libraries\TinyCBOR\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\ota_pal.h">
<Filter>Port Files\OTA PAL\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification.h">
<Filter>Port Files\OTA PAL\Code Signature Verification MbedTLS\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h">
<Filter>Port Files\coreMQTT Agent Interface\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_command_pool.h">
<Filter>Port Files\coreMQTT Agent Interface\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\aws_ota_codesigner_certificate.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="ota_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\mbedtls_bio_tcp_sockets_wrapper.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\transport_mbedtls.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper + MbedTLS Transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\include\tcp_sockets_wrapper.h">
<Filter>Additional Network Transport Files\TCP Sockets Wrapper\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,109 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#ifndef CORE_MQTT_CONFIG_H
#define CORE_MQTT_CONFIG_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Include logging header files and define logging macros in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
* the logging configuration for MQTT.
* 3. Include the header file "logging_stack.h", if logging is enabled for MQTT.
*/
#include "logging_levels.h"
/* Logging configuration for the MQTT library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "MQTT"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_ERROR
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief The maximum number of MQTT PUBLISH messages that may be pending
* acknowledgement at any time.
*
* QoS 1 and 2 MQTT PUBLISHes require acknowledgment from the server before
* they can be completed. While they are awaiting the acknowledgment, the
* client must maintain information about their state. The value of this
* macro sets the limit on how many simultaneous PUBLISH states an MQTT
* context maintains.
*/
#define MQTT_STATE_ARRAY_MAX_COUNT 10U
/*********************** coreMQTT Agent Configurations **********************/
/**
* @brief The maximum number of pending acknowledgments to track for a single
* connection.
*
* @note The MQTT agent tracks MQTT commands (such as PUBLISH and SUBSCRIBE) th
* at are still waiting to be acknowledged. MQTT_AGENT_MAX_OUTSTANDING_ACKS set
* the maximum number of acknowledgments that can be outstanding at any one time.
* The higher this number is the greater the agent's RAM consumption will be.
*/
#define MQTT_AGENT_MAX_OUTSTANDING_ACKS ( 20U )
/**
* @brief Time in MS that the MQTT agent task will wait in the Blocked state (so
* not using any CPU time) for a command to arrive in its command queue before
* exiting the blocked state so it can call MQTT_ProcessLoop().
*
* @note It is important MQTT_ProcessLoop() is called often if there is known
* MQTT traffic, but calling it too often can take processing time away from
* lower priority tasks and waste CPU time and power.
*/
#define MQTT_AGENT_MAX_EVENT_QUEUE_WAIT_TIME ( 1000 )
/**
* @brief The number of command structures to allocate in the pool
* for the agent.
*/
#define MQTT_COMMAND_CONTEXTS_POOL_SIZE 10
#endif /* ifndef CORE_MQTT_CONFIG_H */

View File

@ -0,0 +1,276 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
#ifndef DEMO_CONFIG_H
#define DEMO_CONFIG_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Include logging header files and define logging macros in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on
* the logging configuration for DEMO.
* 3. Include the header file "logging_stack.h", if logging is enabled for DEMO.
*/
#include "logging_levels.h"
/* Logging configuration for the Demo. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "OTADemo"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_DEBUG
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief The version for the firmware which is running. OTA agent uses this
* version number to perform anti-rollback validation. The firmware version for the
* download image should be higher than the current version, otherwise the new image is
* rejected in self test phase.
*/
#define APP_VERSION_MAJOR 0
#define APP_VERSION_MINOR 9
#define APP_VERSION_BUILD 2
/**
* @brief The MQTT client identifier used in this example. Each client identifier
* must be unique so edit as required to ensure no two clients connecting to the
* same broker use the same client identifier.
*
*!!! Please note a #defined constant is used for convenience of demonstration
*!!! only. Production devices can use something unique to the device that can
*!!! be read by software, such as a production serial number, instead of a
*!!! hard coded constant.
*
* #define democonfigCLIENT_IDENTIFIER "...insert here..."
*/
#define democonfigCLIENT_IDENTIFIER "...insert here..."
/**
* @brief Endpoint of the MQTT broker to connect to.
*
* This demo application can be run with any MQTT broker, although it is
* recommended to use one that supports mutual authentication. If mutual
* authentication is not used, then #democonfigUSE_TLS should be set to 0.
*
* For AWS IoT MQTT broker, this is the Thing's REST API Endpoint.
*
* @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
* Settings/Custom Endpoint, or using the describe-endpoint REST API (with
* AWS CLI command line tool).
*
* #define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
*/
#define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections, and port 1883 if not
* using TLS.
*
* @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
* name. Using ALPN with this demo would require additional changes, including
* setting the `pAlpnProtos` member of the `NetworkCredentials_t` struct before
* forming the TLS connection. When using port 8883, ALPN is not required.
*
* #define democonfigMQTT_BROKER_PORT ( insert here. )
*/
#define democonfigMQTT_BROKER_PORT ( 8883 )
/**
* @brief Server's root CA certificate.
*
* For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT
* server and is publicly available. Refer to the AWS documentation available
* in the link below.
* https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs
*
* @note This certificate should be PEM-encoded.
*
* @note If you would like to setup an MQTT broker for running this demo,
* please see `mqtt_broker_setup.txt`.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigROOT_CA_PEM "...insert here..."
*/
/**
* @brief Client certificate.
*
* For AWS IoT MQTT broker, refer to the AWS documentation below for details
* regarding client authentication.
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This certificate should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN CERTIFICATE-----\n"\
* "...base64 data...\n"\
* "-----END CERTIFICATE-----\n"
*
* #define democonfigCLIENT_CERTIFICATE_PEM "...insert here..."
*/
/**
* @brief Client's private key.
*
*!!! Please note pasting a key into the header file in this manner is for
*!!! convenience of demonstration only and should not be done in production.
*!!! Never paste a production private key here!. Production devices should
*!!! store keys securely, such as within a secure element. Additionally,
*!!! we provide the corePKCS library that further enhances security by
*!!! enabling securely stored keys to be used without exposing them to
*!!! software.
*
* For AWS IoT MQTT broker, refer to the AWS documentation below for details
* regarding clientauthentication.
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This private key should be PEM-encoded.
*
* Must include the PEM header and footer:
* "-----BEGIN RSA PRIVATE KEY-----\n"\
* "...base64 data...\n"\
* "-----END RSA PRIVATE KEY-----\n"
*
* #define democonfigCLIENT_PRIVATE_KEY_PEM "...insert here..."
*/
/**
* @brief An option to disable Server Name Indication.
*
* @note When using a local Mosquitto server setup, SNI needs to be disabled
* for an MQTT broker that only has an IP address but no hostname. However,
* SNI should be enabled whenever possible.
*/
#define democonfigDISABLE_SNI ( pdFALSE )
/**
* @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker.
*
* If username/password based authentication is used, the demo will use appropriate TLS ALPN and
* SNI configurations as required for the Custom Authentication feature of AWS IoT.
* For more information, refer to the following documentation:
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt
*
* #define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
*/
#define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 )
/**
* @brief The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_USERNAME "...insert here..."
*/
/**
* @brief The password value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
* details regarding client authentication with a username and password.
* https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
* An authorizer setup needs to be done, as mentioned in the above link, to use
* username/password based client authentication.
*
* #define democonfigCLIENT_PASSWORD "...insert here..."
*/
/**
* @brief The name of the operating system that the application is running on.
* The current value is given as an example. Please update for your specific
* operating system.
*/
#define democonfigOS_NAME "FreeRTOS"
/**
* @brief The version of the operating system that the application is running
* on. The current value is given as an example. Please update for your specific
* operating system version.
*/
#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER
/**
* @brief The name of the hardware platform the application is running on. The
* current value is given as an example. Please update for your specific
* hardware platform.
*/
#define democonfigHARDWARE_PLATFORM_NAME "WinSim"
/**
* @brief The name of the MQTT library used and its version, following an "@"
* symbol.
*/
#define democonfigMQTT_LIB "core-mqtt@1.0.0"
/**
* @brief Whether to use mutual authentication. If this macro is not set to 1
* or not defined, then plaintext TCP will be used instead of TLS over TCP.
*/
#define democonfigUSE_TLS 1
/**
* @brief Set the stack size of the main demo task.
*
* In the Windows port, this stack only holds a structure. The actual
* stack is created by an operating system thread.
*/
#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,83 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/***
* See https://www.FreeRTOS.org/coremqtt for configuration and usage instructions.
***/
/* Standard includes. */
#include <stdio.h>
#include <time.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*-----------------------------------------------------------*/
extern void vOtaDemoTask( void * pvParameters );
extern void vPlatformInitIpStack( void );
/*-----------------------------------------------------------*/
int main( void )
{
vPlatformInitLogging();
xTaskCreate( vOtaDemoTask, /* Function that implements the task. */
"OTA Demo Task", /* Text name for the task - only used for debugging. */
democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */
NULL, /* Optional - task parameter - not used in this case. */
tskIDLE_PRIORITY + 1, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */
NULL ); /* Optional - used to pass out a handle to the created task. */
/* Initialize the FreeRTOS+TCP Stack */
vPlatformInitIpStack();
/* Start the RTOS scheduler. */
vTaskStartScheduler();
/* If all is well, the scheduler will now be running, and the following
* line will never be reached. If the following line does execute, then
* there was insufficient FreeRTOS heap memory available for the idle and/or
* timer tasks to be created. See the memory management section on the
* FreeRTOS web site for more details.
*/
for( ; ; )
{
configASSERT( pdFALSE );
}
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,200 @@
/*
* FreeRTOS V202212.01
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
/**
* @file ota_config.h
* @brief OTA user configurable settings.
*/
#ifndef OTA_CONFIG_H_
#define OTA_CONFIG_H_
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Logging related header files are required to be included in the following order:
* 1. Include the header file "logging_levels.h".
* 2. Define LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL.
* 3. Include the header file "logging_stack.h".
*/
/* Include header that defines log levels. */
#include "logging_levels.h"
/* Configure name and log level for the OTA library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "OTA"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
/* Prototype for the function used to print to console on Windows simulator
* of FreeRTOS.
* The function prints to the console before the network is connected;
* then a UDP port after the network has connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Map the SdkLog macro to the logging function to enable logging
* on Windows simulator. */
#ifndef SdkLog
#define SdkLog( message ) vLoggingPrintf message
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @brief Log base 2 of the size of the file data block message (excluding the header).
*
* 10 bits yields a data block size of 1KB.
*/
#define otaconfigLOG2_FILE_BLOCK_SIZE 11UL
/**
* @brief Size of the file data block message (excluding the header).
*
*/
#define otaconfigFILE_BLOCK_SIZE ( 1UL << otaconfigLOG2_FILE_BLOCK_SIZE )
/**
* @brief Milliseconds to wait for the self test phase to succeed before we force reset.
*/
#define otaconfigSELF_TEST_RESPONSE_WAIT_MS 16000U
/**
* @brief Milliseconds to wait before requesting data blocks from the OTA service if nothing is happening.
*
* The wait timer is reset whenever a data block is received from the OTA service so we will only send
* the request message after being idle for this amount of time.
*/
#define otaconfigFILE_REQUEST_WAIT_MS 10000U
/**
* @brief The maximum allowed length of the thing name used by the OTA agent.
*
* AWS IoT requires Thing names to be unique for each device that connects to the broker.
* Likewise, the OTA agent requires the developer to construct and pass in the Thing name when
* initializing the OTA agent. The agent uses this size to allocate static storage for the
* Thing name used in all OTA base topics. Namely $aws/things/<thingName>
*/
#define otaconfigMAX_THINGNAME_LEN 128U
/**
* @brief The maximum number of data blocks requested from OTA streaming service.
*
* This configuration parameter is sent with data requests and represents the maximum number of
* data blocks the service will send in response. The maximum limit for this must be calculated
* from the maximum data response limit (128 KB from service) divided by the block size.
* For example if block size is set as 1 KB then the maximum number of data blocks that we can
* request is 128/1 = 128 blocks. Configure this parameter to this maximum limit or lower based on
* how many data blocks response is expected for each data requests.
* Please note that this must be set larger than zero.
*
*/
#define otaconfigMAX_NUM_BLOCKS_REQUEST 4U
/**
* @brief The maximum number of requests allowed to send without a response before we abort.
*
* This configuration parameter sets the maximum number of times the requests are made over
* the selected communication channel before aborting and returning error.
*
*/
#define otaconfigMAX_NUM_REQUEST_MOMENTUM 32U
/**
* @brief The number of data buffers reserved by the OTA agent.
*
* This configurations parameter sets the maximum number of static data buffers used by
* the OTA agent for job and file data blocks received.
*/
#define otaconfigMAX_NUM_OTA_DATA_BUFFERS 5U
/**
* @brief How frequently the device will report its OTA progress to the cloud.
*
* Device will update the job status with the number of blocks it has received every certain
* number of blocks it receives. For example, 25 means device will update job status every 25 blocks
* it receives.
*/
#define otaconfigOTA_UPDATE_STATUS_FREQUENCY 25U
/**
* @brief Allow update to same or lower version.
*
* Set this to 1 to allow downgrade or same version update.This configurations parameter
* disables version check and allows update to a same or lower version.This is provided for
* testing purpose and it is recommended to always update to higher version and keep this
* configuration disabled.
*/
#define otaconfigAllowDowngrade 0U
/**
* @brief The protocol selected for OTA control operations.
*
* This configurations parameter sets the default protocol for all the OTA control
* operations like requesting OTA job, updating the job status etc.
*
* Note - Only MQTT is supported at this time for control operations.
*/
#define configENABLED_CONTROL_PROTOCOL ( OTA_CONTROL_OVER_MQTT )
/**
* @brief The protocol selected for OTA data operations.
*
* This configurations parameter sets the protocols selected for the data operations
* like requesting file blocks from the service.
*
* Note - Both MQTT and HTTP is supported for data transfer from service. This configuration parameter
* can be set to following -
* Enable data over MQTT - ( OTA_DATA_OVER_MQTT )
* Enable data over HTTP - ( OTA_DATA_OVER_HTTP)
*
* Note - Please check the OTA over HTTP demo which has the HTTP data transfer functionality and
* and this configuration is set to OTA_DATA_OVER_HTTP.
*/
#define configENABLED_DATA_PROTOCOLS ( OTA_DATA_OVER_MQTT )
/**
* @brief The preferred protocol selected for OTA data operations.
*
* Primary data protocol will be the protocol used for downloading file if more than
* one protocol is selected while creating OTA job. Default primary data protocol is MQTT
* and following update here to switch to HTTP as primary.
*
* Note - use OTA_DATA_OVER_HTTP for HTTP as primary data protocol.
*/
#define configOTA_PRIMARY_DATA_PROTOCOL ( OTA_DATA_OVER_MQTT )
#endif /* OTA_CONFIG_H_ */

View File

@ -0,0 +1,79 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Statically Linked Libraries", "Statically Linked Libraries", "{9799AFF4-25E2-43CD-8829-C066177E3748}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeRTOS+TCP", "..\..\..\..\VisualStudio_StaticProjects\FreeRTOS+TCP\FreeRTOS+TCP.vcxproj", "{C90E6CC5-818B-4C97-8876-0986D989387C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeRTOS-Kernel", "..\..\..\..\VisualStudio_StaticProjects\FreeRTOS-Kernel\FreeRTOS-Kernel.vcxproj", "{72C209C4-49A4-4942-A201-44706C9D77EC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Logging", "..\..\..\..\VisualStudio_StaticProjects\Logging\Logging.vcxproj", "{BE362AC0-B10B-4276-B84E-6304652BA228}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MbedTLS", "..\..\..\..\VisualStudio_StaticProjects\MbedTLS\MbedTLS.vcxproj", "{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ota_Over_Mqtt_Demo", "Ota_Over_Mqtt_Demo.vcxproj", "{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x64.ActiveCfg = Debug|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x64.Build.0 = Debug|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x86.ActiveCfg = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Debug|x86.Build.0 = Debug|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.ActiveCfg = Release|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x64.Build.0 = Release|x64
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x86.ActiveCfg = Release|Win32
{C90E6CC5-818B-4C97-8876-0986D989387C}.Release|x86.Build.0 = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x64.ActiveCfg = Debug|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x64.Build.0 = Debug|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x86.ActiveCfg = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Debug|x86.Build.0 = Debug|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.ActiveCfg = Release|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x64.Build.0 = Release|x64
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x86.ActiveCfg = Release|Win32
{72C209C4-49A4-4942-A201-44706C9D77EC}.Release|x86.Build.0 = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x64.ActiveCfg = Debug|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x64.Build.0 = Debug|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x86.ActiveCfg = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Debug|x86.Build.0 = Debug|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x64.ActiveCfg = Release|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x64.Build.0 = Release|x64
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x86.ActiveCfg = Release|Win32
{BE362AC0-B10B-4276-B84E-6304652BA228}.Release|x86.Build.0 = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x64.ActiveCfg = Debug|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x64.Build.0 = Debug|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x86.ActiveCfg = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Debug|x86.Build.0 = Debug|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x64.ActiveCfg = Release|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x64.Build.0 = Release|x64
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x86.ActiveCfg = Release|Win32
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7}.Release|x86.Build.0 = Release|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x64.ActiveCfg = Debug|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x64.Build.0 = Debug|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x86.ActiveCfg = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Debug|x86.Build.0 = Debug|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x64.ActiveCfg = Release|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x64.Build.0 = Release|x64
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x86.ActiveCfg = Release|Win32
{4BE4E103-5BF4-4A85-9656-EC20852A2B8E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C90E6CC5-818B-4C97-8876-0986D989387C} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{72C209C4-49A4-4942-A201-44706C9D77EC} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{BE362AC0-B10B-4276-B84E-6304652BA228} = {9799AFF4-25E2-43CD-8829-C066177E3748}
{E1016F3E-94E9-4864-9FD8-1D7C1FEFBFD7} = {9799AFF4-25E2-43CD-8829-C066177E3748}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03800DFF-BAFA-4654-8E51-C4E654A54416}
EndGlobalSection
EndGlobal