This commit is contained in:
Alwin Berger 2021-11-30 14:51:24 +01:00
commit 20d74ab530
20011 changed files with 10276019 additions and 0 deletions

8
.editorconfig Normal file
View File

@ -0,0 +1,8 @@
root = true
[*]
indent_style = space
indent_size = 4
[{Makefile,**.mk,Makefile.in}]
indent_style = tab

5
FreeRTOS+TCP.url Normal file
View File

@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/index.html
IDList=

View File

@ -0,0 +1,967 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/*
* Demo for showing how to use the Device Defender library's APIs. The Device
* Defender library provides macros and helper functions for assembling MQTT
* topics strings, and for determining whether an incoming MQTT message is
* related to Device Defender. The Device Defender library does not depend on
* any particular MQTT library, therefore the code for MQTT operations is
* placed in another file (mqtt_demo_helpers.c). This demo uses the coreMQTT
* library. If needed, mqtt_demo_helpers.c can be modified to replace coreMQTT
* with another MQTT library. This demo requires using the AWS IoT broker as
* Device Defender is an AWS service.
*
* This demo subscribes to the Device Defender topics. It then collects metrics
* for the open ports and sockets on the device using FreeRTOS+TCP. Additionally
* the stack high water mark and task IDs are collected for custom metrics.
* These metrics are used to generate a Device Defender report. The
* report is then published, and the demo waits for a response from the device
* defender service. Upon receiving an accepted response, the demo finishes.
* If the demo receives a rejected response or times out, the demo repeats up to
* a maximum of DEFENDER_MAX_DEMO_LOOP_COUNT times.
*
* This demo sets the report ID to xTaskGetTickCount(), which may collide if
* the device is reset. Reports for a Thing with a previously used report ID
* will be assumed to be duplicates and discarded by the Device Defender
* service. The report ID needs to be unique per report sent with a given
* Thing. We recommend using an increasing unique ID such as the current
* timestamp.
*/
/* Standard includes. */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo config. */
#include "demo_config.h"
/* JSON Library. */
#include "core_json.h"
/* Device Defender Client Library. */
#include "defender.h"
/* MQTT operations. */
#include "mqtt_demo_helpers.h"
/* Metrics collector. */
#include "metrics_collector.h"
/* Report builder. */
#include "report_builder.h"
/**
* democonfigTHING_NAME is required. Throw compilation error if it is not defined.
*/
#ifndef democonfigTHING_NAME
#error "Please define democonfigTHING_NAME to the thing name registered with AWS IoT Core in demo_config.h."
#endif
/**
* @brief The length of #democonfigTHING_NAME.
*/
#define THING_NAME_LENGTH ( ( uint16_t ) ( sizeof( democonfigTHING_NAME ) - 1 ) )
/**
* @brief Number of seconds to wait for the response from AWS IoT Device
* Defender service.
*/
#define DEFENDER_RESPONSE_WAIT_SECONDS ( 2 )
/**
* @brief Name of the report ID field in the response from the AWS IoT Device
* Defender service.
*/
#define DEFENDER_RESPONSE_REPORT_ID_FIELD "reportId"
/**
* @brief The length of #DEFENDER_RESPONSE_REPORT_ID_FIELD.
*/
#define DEFENDER_RESPONSE_REPORT_ID_FIELD_LENGTH ( sizeof( DEFENDER_RESPONSE_REPORT_ID_FIELD ) - 1 )
/**
* @brief The maximum number of times to run the loop in this demo.
*
* @note The demo loop is attempted to re-run only if it fails in an iteration.
* Once the demo loop succeeds in an iteration, the demo exits successfully.
*/
#ifndef DEFENDER_MAX_DEMO_LOOP_COUNT
#define DEFENDER_MAX_DEMO_LOOP_COUNT ( 3 )
#endif
/**
* @brief Time in ticks to wait between retries of the demo loop if
* demo loop fails.
*/
#define DELAY_BETWEEN_DEMO_RETRY_ITERATIONS_TICKS ( pdMS_TO_TICKS( 5000U ) )
/**
* @brief Status values of the Device Defender report.
*/
typedef enum
{
ReportStatusNotReceived,
ReportStatusAccepted,
ReportStatusRejected
} ReportStatus_t;
/**
* @brief Each compilation unit that consumes the NetworkContext must define it.
* It should contain a single pointer to the type of your desired transport.
* When using multiple transports in the same compilation unit, define this pointer as void *.
*
* @note Transport stacks are defined in FreeRTOS-Plus/Source/Application-Protocols/network_transport.
*/
struct NetworkContext
{
TlsTransportParams_t * pParams;
};
/*-----------------------------------------------------------*/
/**
* @brief The MQTT context used for MQTT operation.
*/
static MQTTContext_t xMqttContext;
/**
* @brief The network context used for mbedTLS operation.
*/
static NetworkContext_t xNetworkContext;
/**
* @brief The parameters for the network context using mbedTLS operation.
*/
static TlsTransportParams_t xTlsTransportParams;
/**
* @brief Static buffer used to hold MQTT messages being sent and received.
*/
static uint8_t ucSharedBuffer[ democonfigNETWORK_BUFFER_SIZE ];
/**
* @brief Static buffer used to hold MQTT messages being sent and received.
*/
static MQTTFixedBuffer_t xBuffer =
{
ucSharedBuffer,
democonfigNETWORK_BUFFER_SIZE
};
/**
* @brief Network Stats.
*/
static NetworkStats_t xNetworkStats;
/**
* @brief Open TCP ports array.
*/
static uint16_t pusOpenTcpPorts[ democonfigOPEN_TCP_PORTS_ARRAY_SIZE ];
/**
* @brief Open UDP ports array.
*/
static uint16_t pusOpenUdpPorts[ democonfigOPEN_UDP_PORTS_ARRAY_SIZE ];
/**
* @brief Established connections array.
*/
static Connection_t pxEstablishedConnections[ democonfigESTABLISHED_CONNECTIONS_ARRAY_SIZE ];
/**
* @brief All the metrics sent in the Device Defender report.
*/
static ReportMetrics_t xDeviceMetrics;
/**
* @brief Report status.
*/
static ReportStatus_t xReportStatus;
/**
* @brief Buffer for generating the Device Defender report.
*/
static char pcDeviceMetricsJsonReport[ democonfigDEVICE_METRICS_REPORT_BUFFER_SIZE ];
/**
* @brief Report ID sent in the defender report.
*/
static uint32_t ulReportId = 0UL;
/*-----------------------------------------------------------*/
/**
* @brief Callback to receive the incoming publish messages from the MQTT broker.
*
* @param[in] pxMqttContext The MQTT context for the MQTT connection.
* @param[in] pxPacketInfo Pointer to publish info of the incoming publish.
* @param[in] pxDeserializedInfo Deserialized information from the incoming publish.
*/
static void prvPublishCallback( MQTTContext_t * pxMqttContext,
MQTTPacketInfo_t * pxPacketInfo,
MQTTDeserializedInfo_t * pxDeserializedInfo );
/**
* @brief Collect all the metrics to be sent in the Device Defender report.
*
* On success, caller is responsible for freeing xDeviceMetrics.pxTaskStatusArray.
*
* @return true if all the metrics are successfully collected;
* false otherwise.
*/
static bool prvCollectDeviceMetrics( void );
/**
* @brief Generate the Device Defender report.
*
* @param[out] pxOutReportLength Length of the Device Defender report.
*
* @return true if the report is generated successfully;
* false otherwise.
*/
static bool prvGenerateDeviceMetricsReport( size_t * pxOutReportLength );
/**
* @brief Subscribe to the Device Defender topics.
*
* @return true if the subscribe is successful;
* false otherwise.
*/
static bool prvSubscribeToDefenderTopics( void );
/**
* @brief Unsubscribe from the Device Defender topics.
*
* @return true if the unsubscribe is successful;
* false otherwise.
*/
static bool prvUnsubscribeFromDefenderTopics( void );
/**
* @brief Publish the generated Device Defender report.
*
* @param[in] xReportLength Length of the Device Defender report.
*
* @return true if the report is published successfully;
* false otherwise.
*/
static bool prvPublishDeviceMetricsReport( size_t xReportLength );
/**
* @brief Validate the response received from the AWS IoT Device Defender Service.
*
* This functions checks that a valid JSON is received and the report ID
* is same as was sent in the published report.
*
* @param[in] pcDefenderResponse The defender response to validate.
* @param[in] xDefenderResponseLength Length of the defender response.
*
* @return true if the response is valid;
* false otherwise.
*/
static bool prvValidateDefenderResponse( const char * pcDefenderResponse,
size_t xDefenderResponseLength );
/**
* @brief The task used to demonstrate the Defender API.
*
* This task collects metrics from the device using the functions in
* metrics_collector.h and uses them to build a defender report using functions
* in report_builder.h. Metrics include the number for bytes written and read
* over the network, open TCP and UDP ports, and open TCP sockets. The
* generated report is then published to the AWS IoT Device Defender service.
*
* @param[in] pvParameters Parameters as passed at the time of task creation.
* Not used in this example.
*/
static void prvDefenderDemoTask( void * pvParameters );
/*-----------------------------------------------------------*/
static bool prvValidateDefenderResponse( const char * pcDefenderResponse,
size_t xDefenderResponseLength )
{
bool xStatus = false;
JSONStatus_t eJsonResult = JSONSuccess;
char * ucReportIdString = NULL;
size_t xReportIdStringLength;
uint32_t ulReportIdInResponse;
configASSERT( pcDefenderResponse != NULL );
/* Is the response a valid JSON? */
eJsonResult = JSON_Validate( pcDefenderResponse, xDefenderResponseLength );
if( eJsonResult != JSONSuccess )
{
LogError( ( "Invalid response from AWS IoT Device Defender Service: %.*s.",
( int ) xDefenderResponseLength,
pcDefenderResponse ) );
}
if( eJsonResult == JSONSuccess )
{
/* Search the ReportId key in the response. */
eJsonResult = JSON_Search( ( char * ) pcDefenderResponse,
xDefenderResponseLength,
DEFENDER_RESPONSE_REPORT_ID_FIELD,
DEFENDER_RESPONSE_REPORT_ID_FIELD_LENGTH,
&( ucReportIdString ),
&( xReportIdStringLength ) );
if( eJsonResult != JSONSuccess )
{
LogError( ( "%s key not found in the response from the"
"AWS IoT Device Defender Service: %.*s.",
DEFENDER_RESPONSE_REPORT_ID_FIELD,
( int ) xDefenderResponseLength,
pcDefenderResponse ) );
}
}
if( eJsonResult == JSONSuccess )
{
ulReportIdInResponse = ( uint32_t ) strtoul( ucReportIdString, NULL, 10 );
/* Is the report ID present in the response same as was sent in the
* published report? */
if( ulReportIdInResponse == ulReportId )
{
LogInfo( ( "A valid response with report ID %u received from the "
"AWS IoT Device Defender Service.", ulReportId ) );
xStatus = true;
}
else
{
LogError( ( "Unexpected %s found in the response from the AWS"
"IoT Device Defender Service. Expected: %u, Found: %u, "
"Complete Response: %.*s.",
DEFENDER_RESPONSE_REPORT_ID_FIELD,
ulReportId,
ulReportIdInResponse,
( int ) xDefenderResponseLength,
pcDefenderResponse ) );
}
}
return xStatus;
}
/*-----------------------------------------------------------*/
static void prvPublishCallback( MQTTContext_t * pxMqttContext,
MQTTPacketInfo_t * pxPacketInfo,
MQTTDeserializedInfo_t * pxDeserializedInfo )
{
DefenderStatus_t xStatus;
DefenderTopic_t xApi;
bool xValidationResult;
MQTTPublishInfo_t * pxPublishInfo;
configASSERT( pxMqttContext != NULL );
configASSERT( pxPacketInfo != NULL );
configASSERT( pxDeserializedInfo != NULL );
/* Suppress the unused parameter warning when asserts are disabled in
* build. */
( void ) pxMqttContext;
/* Handle an incoming publish. The lower 4 bits of the publish packet
* type is used for the dup, QoS, and retain flags. Hence masking
* out the lower bits to check if the packet is publish. */
if( ( pxPacketInfo->type & 0xF0U ) == MQTT_PACKET_TYPE_PUBLISH )
{
configASSERT( pxDeserializedInfo->pPublishInfo != NULL );
pxPublishInfo = pxDeserializedInfo->pPublishInfo;
/* Verify that the publish is for Device Defender, and if so get which
* defender API it is for */
xStatus = Defender_MatchTopic( pxPublishInfo->pTopicName,
pxPublishInfo->topicNameLength,
&( xApi ),
NULL,
NULL );
if( xStatus == DefenderSuccess )
{
if( xApi == DefenderJsonReportAccepted )
{
/* Check if the response is valid and is for the report we
* published. If so, report was accepted. */
xValidationResult = prvValidateDefenderResponse( pxPublishInfo->pPayload,
pxPublishInfo->payloadLength );
if( xValidationResult == true )
{
LogInfo( ( "The defender report was accepted by the service. Response: %.*s.",
( int ) pxPublishInfo->payloadLength,
( const char * ) pxPublishInfo->pPayload ) );
xReportStatus = ReportStatusAccepted;
}
}
else if( xApi == DefenderJsonReportRejected )
{
/* Check if the response is valid and is for the report we
* published. If so, report was rejected. */
xValidationResult = prvValidateDefenderResponse( pxPublishInfo->pPayload,
pxPublishInfo->payloadLength );
if( xValidationResult == true )
{
LogError( ( "The defender report was rejected by the service. Response: %.*s.",
( int ) pxPublishInfo->payloadLength,
( const char * ) pxPublishInfo->pPayload ) );
xReportStatus = ReportStatusRejected;
}
}
else
{
LogError( ( "Unexpected defender API : %d.", xApi ) );
}
}
else
{
LogError( ( "Unexpected publish message received. Topic: %.*s, Payload: %.*s.",
( int ) pxPublishInfo->topicNameLength,
( const char * ) pxPublishInfo->pTopicName,
( int ) pxPublishInfo->payloadLength,
( const char * ) ( pxPublishInfo->pPayload ) ) );
}
}
else
{
vHandleOtherIncomingPacket( pxPacketInfo, pxDeserializedInfo->packetIdentifier );
}
}
/*-----------------------------------------------------------*/
static bool prvCollectDeviceMetrics( void )
{
bool xStatus = false;
eMetricsCollectorStatus eStatus;
size_t xNumOpenTcpPorts = 0UL, xNumOpenUdpPorts = 0UL, xNumEstablishedConnections = 0UL, i;
UBaseType_t uxTasksWritten = { 0 };
UBaseType_t uxNumTasksRunning;
TaskStatus_t pxTaskStatus = { 0 };
TaskStatus_t * pxTaskStatusArray = NULL;
/* Collect bytes and packets sent and received. */
eStatus = eGetNetworkStats( &( xNetworkStats ) );
if( eStatus != eMetricsCollectorSuccess )
{
LogError( ( "xGetNetworkStats failed. Status: %d.",
eStatus ) );
}
/* Collect a list of open TCP ports. */
if( eStatus == eMetricsCollectorSuccess )
{
eStatus = eGetOpenTcpPorts( &( pusOpenTcpPorts[ 0 ] ),
democonfigOPEN_TCP_PORTS_ARRAY_SIZE,
&( xNumOpenTcpPorts ) );
if( eStatus != eMetricsCollectorSuccess )
{
LogError( ( "xGetOpenTcpPorts failed. Status: %d.",
eStatus ) );
}
}
/* Collect a list of open UDP ports. */
if( eStatus == eMetricsCollectorSuccess )
{
eStatus = eGetOpenUdpPorts( &( pusOpenUdpPorts[ 0 ] ),
democonfigOPEN_UDP_PORTS_ARRAY_SIZE,
&( xNumOpenUdpPorts ) );
if( eStatus != eMetricsCollectorSuccess )
{
LogError( ( "xGetOpenUdpPorts failed. Status: %d.",
eStatus ) );
}
}
/* Collect a list of established connections. */
if( eStatus == eMetricsCollectorSuccess )
{
eStatus = eGetEstablishedConnections( &( pxEstablishedConnections[ 0 ] ),
democonfigESTABLISHED_CONNECTIONS_ARRAY_SIZE,
&( xNumEstablishedConnections ) );
if( eStatus != eMetricsCollectorSuccess )
{
LogError( ( "GetEstablishedConnections failed. Status: %d.",
eStatus ) );
}
}
if( eStatus == eMetricsCollectorSuccess )
{
/* Get task count */
uxNumTasksRunning = uxTaskGetNumberOfTasks();
/* Allocate pxTaskStatusArray */
pxTaskStatusArray = pvPortMalloc( uxNumTasksRunning * sizeof( TaskStatus_t ) );
if( pxTaskStatusArray == NULL )
{
LogError( ( "Cannot allocate memory for pxTaskStatusArray: pvPortMalloc() failed." ) );
eStatus = eMetricsCollectorCollectionFailed;
}
}
/* Collect custom metrics. This demo sends this task's stack high water mark
* as a number type custom metric and the current task IDs as a list of
* numbers type custom metric. */
if( eStatus == eMetricsCollectorSuccess )
{
/* Get the current task's status information. The usStackHighWaterMark
* field of the task status will be included in the report as a "number"
* custom metric. */
vTaskGetInfo(
/* Query this task. */
NULL,
&pxTaskStatus,
/* Include the stack high water mark value. */
pdTRUE,
/* Don't include the task state in the TaskStatus_t structure. */
0 );
/* Get the task status information for all running tasks. The task IDs
* of each task is then extracted to include in the report as a "list of
* numbers" custom metric */
uxTasksWritten = uxTaskGetSystemState( pxTaskStatusArray, uxNumTasksRunning, NULL );
if( uxTasksWritten == 0 )
{
/* If 0 is returned, the buffer was too small. This line is reached
* when we hit the race condition where tasks have been added since
* we got the result of uxTaskGetNumberOfTasks() */
eStatus = eMetricsCollectorCollectionFailed;
LogError( ( "Failed to collect system state. uxTaskGetSystemState() failed due to insufficient buffer space.",
eStatus ) );
}
}
/* Populate device metrics. */
if( eStatus == eMetricsCollectorSuccess )
{
xStatus = true;
xDeviceMetrics.pxNetworkStats = &( xNetworkStats );
xDeviceMetrics.pusOpenTcpPortsArray = &( pusOpenTcpPorts[ 0 ] );
xDeviceMetrics.xOpenTcpPortsArrayLength = xNumOpenTcpPorts;
xDeviceMetrics.pusOpenUdpPortsArray = &( pusOpenUdpPorts[ 0 ] );
xDeviceMetrics.xOpenUdpPortsArrayLength = xNumOpenUdpPorts;
xDeviceMetrics.pxEstablishedConnectionsArray = &( pxEstablishedConnections[ 0 ] );
xDeviceMetrics.xEstablishedConnectionsArrayLength = xNumEstablishedConnections;
xDeviceMetrics.ulStackHighWaterMark = pxTaskStatus.usStackHighWaterMark;
xDeviceMetrics.pxTaskStatusArray = pxTaskStatusArray;
xDeviceMetrics.xTaskStatusArrayLength = uxTasksWritten;
}
else
{
/* Free pxTaskStatusArray if we allocated it but did not add it to the
* xDeviceMetrics struct. */
if( pxTaskStatusArray != NULL )
{
vPortFree( pxTaskStatusArray );
}
}
return xStatus;
}
/*-----------------------------------------------------------*/
static bool prvGenerateDeviceMetricsReport( size_t * pxOutReportLength )
{
bool xStatus = false;
eReportBuilderStatus eReportBuilderStatus;
/* Generate the metrics report in the format expected by the AWS IoT Device
* Defender Service. */
eReportBuilderStatus = eGenerateJsonReport( &( pcDeviceMetricsJsonReport[ 0 ] ),
democonfigDEVICE_METRICS_REPORT_BUFFER_SIZE,
&( xDeviceMetrics ),
democonfigDEVICE_METRICS_REPORT_MAJOR_VERSION,
democonfigDEVICE_METRICS_REPORT_MINOR_VERSION,
ulReportId,
pxOutReportLength );
if( eReportBuilderStatus != eReportBuilderSuccess )
{
LogError( ( "GenerateJsonReport failed. Status: %d.",
eReportBuilderStatus ) );
}
else
{
LogDebug( ( "Generated Report: %.*s.",
*pxOutReportLength,
&( pcDeviceMetricsJsonReport[ 0 ] ) ) );
xStatus = true;
}
return xStatus;
}
/*-----------------------------------------------------------*/
static bool prvSubscribeToDefenderTopics( void )
{
bool xStatus = false;
/* Subscribe to defender topic for responses for accepted reports. */
xStatus = xSubscribeToTopic( &xMqttContext,
DEFENDER_API_JSON_ACCEPTED( democonfigTHING_NAME ),
DEFENDER_API_LENGTH_JSON_ACCEPTED( THING_NAME_LENGTH ) );
if( xStatus == false )
{
LogError( ( "Failed to subscribe to defender topic: %.*s.",
DEFENDER_API_LENGTH_JSON_ACCEPTED( THING_NAME_LENGTH ),
DEFENDER_API_JSON_ACCEPTED( democonfigTHING_NAME ) ) );
}
if( xStatus == true )
{
/* Subscribe to defender topic for responses for rejected reports. */
xStatus = xSubscribeToTopic( &xMqttContext,
DEFENDER_API_JSON_REJECTED( democonfigTHING_NAME ),
DEFENDER_API_LENGTH_JSON_REJECTED( THING_NAME_LENGTH ) );
if( xStatus == false )
{
LogError( ( "Failed to subscribe to defender topic: %.*s.",
DEFENDER_API_LENGTH_JSON_REJECTED( THING_NAME_LENGTH ),
DEFENDER_API_JSON_REJECTED( democonfigTHING_NAME ) ) );
}
}
return xStatus;
}
/*-----------------------------------------------------------*/
static bool prvUnsubscribeFromDefenderTopics( void )
{
bool xStatus = false;
/* Unsubscribe from defender accepted topic. */
xStatus = xUnsubscribeFromTopic( &xMqttContext,
DEFENDER_API_JSON_ACCEPTED( democonfigTHING_NAME ),
DEFENDER_API_LENGTH_JSON_ACCEPTED( THING_NAME_LENGTH ) );
if( xStatus == true )
{
/* Unsubscribe from defender rejected topic. */
xStatus = xUnsubscribeFromTopic( &xMqttContext,
DEFENDER_API_JSON_REJECTED( democonfigTHING_NAME ),
DEFENDER_API_LENGTH_JSON_REJECTED( THING_NAME_LENGTH ) );
}
return xStatus;
}
/*-----------------------------------------------------------*/
static bool prvPublishDeviceMetricsReport( size_t xReportLength )
{
return xPublishToTopic( &xMqttContext,
DEFENDER_API_JSON_PUBLISH( democonfigTHING_NAME ),
DEFENDER_API_LENGTH_JSON_PUBLISH( THING_NAME_LENGTH ),
&( pcDeviceMetricsJsonReport[ 0 ] ),
xReportLength );
}
/*-----------------------------------------------------------*/
/**
* @brief Create the task that demonstrates the Device Defender library API via
* a mutually authenticated MQTT connection with the AWS IoT broker.
*/
void vStartDefenderDemo( void )
{
/* This example uses a single application task, which shows that how to use
* Device Defender library to generate and validate AWS IoT Device Defender
* MQTT topics, and use the coreMQTT library to communicate with the AWS
* IoT Device Defender service. */
xTaskCreate( prvDefenderDemoTask, /* Function that implements the task. */
"DemoTask", /* Text name for the task - only used for debugging. */
democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */
NULL, /* Task parameter - not used in this case. */
tskIDLE_PRIORITY, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */
NULL ); /* Used to pass out a handle to the created task - not used in this case. */
}
/*-----------------------------------------------------------*/
void prvDefenderDemoTask( void * pvParameters )
{
bool xStatus = false;
BaseType_t xExitStatus = EXIT_FAILURE;
uint32_t ulReportLength = 0UL, i;
bool xMqttSessionEstablished = false;
UBaseType_t uxDemoRunCount = 0UL;
/* Remove compiler warnings about unused parameters. */
( void ) pvParameters;
/* Set the pParams member of the network context with desired transport. */
xNetworkContext.pParams = &xTlsTransportParams;
/* Start with report not received. */
xReportStatus = ReportStatusNotReceived;
/* This demo runs a single loop unless there are failures in the demo execution.
* In case of failures in the demo execution, demo loop will be retried for up to
* DEFENDER_MAX_DEMO_LOOP_COUNT times. */
do
{
/* Set a report ID to be used.
*
* !!!NOTE!!!
* This demo sets the report ID to xTaskGetTickCount(), which may collide
* if the device is reset. Reports for a Thing with a previously used
* report ID will be assumed to be duplicates and discarded by the Device
* Defender service. The report ID needs to be unique per report sent with
* a given Thing. We recommend using an increasing unique ID such as the
* current timestamp. */
ulReportId = ( uint32_t ) xTaskGetTickCount();
/****************************** Connect. ******************************/
/* Attempts to connect to the AWS IoT MQTT broker over TCP. If the
* connection fails, retries after a timeout. Timeout value will
* exponentially increase until maximum attempts are reached. */
LogInfo( ( "Establishing MQTT session..." ) );
xStatus = xEstablishMqttSession( &xMqttContext,
&xNetworkContext,
&xBuffer,
prvPublishCallback );
if( xStatus != true )
{
LogError( ( "Failed to establish MQTT session." ) );
}
else
{
xMqttSessionEstablished = true;
}
/******************** Subscribe to Defender topics. *******************/
/* Attempt to subscribe to the AWS IoT Device Defender topics.
* Since this demo is using JSON, in prvSubscribeToDefenderTopics() we
* subscribe to the topics to which accepted and rejected responses are
* received from after publishing a JSON report.
*
* This demo uses a constant #democonfigTHING_NAME known at compile time
* therefore we use macros to assemble defender topic strings.
* If the thing name is known at run time, then we could use the API
* #Defender_GetTopic instead.
*
* For example, for the JSON accepted responses topic:
*
* #define TOPIC_BUFFER_LENGTH ( 256U )
*
* // Every device should have a unique thing name registered with AWS IoT Core.
* // This example assumes that the device has a unique serial number which is
* // registered as the thing name with AWS IoT Core.
* const char * pThingName = GetDeviceSerialNumber();
* uint16_t thingNameLength = ( uint16_t )strlen( pThingname );
* char topicBuffer[ TOPIC_BUFFER_LENGTH ] = { 0 };
* uint16_t topicLength = 0;
* DefenderStatus_t status = DefenderSuccess;
*
* status = Defender_GetTopic( &( topicBuffer[ 0 ] ),
* TOPIC_BUFFER_LENGTH,
* pThingName,
* thingNameLength,
* DefenderJsonReportAccepted,
* &( topicLength ) );
*/
if( xStatus == true )
{
LogInfo( ( "Subscribing to defender topics..." ) );
xStatus = prvSubscribeToDefenderTopics();
if( xStatus != true )
{
LogError( ( "Failed to subscribe to defender topics." ) );
}
}
/*********************** Collect device metrics. **********************/
/* We then need to collect the metrics that will be sent to the AWS IoT
* Device Defender service. This demo uses the functions declared in
* in metrics_collector.h to collect network metrics. For this demo, the
* implementation of these functions are in metrics_collector.c and
* collects metrics using tcp_netstat utility for FreeRTOS+TCP. */
if( xStatus == true )
{
LogInfo( ( "Collecting device metrics..." ) );
xStatus = prvCollectDeviceMetrics();
if( xStatus != true )
{
LogError( ( "Failed to collect device metrics." ) );
}
}
/********************** Generate defender report. *********************/
/* The data needs to be incorporated into a JSON formatted report,
* which follows the format expected by the Device Defender service.
* This format is documented here:
* https://docs.aws.amazon.com/iot/latest/developerguide/detect-device-side-metrics.html
*/
if( xStatus == true )
{
LogInfo( ( "Generating Device Defender report..." ) );
xStatus = prvGenerateDeviceMetricsReport( &( ulReportLength ) );
/* Free the allocated array in xDeviceMetrics struct which is not
* used anymore after prvGenerateDeviceMetricsReport(). This code is
* only reached when prvCollectDeviceMetrics succeeded, so
* xDeviceMetrics.pxTaskStatusArray is a valid allocation that needs
* to be freed. */
vPortFree( xDeviceMetrics.pxTaskStatusArray );
if( xStatus != true )
{
LogError( ( "Failed to generate Device Defender report." ) );
}
}
/********************** Publish defender report. **********************/
/* The report is then published to the Device Defender service. This report
* is published to the MQTT topic for publishing JSON reports. As before,
* we use the defender library macros to create the topic string, though
* #Defender_GetTopic could be used if the Thing name is acquired at
* run time */
if( xStatus == true )
{
LogInfo( ( "Publishing Device Defender report..." ) );
xStatus = prvPublishDeviceMetricsReport( ulReportLength );
if( xStatus != true )
{
LogError( ( "Failed to publish Device Defender report." ) );
}
}
/* Wait for the response to our report. Response will be handled by the
* callback passed to xEstablishMqttSession() earlier.
* The callback will verify that the MQTT messages received are from the
* defender service's topic. Based on whether the response comes from
* the accepted or rejected topics, it updates xReportStatus. */
if( xStatus == true )
{
for( i = 0; i < DEFENDER_RESPONSE_WAIT_SECONDS; i++ )
{
( void ) xProcessLoop( &xMqttContext, 1000 );
/* xReportStatus is updated in the prvPublishCallback. */
if( xReportStatus != ReportStatusNotReceived )
{
break;
}
}
}
if( xReportStatus == ReportStatusNotReceived )
{
LogError( ( "Failed to receive response from AWS IoT Device Defender Service." ) );
xStatus = false;
}
/**************************** Disconnect. *****************************/
/* Unsubscribe and disconnect if MQTT session was established. Per the MQTT
* protocol spec, it is okay to send UNSUBSCRIBE even if no corresponding
* subscription exists on the broker. Therefore, it is okay to attempt
* unsubscribe even if one more subscribe failed earlier. */
if( xMqttSessionEstablished )
{
LogInfo( ( "Unsubscribing from defender topics..." ) );
xStatus = prvUnsubscribeFromDefenderTopics();
if( xStatus != true )
{
LogError( ( "Failed to unsubscribe from defender topics." ) );
}
LogInfo( ( "Closing MQTT session..." ) );
( void ) xDisconnectMqttSession( &xMqttContext,
&xNetworkContext );
}
if( ( xStatus == true ) && ( xReportStatus == ReportStatusAccepted ) )
{
xExitStatus = EXIT_SUCCESS;
}
/*********************** Retry in case of failure. ************************/
/* Increment the demo run count. */
uxDemoRunCount++;
if( xExitStatus == EXIT_SUCCESS )
{
LogInfo( ( "Demo iteration %lu is successful.", uxDemoRunCount ) );
}
/* Attempt to retry a failed iteration of demo for up to #DEFENDER_MAX_DEMO_LOOP_COUNT times. */
else if( uxDemoRunCount < DEFENDER_MAX_DEMO_LOOP_COUNT )
{
LogWarn( ( "Demo iteration %lu failed. Retrying...", uxDemoRunCount ) );
vTaskDelay( DELAY_BETWEEN_DEMO_RETRY_ITERATIONS_TICKS );
}
/* Failed all #DEFENDER_MAX_DEMO_LOOP_COUNT demo iterations. */
else
{
LogError( ( "All %d demo iterations failed.", DEFENDER_MAX_DEMO_LOOP_COUNT ) );
break;
}
} while( xExitStatus != EXIT_SUCCESS );
/****************************** Finish. ******************************/
if( xExitStatus == EXIT_SUCCESS )
{
LogInfo( ( "Demo completed successfully." ) );
}
else
{
LogError( ( "Demo failed." ) );
}
/* Delete this task. */
LogInfo( ( "Deleting Defender Demo task." ) );
vTaskDelete( NULL );
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,200 @@
/*
* FreeRTOS V202111.00
* 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 FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* http://www.freertos.org/a00110.html
*
* The bottom of this file contains some constants specific to running the UDP
* stack in this demo. Constants specific to FreeRTOS+TCP itself (rather than
* the demo) are contained in FreeRTOSIPConfig.h.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configMAX_PRIORITIES ( 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Event group related definitions. */
#define configUSE_EVENT_GROUPS 1
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_pcTaskGetTaskName 1
/* Assert call defined for debug builds. */
#ifdef _DEBUG
extern void vAssertCalled( const char * pcFile,
uint32_t ulLine );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#endif /* _DEBUG */
/* Application specific definitions follow. **********************************/
/* Only used when running in the FreeRTOS Windows simulator. Defines the
* priority of the task used to simulate Ethernet interrupts. */
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
/* This demo creates a virtual network connection by accessing the raw Ethernet
* or WiFi data to and from a real network connection. Many computers have more
* than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
* the demo which real port should be used to create the virtual port. The ports
* available are displayed on the console when the application is executed. For
* example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
* results in the wired network being used, while setting
* configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
* used. */
#define configNETWORK_INTERFACE_TO_USE ( 0L )
/* The address to which logging is sent should UDP logging be enabled. */
#define configUDP_LOGGING_ADDR0 192
#define configUDP_LOGGING_ADDR1 168
#define configUDP_LOGGING_ADDR2 0
#define configUDP_LOGGING_ADDR3 11
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet/WiFi data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition above for information on how to
* configure the real network connection to use. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x11
#define configMAC_ADDR2 0x11
#define configMAC_ADDR3 0x11
#define configMAC_ADDR4 0x11
#define configMAC_ADDR5 0x41
/* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configIP_ADDR0 10
#define configIP_ADDR1 10
#define configIP_ADDR2 10
#define configIP_ADDR3 200
/* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to
* 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configGATEWAY_ADDR0 10
#define configGATEWAY_ADDR1 10
#define configGATEWAY_ADDR2 10
#define configGATEWAY_ADDR3 1
/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
* 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set
* to 1 but a DNS server cannot be contacted.*/
#define configDNS_SERVER_ADDR0 208
#define configDNS_SERVER_ADDR1 67
#define configDNS_SERVER_ADDR2 222
#define configDNS_SERVER_ADDR3 222
/* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configNET_MASK0 255
#define configNET_MASK1 0
#define configNET_MASK2 0
#define configNET_MASK3 0
/* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 )
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/* Visual studio does not have an implementation of strcasecmp(). */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strcmpi _strcmpi
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
#define configPRINTF( X ) vLoggingPrintf X
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,311 @@
/*
* FreeRTOS V202111.00
* 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 the following URL for configuration information.
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html
*
*****************************************************************************/
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
#include "tcp_netstat.h"
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
* 1 then FreeRTOS_debug_printf should be defined to the function used to print
* out the debugging messages. */
#define ipconfigHAS_DEBUG_PRINTF 0
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
#define FreeRTOS_debug_printf( X ) vLoggingPrintf X
#endif
/* Set to 1 to print out non debugging messages, for example the output of the
* FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
* then FreeRTOS_printf should be set to the function used to print out the
* messages. */
#define ipconfigHAS_PRINTF 1
#if ( ipconfigHAS_PRINTF == 1 )
#define FreeRTOS_printf( X ) vLoggingPrintf X
#endif
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
/* If the network card/driver includes checksum offloading (IP/TCP/UDP checksums)
* then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1 to prevent the software
* stack repeating the checksum calculations. */
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
/* Several API's will block until the result is known, or the action has been
* performed, for example FreeRTOS_send() and FreeRTOS_recv(). The timeouts can be
* set per socket, using setsockopt(). If not set, the times below will be
* used as defaults. */
#define ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME ( 2000 )
#define ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME ( 5000 )
/* Include support for LLMNR: Link-local Multicast Name Resolution
* (non-Microsoft) */
#define ipconfigUSE_LLMNR ( 0 )
/* Include support for NBNS: NetBIOS Name Service (Microsoft) */
#define ipconfigUSE_NBNS ( 0 )
/* Include support for DNS caching. For TCP, having a small DNS cache is very
* useful. When a cache is present, ipconfigDNS_REQUEST_ATTEMPTS can be kept low
* and also DNS may use small timeouts. If a DNS reply comes in after the DNS
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket. */
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 64 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
/* The IP stack executes it its own task (although any application task can make
* use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY
* sets the priority of the task that executes the IP stack. The priority is a
* standard FreeRTOS task priority so can take any value from 0 (the lowest
* priority) to (configMAX_PRIORITIES - 1) (the highest priority).
* configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in
* FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to
* the priority assigned to the task executing the IP stack relative to the
* priority assigned to tasks that use the IP stack. */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+TCP
* task. This setting is less important when the FreeRTOS Win32 simulator is used
* as the Win32 simulator only stores a fixed amount of information on the task
* stack. FreeRTOS includes optional stack overflow detection, see:
* http://www.freertos.org/Stacks-and-stack-overflow-checking.html */
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 5 )
/* ipconfigRAND32() is called by the IP stack to generate random numbers for
* things such as a DHCP transaction number or initial sequence number. Random
* number generation is performed via this macro to allow applications to use their
* own random number generation method. For example, it might be possible to
* generate a random number by sampling noise on an analogue input. */
extern UBaseType_t uxRand();
#define ipconfigRAND32() uxRand()
/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the
* network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK
* is not set to 1 then the network event hook will never be called. See
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml
*/
#define ipconfigUSE_NETWORK_EVENT_HOOK 1
/* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but
* a network buffer cannot be obtained then the calling task is held in the Blocked
* state (so other tasks can continue to executed) until either a network buffer
* becomes available or the send block time expires. If the send block time expires
* then the send operation is aborted. The maximum allowable send block time is
* capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the
* maximum allowable send block time prevents a deadlock occurring when
* all the network buffers are in use and the tasks that process (and subsequently
* free) the network buffers are themselves blocked waiting for a network buffer.
* ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
* milliseconds can be converted to a time in ticks by dividing the time in
* milliseconds by portTICK_PERIOD_MS. */
#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000 / portTICK_PERIOD_MS )
/* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP
* address, netmask, DNS server address and gateway address from a DHCP server. If
* ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will use a static IP address. The
* stack will revert to using the static IP address even when ipconfigUSE_DHCP is
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
* and accepted, or the interval between transmissions reaches
* ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the
* static IP address passed as a parameter to FreeRTOS_IPInit() if the
* re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without
* a DHCP reply being received. */
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_PERIOD_MS )
/* The ARP cache is a table that maps IP addresses to MAC addresses. The IP
* stack can only send a UDP message to a remove IP address if it knowns the MAC
* address associated with the IP address, or the MAC address of the router used to
* contact the remote IP address. When a UDP message is received from a remote IP
* address the MAC address and IP address are added to the ARP cache. When a UDP
* message is sent to a remote IP address that does not already appear in the ARP
* cache then the UDP message is replaced by a ARP message that solicits the
* required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum
* number of entries that can exist in the ARP table at any one time. */
#define ipconfigARP_CACHE_ENTRIES 6
/* ARP requests that do not result in an ARP response will be re-transmitted a
* maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is
* aborted. */
#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )
/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP
* table being created or refreshed and the entry being removed because it is stale.
* New ARP requests are sent for ARP cache entries that are nearing their maximum
* age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is
* equal to 1500 seconds (or 25 minutes). */
#define ipconfigMAX_ARP_AGE 150
/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling
* routines, which are relatively large. To save code space the full
* FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster
* alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr()
* takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.
* FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets
* (for example, 192, 168, 0, 1) as its parameters. If
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
#define ipconfigINCLUDE_FULL_INET_ADDR 1
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
* to ensure the total amount of RAM that can be consumed by the IP stack is capped
* to a pre-determinable value. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
/* A FreeRTOS queue is used to send events from application tasks to the IP
* stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can
* be queued for processing at any one time. The event queue must be a minimum of
* 5 greater than the total number of network buffers. */
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )
/* The address of a socket is the combination of its IP address and its port
* number. FreeRTOS_bind() is used to manually allocate a port number to a socket
* (to 'bind' the socket to a port), but manual binding is not normally necessary
* for client sockets (those sockets that initiate outgoing connections rather than
* wait for incoming connections on a known port number). If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling
* FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP
* stack automatically binding the socket to a port number from the range
* socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()
* on a socket that has not yet been bound will result in the send operation being
* aborted. */
#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1
/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */
#define ipconfigUDP_TIME_TO_LIVE 128
#define ipconfigTCP_TIME_TO_LIVE 128 /* also defined in FreeRTOSIPConfigDefaults.h */
/* USE_TCP: Use TCP and all its features */
#define ipconfigUSE_TCP ( 1 )
/* Use the TCP socket wake context with a callback. */
#define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK_WITH_CONTEXT ( 1 )
/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 1 )
/* The MTU is the maximum number of bytes the payload of a network frame can
* contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1200
/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
#define ipconfigREPLY_TO_INCOMING_PINGS 1
/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the
* FreeRTOS_SendPingRequest() API function is available. */
#define ipconfigSUPPORT_OUTGOING_PINGS 0
/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()
* (and associated) API function is available. */
#define ipconfigSUPPORT_SELECT_FUNCTION 1
/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames
* that are not in Ethernet II format will be dropped. This option is included for
* potential future IP stack developments. */
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the
* responsibility of the Ethernet interface to filter out packets that are of no
* interest. If the Ethernet interface does not implement this functionality, then
* set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack
* perform the filtering instead (it is much less efficient for the stack to do it
* because the packet will already have been passed into the stack). If the
* Ethernet driver does all the necessary filtering in hardware then software
* filtering can be removed by using a value other than 1 or 0. */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
/* The windows simulator cannot really simulate MAC interrupts, and needs to
* block occasionally to allow other tasks to run. */
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS )
/* Advanced only: in order to access 32-bit fields in the IP packets with
* 32-bit memory instructions, all packets will be stored 32-bit-aligned, plus 16-bits.
* This has to do with the contents of the IP-packets: all 32-bit fields are
* 32-bit-aligned, plus 16-bit(!) */
#define ipconfigPACKET_FILLER_SIZE 2
/* Define the size of the pool of TCP window descriptors. On the average, each
* TCP socket will use up to 2 x 6 descriptors, meaning that it can have 2 x 6
* outstanding packets (for Rx and Tx). When using up to 10 TP sockets
* simultaneously, one could define TCP_WIN_SEG_COUNT as 120. */
#define ipconfigTCP_WIN_SEG_COUNT 240
/* Each TCP socket has a circular buffers for Rx and Tx, which have a fixed
* maximum size. Define the size of Rx buffer for TCP sockets. */
#define ipconfigTCP_RX_BUFFER_LENGTH ( 5000 )
/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )
/* When using call-back handlers, the driver may check if the handler points to
* real program memory (RAM or flash) or just has a random non-zero value. */
#define ipconfigIS_VALID_PROG_ADDRESS( x ) ( ( x ) != NULL )
/* Include support for TCP hang protection. All sockets in a connecting or
* disconnecting stage will timeout after a period of non-activity. */
#define ipconfigTCP_HANG_PROTECTION ( 1 )
#define ipconfigTCP_HANG_PROTECTION_TIME ( 30 )
/* Include support for TCP keep-alive messages. */
#define ipconfigTCP_KEEP_ALIVE ( 1 )
#define ipconfigTCP_KEEP_ALIVE_INTERVAL ( 20 ) /* in seconds */
#define portINLINE __inline
#endif /* FREERTOS_IP_CONFIG_H */

View File

@ -0,0 +1,629 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging;..\..\..\Common\WinPCap;..\..\..\..\..\FreeRTOS\Source\include;..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp;..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls;..\..\..\..\Source\Utilities\mbedtls_freertos;..\..\..\..\..\Source\mbedtls_utils;..\..\..\..\ThirdParty\mbedtls\include;..\..\..\..\Source\AWS\device-defender\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\Mqtt_Demo_Helpers;..\..\..\..\Source\FreeRTOS-Plus-TCP\tools\tcp_utilities\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/wd4210 /wd4127 /wd4214 /wd4201 /wd4244 /wd4310 /wd4200 %(AdditionalOptions)</AdditionalOptions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Common\WinPCap</AdditionalLibraryDirectories>
<Profile>false</Profile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\..\..\Source\include;..\..\..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\tools\tcp_utilities\tcp_netstat.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.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\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\AWS\device-defender\source\defender.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c" />
<ClCompile Include="DemoTasks\DefenderDemoExample.c" />
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
<ClCompile Include="main.c" />
<ClCompile Include="metrics_collector.c" />
<ClCompile Include="report_builder.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-defender\source\include\defender.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-defender\source\include\defender_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h" />
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\tools\tcp_utilities\include\tcp_netstat.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.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\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h" />
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="defender_config.h" />
<ClInclude Include="mbedtls_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="core_mqtt_config.h" />
<ClInclude Include="metrics_collector.h" />
<ClInclude Include="report_builder.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,822 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="FreeRTOS">
<UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source">
<UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>
<Extensions>*.c</Extensions>
</Filter>
<Filter Include="FreeRTOS\Source\Portable">
<UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+">
<UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source\include">
<UniqueIdentifier>{d2dcd641-8d91-492b-852f-5563ffadaec6}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP">
<UniqueIdentifier>{8672fa26-b119-481f-8b8d-086419c01a3e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\portable">
<UniqueIdentifier>{4570be11-ec96-4b55-ac58-24b50ada980a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\include">
<UniqueIdentifier>{5d93ed51-023a-41ad-9243-8d230165d34b}</UniqueIdentifier>
</Filter>
<Filter Include="DemoTasks">
<UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries">
<UniqueIdentifier>{60717407-397f-4ea5-8492-3314acdd25f0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard">
<UniqueIdentifier>{8a90222f-d723-4b4e-8e6e-c57afaf7fa92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT">
<UniqueIdentifier>{2d17d5e6-ed70-4e42-9693-f7a63baf4948}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include">
<UniqueIdentifier>{6ad56e6d-c330-4830-8f4b-c75b05dfa866}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform">
<UniqueIdentifier>{84613aa2-91dc-4e1a-a3b3-823b6d7bf0e0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls">
<UniqueIdentifier>{7bedd2e3-adbb-4c95-9632-445132b459ce}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\include">
<UniqueIdentifier>{07a14673-4d02-4780-a099-6b8c654dff91}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\library">
<UniqueIdentifier>{e875c5e3-40a2-4408-941e-5e1a951cc663}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls">
<UniqueIdentifier>{8a0aa896-6b3a-49b3-997e-681f0d1949ae}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{c5a01679-3e7a-4320-97ac-ee5b872c1650}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include">
<UniqueIdentifier>{c992824d-4198-46b2-8d59-5f99ab9946ab}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{6a35782c-bc09-42d5-a850-98bcb668a4dc}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON">
<UniqueIdentifier>{20aee693-d2dc-480e-ae21-0db2156e54ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS">
<UniqueIdentifier>{0dacb84e-5cc3-4eed-8fb1-68b6e4741f77}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{21d4cf41-bbdc-46af-8508-1193e3b6595a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\tcp_utilities">
<UniqueIdentifier>{ca4314cd-3b61-4dd8-b5ab-dbc3f1ed004e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\tcp_utilities\include">
<UniqueIdentifier>{9f1aaf81-1839-4673-b7e3-1501dd0edd02}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-defender">
<UniqueIdentifier>{35c65887-47a1-496f-b632-8082be580456}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-defender\include">
<UniqueIdentifier>{974934dc-7cd5-40f6-b449-3b932adf89ab}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm">
<UniqueIdentifier>{fcf93295-15e2-4a84-a5e9-b3c162e9f061}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\logging">
<UniqueIdentifier>{40de67d3-3815-46f9-a581-c1a01dbacc92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include">
<UniqueIdentifier>{2bef4675-f45b-4988-9db3-4ddbf60406ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include">
<UniqueIdentifier>{ced49869-3746-4f73-ba8d-4513320e5e9b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON</Filter>
</ClCompile>
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
<ClCompile Include="DemoTasks\DefenderDemoExample.c">
<Filter>DemoTasks</Filter>
</ClCompile>
<ClCompile Include="metrics_collector.c" />
<ClCompile Include="report_builder.c" />
<ClCompile Include="main.c" />
<ClCompile Include="..\..\..\..\Source\AWS\device-defender\source\defender.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-defender</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\tools\tcp_utilities\tcp_netstat.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\tcp_utilities</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="metrics_collector.h" />
<ClInclude Include="report_builder.h" />
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-defender\source\include\defender.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-defender\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\device-defender\source\include\defender_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-defender\include</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="defender_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSIPConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\tools\tcp_utilities\include\tcp_netstat.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\tcp_utilities\include</Filter>
</ClInclude>
<ClInclude Include="mbedtls_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,96 @@
/*
* FreeRTOS V202111.00
* 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 Determines the maximum number of MQTT PUBLISH messages, pending
* acknowledgement at a time, that are supported for incoming and outgoing
* direction of messages, separately.
*
* QoS 1 and 2 MQTT PUBLISHes require acknowledgement from the server before
* they can be completed. While they are awaiting the acknowledgement, 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, separately, for both incoming and outgoing direction of
* PUBLISHes.
*
* @note The MQTT context maintains separate state records for outgoing
* and incoming PUBLISHes, and thus, 2 * MQTT_STATE_ARRAY_MAX_COUNT amount
* of memory is statically allocated for the state records.
*/
#define MQTT_STATE_ARRAY_MAX_COUNT ( 10U )
/**
* @brief Number of milliseconds to wait for a ping response to a ping
* request as part of the keep-alive mechanism.
*
* If a ping response is not received before this timeout, then
* #MQTT_ProcessLoop will return #MQTTKeepAliveTimeout.
*/
#define MQTT_PINGRESP_TIMEOUT_MS ( 5000U )
#endif /* ifndef CORE_MQTT_CONFIG_H */

View File

@ -0,0 +1,95 @@
/*
* FreeRTOS V202111.00
* 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 DEFENDER_CONFIG_H_
#define DEFENDER_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.
* 3. Include the header file "logging_stack.h".
*/
#include "logging_levels.h"
/* Logging configuration for the Defender library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "Defender"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* AWS IoT Device Defender Service supports both long and short names for keys
* in the report sent by a device. For example,
*
* A device defender report using long key names:
* {
* "header": {
* "report_id": 1530304554,
* "version": "1.0"
* },
* "metrics": {
* "network_stats": {
* "bytes_in": 29358693495,
* "bytes_out": 26485035,
* "packets_in": 10013573555,
* "packets_out": 11382615
* }
* }
* }
*
* An equivalent report using short key names:
* {
* "hed": {
* "rid": 1530304554,
* "v": "1.0"
* },
* "met": {
* "ns": {
* "bi": 29358693495,
* "bo": 26485035,
* "pi": 10013573555,
* "po": 11382615
* }
* }
* }
*
* Set to 1 to enable use of long key names in the defender report.
*/
#define DEFENDER_USE_LONG_KEYS 0
#endif /* ifndef DEFENDER_CONFIG_H_ */

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {150F08BF-9D61-4CC2-8DBF-1335172A1EA4}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FreeRTOS_Plus_TCP_Minimal.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,288 @@
/*
* FreeRTOS V202111.00
* 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
/* FreeRTOS config include. */
#include "FreeRTOSConfig.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 "DefenderDemo"
#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 The Thing resource registered on your AWS IoT account to use in the demo.
* A Thing resource is required to communicate with the AWS IoT Device Shadow service.
*
* @note The Things associated with your AWS account can be found in the
* AWS IoT console under Manage/Things, or using the ListThings REST API (that can
* be called with the AWS CLI command line tool).
*
* #define democonfigTHING_NAME "...insert here..."
*/
#ifndef democonfigCLIENT_IDENTIFIER
/**
* @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.
*
* @note Appending __TIME__ to the client id string will reduce the possibility of a
* client id collision in the broker. Note that the appended time is the compilation
* time. This client id can cause collision, if more than one instance of the same
* binary is used at the same time to connect to the broker.
*/
#define democonfigCLIENT_IDENTIFIER "testClient"__TIME__
#endif
/**
* @brief The AWS IoT broker endpoint to connect to in the demo.
*
* @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
* Settings/Custom Endpoint, or using the DescribeEndpoint REST API (that can
* be called with AWS CLI command line tool).
*
* #define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
*/
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections.
*
* @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. )
*/
/**
* @brief AWS root CA certificate.
*
* This certificate is used to identify the AWS IoT server and is publicly available.
* Refer to the link below.
* https://www.amazontrust.com/repository/AmazonRootCA1.pem
*
* @note This certificate should be PEM-encoded.
*
* 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.
*
* Please 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 refer to the AWS documentation below for details
* regarding client authentication.
* 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 The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* Please 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.
*
* Please 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.
*/
#include "core_mqtt.h" /* Include coreMQTT header for MQTT_LIBRARY_VERSION macro. */
#define democonfigMQTT_LIB "core-mqtt@"MQTT_LIBRARY_VERSION
/**
* @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
/**
* @brief Size of the network buffer for MQTT packets.
*/
#define democonfigNETWORK_BUFFER_SIZE ( 1024U )
/**
* @brief Size of the open TCP ports array.
*
* A maximum of these many open TCP ports will be sent in the device defender
* report.
*/
#define democonfigOPEN_TCP_PORTS_ARRAY_SIZE 10
/**
* @brief Size of the open UDP ports array.
*
* A maximum of these many open UDP ports will be sent in the device defender
* report.
*/
#define democonfigOPEN_UDP_PORTS_ARRAY_SIZE 10
/**
* @brief Size of the established connections array.
*
* A maximum of these many established connections will be sent in the device
* defender report.
*/
#define democonfigESTABLISHED_CONNECTIONS_ARRAY_SIZE 10
/**
* @brief Size of the task numbers array.
*
* This must be at least the number of tasks used.
*/
#define democonfigCUSTOM_METRICS_TASKS_ARRAY_SIZE 10
/**
* @brief Size of the buffer which contains the generated device defender report.
*
* If the generated report is larger than this, it is rejected.
*/
#define democonfigDEVICE_METRICS_REPORT_BUFFER_SIZE 1000
/**
* @brief Major version number of the device defender report.
*/
#define democonfigDEVICE_METRICS_REPORT_MAJOR_VERSION 1
/**
* @brief Minor version number of the device defender report.
*/
#define democonfigDEVICE_METRICS_REPORT_MINOR_VERSION 0
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,381 @@
/*
* FreeRTOS V202111.00
* 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/iot-device-defender for configuration and usage instructions.
***/
/* Standard includes. */
#include <stdio.h>
#include <time.h>
#include <stdint.h>
/* Visual studio intrinsics used so the __debugbreak() function is available
* should an assert get hit. */
#include <intrin.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* TCP/IP stack includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*
* Prototypes for the demos that can be started from this project. Note the
* Defender demo is not actually started until the network is already, which is
* indicated by vApplicationIPNetworkEventHook() executing - hence
* vStartDefenderDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartDefenderDemo( void );
/*
* Just seeds the simple pseudo random number generator.
*
* !!! NOTE !!!
* This is not a secure method of generating random numbers and production
* devices should use a true random number generator (TRNG).
*/
static void prvSRand( UBaseType_t ulSeed );
/*
* Miscellaneous initialization including preparing the logging and seeding the
* random number generator.
*/
static void prvMiscInitialisation( void );
/* The default IP and MAC address used by the demo. The address configuration
* defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is
* 1 but a DHCP server could not be contacted. See the online documentation for
* more information. */
static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };
static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };
static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };
static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };
/* Set the following constant to pdTRUE to log using the method indicated by the
* name of the constant, or pdFALSE to not log using the method indicated by the
* name of the constant. Options include to standard out (xLogToStdout), to a disk
* file (xLogToFile), and to a UDP port (xLogToUDP). If xLogToUDP is set to pdTRUE
* then UDP messages are sent to the IP address configured as the UDP logging server
* address (see the configUDP_LOGGING_ADDR0 definitions in FreeRTOSConfig.h) and
* the port number set by configPRINT_PORT in FreeRTOSConfig.h. */
const BaseType_t xLogToStdout = pdTRUE, xLogToFile = pdFALSE, xLogToUDP = pdFALSE;
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition for information on how to configure
* the real network connection to use. */
const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
/* Used by the pseudo random number generator. */
static UBaseType_t ulNextRand;
/*-----------------------------------------------------------*/
int main( void )
{
/***
* See https://www.FreeRTOS.org/iot-device-shadow for configuration and usage instructions.
***/
/* Miscellaneous initialization including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
/* Initialize the network interface.
*
***NOTE*** Tasks that use the network are created in the network event hook
* when the network is connected and ready for use (see the implementation of
* vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* 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 (this is standard text that is not
* really applicable to the Win32 simulator port). */
for( ; ; )
{
__debugbreak();
}
}
/*-----------------------------------------------------------*/
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
* events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
static BaseType_t xTasksAlreadyCreated = pdFALSE;
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
/* Create the tasks that use the IP stack if they have not already been
* created. */
if( xTasksAlreadyCreated == pdFALSE )
{
/* Demos that use the network are created after the network is
* up. */
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );
vStartDefenderDemo();
xTasksAlreadyCreated = pdTRUE;
}
/* Print out the network configuration, which may have come from a DHCP
* server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
LogInfo( ( "\r\n\r\nIP Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer );
LogInfo( ( "Subnet Mask: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );
LogInfo( ( "Gateway Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );
LogInfo( ( "DNS Server Address: %s\r\n\r\n\r\n", cBuffer ) );
}
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile,
uint32_t ulLine )
{
volatile uint32_t ulBlockVariable = 0UL;
volatile char * pcFileName = ( volatile char * ) pcFile;
volatile uint32_t ulLineNumber = ulLine;
( void ) pcFileName;
( void ) ulLineNumber;
printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */
taskDISABLE_INTERRUPTS();
{
while( ulBlockVariable == 0UL )
{
__debugbreak();
}
}
taskENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
UBaseType_t uxRand( void )
{
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/*
* Utility function to generate a pseudo random number.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
}
/*-----------------------------------------------------------*/
static void prvSRand( UBaseType_t ulSeed )
{
/* Utility function to seed the pseudo random number generator. */
ulNextRand = ulSeed;
}
/*-----------------------------------------------------------*/
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
/*
* Seed random number generator.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
}
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
const char * pcApplicationHostnameHook( void )
{
/* Assign the name "FreeRTOS" to this network node. This function will
* be called during the DHCP: the machine will be registered with an IP
* address plus this name. */
return mainHOST_NAME;
}
#endif
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 )
BaseType_t xApplicationDNSQueryHook( const char * pcName )
{
BaseType_t xReturn;
/* Determine if a name lookup is for this node. Two names are given
* to this node: that returned by pcApplicationHostnameHook() and that set
* by mainDEVICE_NICK_NAME. */
if( _stricmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( _stricmp( pcName, mainDEVICE_NICK_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) */
/*-----------------------------------------------------------*/
/*
* Callback that provides the inputs necessary to generate a randomized TCP
* Initial Sequence Number per RFC 6528. THIS IS ONLY A DUMMY IMPLEMENTATION
* THAT RETURNS A PSEUDO RANDOM NUMBER SO IS NOT INTENDED FOR USE IN PRODUCTION
* SYSTEMS.
*/
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
{
( void ) ulSourceAddress;
( void ) usSourcePort;
( void ) ulDestinationAddress;
( void ) usDestinationPort;
return uxRand();
}
/*-----------------------------------------------------------*/
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.
*/
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
* implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
* used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
* state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
* application must provide an implementation of vApplicationGetTimerTaskMemory()
* to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
uint32_t * pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
* task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,137 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/* This file configures mbed TLS for FreeRTOS. */
#ifndef MBEDTLS_CONFIG_H_
#define MBEDTLS_CONFIG_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Generate errors if deprecated functions are used. */
#define MBEDTLS_DEPRECATED_REMOVED
/* Place AES tables in ROM. */
#define MBEDTLS_AES_ROM_TABLES
/* Enable the following cipher modes. */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CFB
#define MBEDTLS_CIPHER_MODE_CTR
/* Enable the following cipher padding modes. */
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
#define MBEDTLS_CIPHER_PADDING_ZEROS
/* Cipher suite configuration. */
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/* Enable all SSL alert messages. */
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/* Enable the following SSL features. */
#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_ALPN
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/* Check certificate key usage. */
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/* Disable platform entropy functions. */
#define MBEDTLS_NO_PLATFORM_ENTROPY
/* Enable the following mbed TLS features. */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_GCM_C
#define MBEDTLS_MD_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_THREADING_ALT
#define MBEDTLS_THREADING_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
/* Set the memory allocation functions on FreeRTOS. */
void * mbedtls_platform_calloc( size_t nmemb,
size_t size );
void mbedtls_platform_free( void * ptr );
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
/* The network send and receive functions on FreeRTOS. */
int mbedtls_platform_send( void * ctx,
const unsigned char * buf,
size_t len );
int mbedtls_platform_recv( void * ctx,
unsigned char * buf,
size_t len );
/* These two macro used by mbedtls_ssl_set_bio in using_mbedtls network
* transport layer. */
#define MBEDTLS_SSL_SEND mbedtls_platform_send
#define MBEDTLS_SSL_RECV mbedtls_platform_recv
/* The entropy poll function. */
int mbedtls_platform_entropy_poll( void * data,
unsigned char * output,
size_t len,
size_t * olen );
#include "mbedtls/check_config.h"
#endif /* ifndef MBEDTLS_CONFIG_H_ */

View File

@ -0,0 +1,270 @@
/*
* FreeRTOS V202111.00
* 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 metrics_collector.c
*
* @brief Functions used by the defender demo to collect metrics on the
* device's open ports and sockets. FreeRTOS+TCP tcp_netstat utility
* is used to collect this metrics.
*/
/* Standard includes. */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "FreeRTOS_IP.h"
/* Demo config. */
#include "demo_config.h"
/* Interface include. */
#include "metrics_collector.h"
/*-----------------------------------------------------------*/
eMetricsCollectorStatus eGetNetworkStats( NetworkStats_t * pxOutNetworkStats )
{
eMetricsCollectorStatus eStatus = eMetricsCollectorSuccess;
MetricsType_t xMetrics = { 0 };
BaseType_t xMetricsStatus = 0;
configASSERT( pxOutNetworkStats != NULL );
/* Start with everything as zero. */
memset( pxOutNetworkStats, 0, sizeof( NetworkStats_t ) );
/* Get metrics from FreeRTOS+TCP tcp_netstat utility. */
xMetricsStatus = vGetMetrics( &xMetrics );
if( xMetricsStatus != 0 )
{
LogError( ( "Failed to acquire metrics from FreeRTOS+TCP tcp_netstat utility. Status: %d.",
( int ) xMetricsStatus ) );
eStatus = eMetricsCollectorCollectionFailed;
}
/* Fill our response with values gotten from FreeRTOS+TCP. */
if( eStatus == eMetricsCollectorSuccess )
{
LogDebug( ( "Network stats read. Bytes received: %lu, packets received: %lu, "
"bytes sent: %lu, packets sent: %lu.",
( unsigned long ) xMetrics.xInput.uxByteCount,
( unsigned long ) xMetrics.xInput.uxPacketCount,
( unsigned long ) xMetrics.xOutput.uxByteCount,
( unsigned long ) xMetrics.xOutput.uxPacketCount ) );
pxOutNetworkStats->ulBytesReceived = xMetrics.xInput.uxByteCount;
pxOutNetworkStats->ulPacketsReceived = xMetrics.xInput.uxPacketCount;
pxOutNetworkStats->ulBytesSent = xMetrics.xOutput.uxByteCount;
pxOutNetworkStats->ulPacketsSent = xMetrics.xOutput.uxPacketCount;
}
return eStatus;
}
/*-----------------------------------------------------------*/
eMetricsCollectorStatus eGetOpenTcpPorts( uint16_t * pusOutTcpPortsArray,
size_t xTcpPortsArrayLength,
size_t * pxOutNumTcpOpenPorts )
{
eMetricsCollectorStatus eStatus = eMetricsCollectorSuccess;
MetricsType_t xMetrics = { 0 };
BaseType_t xMetricsStatus = 0;
size_t xCopyAmount = 0UL;
/* pusOutTcpPortsArray can be NULL. */
configASSERT( pxOutNumTcpOpenPorts != NULL );
/* Get metrics from FreeRTOS+TCP tcp_netstat utility. */
xMetricsStatus = vGetMetrics( &xMetrics );
if( xMetricsStatus != 0 )
{
LogError( ( "Failed to acquire metrics from FreeRTOS+TCP tcp_netstat utility. Status: %d.",
( int ) xMetricsStatus ) );
eStatus = eMetricsCollectorCollectionFailed;
}
if( eStatus == eMetricsCollectorSuccess )
{
/* Fill the output array with as many TCP ports as will fit in the
* given array. */
if( pusOutTcpPortsArray != NULL )
{
xCopyAmount = xMetrics.xTCPPortList.uxCount;
/* Limit the copied ports to what can fit in the output array. */
if( xTcpPortsArrayLength < xMetrics.xTCPPortList.uxCount )
{
LogWarn( ( "Ports returned truncated due to insufficient buffer size." ) );
xCopyAmount = xTcpPortsArrayLength;
}
memcpy( pusOutTcpPortsArray, &xMetrics.xTCPPortList.usTCPPortList, xCopyAmount * sizeof( uint16_t ) );
/* Return the number of elements copied to the array. */
*pxOutNumTcpOpenPorts = xCopyAmount;
}
else
{
/* Return the total number of open ports. */
*pxOutNumTcpOpenPorts = xMetrics.xTCPPortList.uxCount;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/
eMetricsCollectorStatus eGetOpenUdpPorts( uint16_t * pusOutUdpPortsArray,
size_t xUdpPortsArrayLength,
size_t * pxOutNumUdpOpenPorts )
{
eMetricsCollectorStatus eStatus = eMetricsCollectorSuccess;
MetricsType_t xMetrics = { 0 };
BaseType_t xMetricsStatus = 0;
uint32_t xCopyAmount = 0UL;
/* pusOutUdpPortsArray can be NULL. */
configASSERT( pxOutNumUdpOpenPorts != NULL );
/* Get metrics from FreeRTOS+TCP tcp_netstat utility. */
xMetricsStatus = vGetMetrics( &xMetrics );
if( xMetricsStatus != 0 )
{
LogError( ( "Failed to acquire metrics from FreeRTOS+TCP tcp_netstat utility. Status: %d.",
( int ) xMetricsStatus ) );
eStatus = eMetricsCollectorCollectionFailed;
}
if( eStatus == eMetricsCollectorSuccess )
{
/* Fill the output array with as many UDP ports as will fit in the
* given array. */
if( pusOutUdpPortsArray != NULL )
{
xCopyAmount = xMetrics.xUDPPortList.uxCount;
/* Limit the copied ports to what can fit in the output array. */
if( xUdpPortsArrayLength < xMetrics.xUDPPortList.uxCount )
{
LogWarn( ( "Ports returned truncated due to insufficient buffer size." ) );
xCopyAmount = xUdpPortsArrayLength;
}
memcpy( pusOutUdpPortsArray, &xMetrics.xUDPPortList.usUDPPortList, xCopyAmount * sizeof( uint16_t ) );
/* Return the number of elements copied to the array. */
*pxOutNumUdpOpenPorts = xCopyAmount;
}
else
{
/* Return the total number of open ports. */
*pxOutNumUdpOpenPorts = xMetrics.xUDPPortList.uxCount;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/
eMetricsCollectorStatus eGetEstablishedConnections( Connection_t * pxOutConnectionsArray,
size_t xConnectionsArrayLength,
size_t * pxOutNumEstablishedConnections )
{
eMetricsCollectorStatus eStatus = eMetricsCollectorSuccess;
MetricsType_t xMetrics = { 0 };
BaseType_t xMetricsStatus = 0;
size_t xCopyAmount = 0UL;
uint32_t ulLocalIp = 0UL;
uint32_t i;
/* pxOutConnectionsArray can be NULL. */
configASSERT( pxOutNumEstablishedConnections != NULL );
/* Get metrics from FreeRTOS+TCP tcp_netstat utility. */
xMetricsStatus = vGetMetrics( &xMetrics );
if( xMetricsStatus != 0 )
{
LogError( ( "Failed to acquire metrics from FreeRTOS+TCP tcp_netstat utility. Status: %d.",
( int ) xMetricsStatus ) );
eStatus = eMetricsCollectorCollectionFailed;
}
if( eStatus == eMetricsCollectorSuccess )
{
/* Fill the output array with as many TCP socket infos as will fit in
* the given array. */
if( pxOutConnectionsArray != NULL )
{
xCopyAmount = xMetrics.xTCPSocketList.uxCount;
/* Get local IP as the tcp_netstat utility does not give it. */
ulLocalIp = FreeRTOS_GetIPAddress();
/* Limit the outputted connections to what can fit in the output array. */
if( xConnectionsArrayLength < xMetrics.xTCPSocketList.uxCount )
{
LogWarn( ( "Ports returned truncated due to insufficient buffer size." ) );
xCopyAmount = xConnectionsArrayLength;
}
for( i = 0; i < xCopyAmount; i++ )
{
pxOutConnectionsArray[ i ].ulLocalIp = ulLocalIp;
pxOutConnectionsArray[ i ].usLocalPort =
xMetrics.xTCPSocketList.xTCPList[ i ].usLocalPort;
pxOutConnectionsArray[ i ].ulRemoteIp =
xMetrics.xTCPSocketList.xTCPList[ i ].ulRemoteIP;
pxOutConnectionsArray[ i ].usRemotePort =
xMetrics.xTCPSocketList.xTCPList[ i ].usRemotePort;
}
/* Return the number of elements copied to the array. */
*pxOutNumEstablishedConnections = xCopyAmount;
}
else
{
/* Return the total number of established connections. */
*pxOutNumEstablishedConnections = xMetrics.xTCPSocketList.uxCount;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,149 @@
/*
* FreeRTOS V202111.00
* 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 metrics_collector.h
*
* @brief Functions used by the defender demo to collect metrics on the
* device's open ports and sockets.
*/
#ifndef METRICS_COLLECTOR_H_
#define METRICS_COLLECTOR_H_
#include <stdint.h>
/**
* @brief Return codes from metrics collector APIs.
*/
typedef enum
{
eMetricsCollectorSuccess = 0,
eMetricsCollectorBadParameter,
eMetricsCollectorCollectionFailed
} eMetricsCollectorStatus;
/**
* @brief Represents network stats.
*/
typedef struct NetworkStats
{
uint32_t ulBytesReceived; /**< Number of bytes received. */
uint32_t ulBytesSent; /**< Number of bytes sent. */
uint32_t ulPacketsReceived; /**< Number of packets (ethernet frames) received. */
uint32_t ulPacketsSent; /**< Number of packets (ethernet frames) sent. */
} NetworkStats_t;
/**
* @brief Represents a network connection.
*/
typedef struct Connection
{
uint32_t ulLocalIp;
uint32_t ulRemoteIp;
uint16_t usLocalPort;
uint16_t usRemotePort;
} Connection_t;
/**
* @brief Get network stats.
*
* This function returns the network stats.
*
* @param[out] pxOutNetworkStats The network stats.
*
* @return #eMetricsCollectorSuccess if the network stats are successfully obtained;
* #eMetricsCollectorBadParameter if invalid parameters are passed;
* #eMetricsCollectorCollectionFailed if the collection methods failed.
*/
eMetricsCollectorStatus eGetNetworkStats( NetworkStats_t * pxOutNetworkStats );
/**
* @brief Get a list of the open TCP ports.
*
* This function finds the open TCP ports. It can be called with
* @p pusOutTcpPortsArray NULL to get the number of the open TCP ports.
*
* @param[out] pusOutTcpPortsArray The array to write the open TCP ports into. This
* can be NULL, if only the number of open ports is needed.
* @param[in] xTcpPortsArrayLength Length of the pusOutTcpPortsArray, if it is not
* NULL.
* @param[out] pxOutNumTcpOpenPorts Number of open TCP ports if @p
* pusOutTcpPortsArray NULL, else number of TCP ports written.
*
* @return #eMetricsCollectorSuccess if open TCP ports are successfully obtained;
* #eMetricsCollectorBadParameter if invalid parameters are passed;
* #eMetricsCollectorCollectionFailed if the collection methods failed.
*/
eMetricsCollectorStatus eGetOpenTcpPorts( uint16_t * pusOutTcpPortsArray,
size_t xTcpPortsArrayLength,
size_t * pxOutNumTcpOpenPorts );
/**
* @brief Get a list of the open UDP ports.
*
* This function finds the open UDP ports. It can be called with
* @p pusOutUdpPortsArray NULL to get the number of the open UDP ports.
*
* @param[out] pusOutUdpPortsArray The array to write the open UDP ports into. Can
* be NULL, if only number of open ports is needed.
* @param[in] xUdpPortsArrayLength Length of the pusOutUdpPortsArray, if it is not
* NULL.
* @param[out] pxOutNumUdpOpenPorts Number of open UDP ports if @p
* pusOutUdpPortsArray NULL, else number of UDP ports written.
*
* @return #eMetricsCollectorSuccess if open UDP ports are successfully obtained;
* #eMetricsCollectorBadParameter if invalid parameters are passed;
* #eMetricsCollectorCollectionFailed if the collection methods failed.
*/
eMetricsCollectorStatus eGetOpenUdpPorts( uint16_t * pusOutUdpPortsArray,
size_t xUdpPortsArrayLength,
size_t * pxOutNumUdpOpenPorts );
/**
* @brief Get a list of established connections.
*
* This function finds the established TCP connections.
* It can be called with @p pxOutConnectionsArray NULL to get the number of
* established connections.
*
* @param[out] pxOutConnectionsArray The array to write the established connections
* into. This can be NULL, if only the number of established connections is
* needed.
* @param[in] xConnectionsArrayLength Length of the pxOutConnectionsArray, if it
* is not NULL.
* @param[out] pxOutNumEstablishedConnections Number of established connections if @p
* pxOutNumEstablishedConnections NULL, else number of established connections written.
*
* @return #eMetricsCollectorSuccess if established connections are successfully obtained;
* #eMetricsCollectorBadParameter if invalid parameters are passed;
* #eMetricsCollectorCollectionFailed if the collection methods failed.
*/
eMetricsCollectorStatus eGetEstablishedConnections( Connection_t * pxOutConnectionsArray,
size_t xConnectionsArrayLength,
size_t * pxOutNumEstablishedConnections );
#endif /* ifndef METRICS_COLLECTOR_H_ */

View File

@ -0,0 +1,651 @@
/*
* FreeRTOS V202111.00
* 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 <stdio.h>
#include <string.h>
#include <stdint.h>
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo config. */
#include "demo_config.h"
/* Device Defender Client Library. */
#include "defender.h"
/* Interface include. */
#include "report_builder.h"
/* Various JSON characters. */
#define reportbuilderJSON_ARRAY_OPEN_MARKER '['
#define reportbuilderJSON_ARRAY_CLOSE_MARKER ']'
#define reportbuilderJSON_ARRAY_OBJECT_SEPARATOR ','
/* Helper macro to check if snprintf was successful. */
#define reportbuilderSNPRINTF_SUCCESS( retVal, bufLen ) ( ( retVal > 0 ) && ( ( uint32_t ) retVal < bufLen ) )
/* Formats used to generate the JSON report. */
#define reportbuilderJSON_PORT_OBJECT_FORMAT \
"{" \
"\""DEFENDER_REPORT_PORT_KEY"\": %u" \
"},"
#define reportbuilderJSON_CONNECTION_OBJECT_FORMAT \
"{" \
"\""DEFENDER_REPORT_LOCAL_PORT_KEY"\": %u," \
"\""DEFENDER_REPORT_REMOTE_ADDR_KEY"\": \"%u.%u.%u.%u:%u\"" \
"},"
#define reportbuilderJSON_REPORT_FORMAT_PART1 \
"{" \
"\""DEFENDER_REPORT_HEADER_KEY"\": {" \
"\""DEFENDER_REPORT_ID_KEY"\": %u," \
"\""DEFENDER_REPORT_VERSION_KEY"\": \"%u.%u\"" \
"}," \
"\""DEFENDER_REPORT_METRICS_KEY"\": {" \
"\""DEFENDER_REPORT_TCP_LISTENING_PORTS_KEY"\": {" \
"\""DEFENDER_REPORT_PORTS_KEY"\": "
#define reportbuilderJSON_REPORT_FORMAT_PART2 \
"," \
"\""DEFENDER_REPORT_TOTAL_KEY"\": %u" \
"}," \
"\""DEFENDER_REPORT_UDP_LISTENING_PORTS_KEY"\": {" \
"\""DEFENDER_REPORT_PORTS_KEY"\": "
#define reportbuilderJSON_REPORT_FORMAT_PART3 \
"," \
"\""DEFENDER_REPORT_TOTAL_KEY"\": %u" \
"}," \
"\""DEFENDER_REPORT_NETWORK_STATS_KEY"\": {" \
"\""DEFENDER_REPORT_BYTES_IN_KEY"\": %u," \
"\""DEFENDER_REPORT_BYTES_OUT_KEY"\": %u," \
"\""DEFENDER_REPORT_PKTS_IN_KEY"\": %u," \
"\""DEFENDER_REPORT_PKTS_OUT_KEY"\": %u" \
"}," \
"\""DEFENDER_REPORT_TCP_CONNECTIONS_KEY"\": {" \
"\""DEFENDER_REPORT_ESTABLISHED_CONNECTIONS_KEY"\": {" \
"\""DEFENDER_REPORT_CONNECTIONS_KEY"\": "
#define reportbuilderJSON_REPORT_FORMAT_PART4 \
"," \
"\""DEFENDER_REPORT_TOTAL_KEY"\": %u" \
"}" \
"}" \
"}," \
"\""DEFENDER_REPORT_CUSTOM_METRICS_KEY"\": {" \
"\"stack_high_water_mark\": [" \
"{" \
"\""DEFENDER_REPORT_NUMBER_KEY"\": %u" \
"}" \
"]," \
"\"task_numbers\": [" \
"{" \
"\""DEFENDER_REPORT_NUMBER_LIST_KEY"\": "
#define reportbuilderJSON_REPORT_FORMAT_PART5 \
"}" \
"]" \
"}" \
"}"
/*-----------------------------------------------------------*/
/**
* @brief Write ports array to the given buffer in the format expected by the
* AWS IoT Device Defender Service.
*
* This function writes an array of the following format:
* [
* {
* "port":44207
* },
* {
* "port":53
* }
* ]
*
* @param[in] pcBuffer The buffer to write the ports array.
* @param[in] xBufferLength The length of the buffer.
* @param[in] pusOpenPortsArray The array containing the open ports.
* @param[in] xOpenPortsArrayLength Length of the pusOpenPortsArray array.
* @param[out] pxOutCharsWritten Number of characters written to the buffer.
*
* @return #ReportBuilderSuccess if the array is successfully written;
* #ReportBuilderBufferTooSmall if the buffer cannot hold the full array.
*/
static eReportBuilderStatus prvWritePortsArray( char * pcBuffer,
size_t xBufferLength,
const uint16_t * pusOpenPortsArray,
size_t xOpenPortsArrayLength,
size_t * pxOutCharsWritten );
/**
* @brief Write established connections array to the given buffer in the format
* expected by the AWS IoT Device Defender Service.
*
* This function write array of the following format:
* [
* {
* "local_port":44207,
* "remote_addr":"127.0.0.1:45148"
* },
* {
* "local_port":22,
* "remote_addr":"24.16.237.194:63552"
* }
* ]
*
* @param[in] pcBuffer The buffer to write the connections array.
* @param[in] xBufferLength The length of the buffer.
* @param[in] pxConnectionsArray The array containing the established connections.
* @param[in] xConnectionsArrayLength Length of the pxConnectionsArray array.
* @param[out] pxOutCharsWritten Number of characters written to the buffer.
*
* @return #ReportBuilderSuccess if the array is successfully written;
* #ReportBuilderBufferTooSmall if the buffer cannot hold the full array.
*/
static eReportBuilderStatus prvWriteConnectionsArray( char * pcBuffer,
size_t xBufferLength,
const Connection_t * pxConnectionsArray,
size_t xConnectionsArrayLength,
size_t * pxOutCharsWritten );
/**
* @brief Write task ID array to the given buffer as a JSON array.
*
* @param[in] pcBuffer The buffer to write the array of task IDs.
* @param[in] xBufferLength The length of the buffer.
* @param[in] pxTaskStatusArray The array containing the task statuses.
* @param[in] xTaskStatusArrayLength Length of the pxTaskStatusArray array.
* @param[out] pxOutCharsWritten Number of characters written to the buffer.
*
* @return #ReportBuilderSuccess if the array is successfully written;
* #ReportBuilderBufferTooSmall if the buffer cannot hold the full array.
*/
static eReportBuilderStatus prvWriteTaskIdArray( char * pcBuffer,
size_t xBufferLength,
const TaskStatus_t * pxTaskStatusArray,
size_t xTaskStatusArrayLength,
size_t * pxOutCharsWritten );
/*-----------------------------------------------------------*/
static eReportBuilderStatus prvWritePortsArray( char * pcBuffer,
uint32_t xBufferLength,
const uint16_t * pusOpenPortsArray,
uint32_t xOpenPortsArrayLength,
uint32_t * pxOutCharsWritten )
{
char * pcCurrentWritePos = pcBuffer;
uint32_t i;
size_t xRemainingBufferLength = xBufferLength;
int32_t lCharactersWritten;
eReportBuilderStatus eStatus = eReportBuilderSuccess;
configASSERT( pcBuffer != NULL );
configASSERT( pusOpenPortsArray != NULL );
configASSERT( pxOutCharsWritten != NULL );
/* Write the JSON array open marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_OPEN_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
/* Write the array elements. */
for( i = 0; ( ( i < xOpenPortsArrayLength ) && ( eStatus == eReportBuilderSuccess ) ); i++ )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_PORT_OBJECT_FORMAT,
pusOpenPortsArray[ i ] );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= ( uint32_t ) lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
if( eStatus == eReportBuilderSuccess )
{
/* Discard the last comma. */
if( xOpenPortsArrayLength > 0 )
{
pcCurrentWritePos -= 1;
xRemainingBufferLength += 1;
}
/* Write the JSON array close marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_CLOSE_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
*pxOutCharsWritten = xBufferLength - xRemainingBufferLength;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/
static eReportBuilderStatus prvWriteConnectionsArray( char * pcBuffer,
size_t xBufferLength,
const Connection_t * pxConnectionsArray,
size_t xConnectionsArrayLength,
size_t * pxOutCharsWritten )
{
char * pcCurrentWritePos = pcBuffer;
uint32_t i;
size_t xRemainingBufferLength = xBufferLength;
int32_t lCharactersWritten;
eReportBuilderStatus eStatus = eReportBuilderSuccess;
const Connection_t * pxConn;
configASSERT( pcBuffer != NULL );
configASSERT( pxConnectionsArray != NULL );
configASSERT( pxOutCharsWritten != NULL );
/* Write the JSON array open marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_OPEN_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
/* Write the array elements. */
for( i = 0; ( ( i < xConnectionsArrayLength ) && ( eStatus == eReportBuilderSuccess ) ); i++ )
{
pxConn = &( pxConnectionsArray[ i ] );
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_CONNECTION_OBJECT_FORMAT,
pxConn->usLocalPort,
( pxConn->ulRemoteIp >> 24 ) & 0xFF,
( pxConn->ulRemoteIp >> 16 ) & 0xFF,
( pxConn->ulRemoteIp >> 8 ) & 0xFF,
( pxConn->ulRemoteIp ) & 0xFF,
pxConn->usRemotePort );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
if( eStatus == eReportBuilderSuccess )
{
/* Discard the last comma. */
if( xConnectionsArrayLength > 0 )
{
pcCurrentWritePos -= 1;
xRemainingBufferLength += 1;
}
/* Write the JSON array close marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_CLOSE_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
*pxOutCharsWritten = xBufferLength - xRemainingBufferLength;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/
static eReportBuilderStatus prvWriteTaskIdArray( char * pcBuffer,
size_t xBufferLength,
const TaskStatus_t * pxTaskStatusArray,
size_t xTaskStatusArrayLength,
size_t * pxOutCharsWritten )
{
char * pcCurrentWritePos = pcBuffer;
uint32_t i;
size_t xRemainingBufferLength = xBufferLength;
int32_t lCharactersWritten;
eReportBuilderStatus eStatus = eReportBuilderSuccess;
configASSERT( pcBuffer != NULL );
configASSERT( pxTaskStatusArray != NULL );
configASSERT( pxOutCharsWritten != NULL );
/* Write the JSON array open marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_OPEN_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
/* Write the array elements. */
for( i = 0; ( ( i < xTaskStatusArrayLength ) && ( eStatus == eReportBuilderSuccess ) ); i++ )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
"%u,",
pxTaskStatusArray[ i ].xTaskNumber );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= ( uint32_t ) lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
if( eStatus == eReportBuilderSuccess )
{
/* Discard the last comma. */
if( xTaskStatusArrayLength > 0 )
{
pcCurrentWritePos -= 1;
xRemainingBufferLength += 1;
}
/* Write the JSON array close marker. */
if( xRemainingBufferLength > 1 )
{
*pcCurrentWritePos = reportbuilderJSON_ARRAY_CLOSE_MARKER;
xRemainingBufferLength -= 1;
pcCurrentWritePos += 1;
*pxOutCharsWritten = xBufferLength - xRemainingBufferLength;
}
else
{
eStatus = eReportBuilderBufferTooSmall;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/
eReportBuilderStatus eGenerateJsonReport( char * pcBuffer,
size_t xBufferLength,
const ReportMetrics_t * pxMetrics,
uint32_t ulMajorReportVersion,
uint32_t ulMinorReportVersion,
uint32_t ulReportId,
size_t * pxOutReportLength )
{
char * pcCurrentWritePos = pcBuffer;
size_t xRemainingBufferLength = xBufferLength;
uint32_t bufferWritten;
eReportBuilderStatus eStatus = eReportBuilderSuccess;
int32_t lCharactersWritten;
configASSERT( pcBuffer != NULL );
configASSERT( pxMetrics != NULL );
configASSERT( pxOutReportLength != NULL );
configASSERT( xBufferLength != 0 );
if( ( pcBuffer == NULL ) ||
( xBufferLength == 0 ) ||
( pxMetrics == NULL ) ||
( pxOutReportLength == NULL ) )
{
LogError( ( "Invalid parameters. pcBuffer: %p, xBufferLength: %u"
" pMetrics: %p, pOutReprotLength: %p.",
pcBuffer,
xBufferLength,
pxMetrics,
pxOutReportLength ) );
eStatus = eReportBuilderBadParameter;
}
/* Write part1. */
if( eStatus == eReportBuilderSuccess )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_REPORT_FORMAT_PART1,
ulReportId,
ulMajorReportVersion,
ulMinorReportVersion );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
LogError( ( "Failed to write part 1." ) );
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
/* Write TCP ports array. */
if( eStatus == eReportBuilderSuccess )
{
eStatus = prvWritePortsArray( pcCurrentWritePos,
xRemainingBufferLength,
pxMetrics->pusOpenTcpPortsArray,
pxMetrics->xOpenTcpPortsArrayLength,
&( bufferWritten ) );
if( eStatus == eReportBuilderSuccess )
{
pcCurrentWritePos += bufferWritten;
xRemainingBufferLength -= bufferWritten;
}
else
{
LogError( ( "Failed to write TCP ports array." ) );
}
}
/* Write part2. */
if( eStatus == eReportBuilderSuccess )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_REPORT_FORMAT_PART2,
pxMetrics->xOpenTcpPortsArrayLength );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
LogError( ( "Failed to write part 2." ) );
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
/* Write UDP ports array. */
if( eStatus == eReportBuilderSuccess )
{
eStatus = prvWritePortsArray( pcCurrentWritePos,
xRemainingBufferLength,
pxMetrics->pusOpenUdpPortsArray,
pxMetrics->xOpenUdpPortsArrayLength,
&( bufferWritten ) );
if( eStatus == eReportBuilderSuccess )
{
pcCurrentWritePos += bufferWritten;
xRemainingBufferLength -= bufferWritten;
}
else
{
LogError( ( "Failed to write UDP ports array." ) );
}
}
/* Write part3. */
if( eStatus == eReportBuilderSuccess )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_REPORT_FORMAT_PART3,
pxMetrics->xOpenUdpPortsArrayLength,
pxMetrics->pxNetworkStats->ulBytesReceived,
pxMetrics->pxNetworkStats->ulBytesSent,
pxMetrics->pxNetworkStats->ulPacketsReceived,
pxMetrics->pxNetworkStats->ulPacketsSent,
DEFENDER_REPORT_ESTABLISHED_CONNECTIONS_KEY );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
LogError( ( "Failed to write part 3." ) );
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
/* Write connections array. */
if( eStatus == eReportBuilderSuccess )
{
eStatus = prvWriteConnectionsArray( pcCurrentWritePos,
xRemainingBufferLength,
pxMetrics->pxEstablishedConnectionsArray,
pxMetrics->xEstablishedConnectionsArrayLength,
&( bufferWritten ) );
if( eStatus == eReportBuilderSuccess )
{
pcCurrentWritePos += bufferWritten;
xRemainingBufferLength -= bufferWritten;
}
else
{
LogError( ( "Failed to write established connections array." ) );
}
}
/* Write part4. */
if( eStatus == eReportBuilderSuccess )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_REPORT_FORMAT_PART4,
pxMetrics->xEstablishedConnectionsArrayLength,
pxMetrics->ulStackHighWaterMark );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
LogError( ( "Failed to write part 4." ) );
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
}
}
/* Write task ids array. */
if( eStatus == eReportBuilderSuccess )
{
eStatus = prvWriteTaskIdArray( pcCurrentWritePos,
xRemainingBufferLength,
pxMetrics->pxTaskStatusArray,
pxMetrics->xTaskStatusArrayLength,
&( bufferWritten ) );
if( eStatus == eReportBuilderSuccess )
{
pcCurrentWritePos += bufferWritten;
xRemainingBufferLength -= bufferWritten;
}
else
{
LogError( ( "Failed to write task ID array." ) );
}
}
/* Write part5. */
if( eStatus == eReportBuilderSuccess )
{
lCharactersWritten = snprintf( pcCurrentWritePos,
xRemainingBufferLength,
reportbuilderJSON_REPORT_FORMAT_PART5 );
if( !reportbuilderSNPRINTF_SUCCESS( lCharactersWritten, xRemainingBufferLength ) )
{
LogError( ( "Failed to write part 5." ) );
eStatus = eReportBuilderBufferTooSmall;
}
else
{
xRemainingBufferLength -= lCharactersWritten;
pcCurrentWritePos += lCharactersWritten;
*pxOutReportLength = xBufferLength - xRemainingBufferLength;
}
}
return eStatus;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,91 @@
/*
* FreeRTOS V202111.00
* 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 REPORT_BUILDER_H_
#define REPORT_BUILDER_H_
/* Metrics collector. */
#include "metrics_collector.h"
/**
* @brief Return codes from report builder APIs.
*/
typedef enum
{
eReportBuilderSuccess = 0,
eReportBuilderBadParameter,
eReportBuilderBufferTooSmall
} eReportBuilderStatus;
/**
* @brief Represents metrics to be included in the report, including custom metrics.
*
* This demo demonstrates the use of the stack high water mark and list of
* running task ids as custom metrics sent to AWS IoT Device Defender service.
*
* For more information on custom metrics, refer to the following AWS document:
* https://docs.aws.amazon.com/iot/latest/developerguide/dd-detect-custom-metrics.html
*/
typedef struct ReportMetrics
{
NetworkStats_t * pxNetworkStats;
uint16_t * pusOpenTcpPortsArray;
size_t xOpenTcpPortsArrayLength;
uint16_t * pusOpenUdpPortsArray;
size_t xOpenUdpPortsArrayLength;
Connection_t * pxEstablishedConnectionsArray;
size_t xEstablishedConnectionsArrayLength;
/* Custom metrics */
uint32_t ulStackHighWaterMark;
TaskStatus_t * pxTaskStatusArray;
size_t xTaskStatusArrayLength;
} ReportMetrics_t;
/**
* @brief Generate a report in the format expected by the AWS IoT Device Defender
* Service.
*
* @param[in] pcBuffer The buffer to write the report into.
* @param[in] xBufferLength The length of the buffer.
* @param[in] pxMetrics Metrics to write in the generated report.
* @param[in] ulMajorReportVersion Major version of the report.
* @param[in] ulMinorReportVersion Minor version of the report.
* @param[in] ulReportId Value to be used as the ulReportId in the generated report.
* @param[out] pxOutReprotLength The length of the generated report.
*
* @return #ReportBuilderSuccess if the report is successfully generated;
* #ReportBuilderBadParameter if invalid parameters are passed;
* #ReportBuilderBufferTooSmall if the buffer cannot hold the full report.
*/
eReportBuilderStatus eGenerateJsonReport( char * pcBuffer,
size_t xBufferLength,
const ReportMetrics_t * pxMetrics,
uint32_t ulMajorReportVersion,
uint32_t ulMinorReportVersion,
uint32_t ulReportId,
size_t * pxOutReportLength );
#endif /* ifndef REPORT_BUILDER_H_ */

View File

@ -0,0 +1,380 @@
/*
* FreeRTOS V202111.00
* 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>
/* Visual studio intrinsics used so the __debugbreak() function is available
* should an assert get hit. */
#include <intrin.h>
/* FreeRTOS includes. */
#include <FreeRTOS.h>
#include "task.h"
/* TCP/IP stack includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*
* Prototypes for the demos that can be started from this project. Note the
* Shadow demo is not actually started until the network is already, which is
* indicated by vApplicationIPNetworkEventHook() executing - hence
* vStartShadowDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartShadowDemo( void );
/*
* Just seeds the simple pseudo random number generator.
*
* !!! NOTE !!!
* This is not a secure method of generating random numbers and production
* devices should use a true random number generator (TRNG).
*/
static void prvSRand( UBaseType_t ulSeed );
/*
* Miscellaneous initialization including preparing the logging and seeding the
* random number generator.
*/
static void prvMiscInitialisation( void );
/* The default IP and MAC address used by the demo. The address configuration
* defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is
* 1 but a DHCP server could not be contacted. See the online documentation for
* more information. */
static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };
static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };
static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };
static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };
/* Set the following constant to pdTRUE to log using the method indicated by the
* name of the constant, or pdFALSE to not log using the method indicated by the
* name of the constant. Options include to standard out (xLogToStdout), to a disk
* file (xLogToFile), and to a UDP port (xLogToUDP). If xLogToUDP is set to pdTRUE
* then UDP messages are sent to the IP address configured as the UDP logging server
* address (see the configUDP_LOGGING_ADDR0 definitions in FreeRTOSConfig.h) and
* the port number set by configPRINT_PORT in FreeRTOSConfig.h. */
const BaseType_t xLogToStdout = pdTRUE, xLogToFile = pdFALSE, xLogToUDP = pdFALSE;
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition for information on how to configure
* the real network connection to use. */
const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
/* Used by the pseudo random number generator. */
static UBaseType_t ulNextRand;
/*-----------------------------------------------------------*/
int main( void )
{
/***
* See https://www.FreeRTOS.org/iot-device-shadow for configuration and usage instructions.
***/
/* Miscellaneous initialization including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
/* Initialize the network interface.
*
***NOTE*** Tasks that use the network are created in the network event hook
* when the network is connected and ready for use (see the implementation of
* vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* 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 (this is standard text that is not
* really applicable to the Win32 simulator port). */
for( ; ; )
{
__debugbreak();
}
}
/*-----------------------------------------------------------*/
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
* events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
static BaseType_t xTasksAlreadyCreated = pdFALSE;
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
/* Create the tasks that use the IP stack if they have not already been
* created. */
if( xTasksAlreadyCreated == pdFALSE )
{
/* Demos that use the network are created after the network is
* up. */
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );
vStartShadowDemo();
xTasksAlreadyCreated = pdTRUE;
}
/* Print out the network configuration, which may have come from a DHCP
* server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
LogInfo( ( "\r\n\r\nIP Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer );
LogInfo( ( "Subnet Mask: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );
LogInfo( ( "Gateway Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );
LogInfo( ( "DNS Server Address: %s\r\n\r\n\r\n", cBuffer ) );
}
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile,
uint32_t ulLine )
{
volatile uint32_t ulBlockVariable = 0UL;
volatile char * pcFileName = ( volatile char * ) pcFile;
volatile uint32_t ulLineNumber = ulLine;
( void ) pcFileName;
( void ) ulLineNumber;
printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */
taskDISABLE_INTERRUPTS();
{
while( ulBlockVariable == 0UL )
{
__debugbreak();
}
}
taskENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
UBaseType_t uxRand( void )
{
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/*
* Utility function to generate a pseudo random number.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
}
/*-----------------------------------------------------------*/
static void prvSRand( UBaseType_t ulSeed )
{
/* Utility function to seed the pseudo random number generator. */
ulNextRand = ulSeed;
}
/*-----------------------------------------------------------*/
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
/*
* Seed random number generator.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
}
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
const char * pcApplicationHostnameHook( void )
{
/* Assign the name "FreeRTOS" to this network node. This function will
* be called during the DHCP: the machine will be registered with an IP
* address plus this name. */
return mainHOST_NAME;
}
#endif
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 )
BaseType_t xApplicationDNSQueryHook( const char * pcName )
{
BaseType_t xReturn;
/* Determine if a name lookup is for this node. Two names are given
* to this node: that returned by pcApplicationHostnameHook() and that set
* by mainDEVICE_NICK_NAME. */
if( _stricmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( _stricmp( pcName, mainDEVICE_NICK_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) */
/*-----------------------------------------------------------*/
/*
* Callback that provides the inputs necessary to generate a randomized TCP
* Initial Sequence Number per RFC 6528. THIS IS ONLY A DUMMY IMPLEMENTATION
* THAT RETURNS A PSEUDO RANDOM NUMBER SO IS NOT INTENDED FOR USE IN PRODUCTION
* SYSTEMS.
*/
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
{
( void ) ulSourceAddress;
( void ) usSourcePort;
( void ) ulDestinationAddress;
( void ) usDestinationPort;
return uxRand();
}
/*-----------------------------------------------------------*/
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.
*/
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
* implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
* used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
* state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
* application must provide an implementation of vApplicationGetTimerTaskMemory()
* to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
uint32_t * pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
* task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,753 @@
/*
* Copyright 2001, 2002 Georges Menie (www.menie.org)
* stdarg version contributed by Christian Ettinger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Changes for the FreeRTOS ports:
*
* - The dot in "%-8.8s"
* - The specifiers 'l' (long) and 'L' (long long)
* - The specifier 'u' for unsigned
* - Dot notation for IP addresses:
* sprintf("IP = %xip\n", 0xC0A80164);
* will produce "IP = 192.168.1.100\n"
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#define PAD_RIGHT 1
#define PAD_ZERO 2
/*
* Return 1 for readable, 2 for writeable, 3 for both.
* Function must be provided by the application.
*/
extern BaseType_t xApplicationMemoryPermissions( uint32_t aAddress );
extern void vOutputChar( const char cChar,
const TickType_t xTicksToWait );
static const TickType_t xTicksToWait = pdMS_TO_TICKS( 20 );
struct xPrintFlags
{
int base;
int width;
int printLimit;
unsigned
pad : 8,
letBase : 8,
isSigned : 1,
isNumber : 1,
long32 : 1,
long64 : 1;
};
struct SStringBuf
{
char * str;
const char * orgStr;
const char * nulPos;
int curLen;
struct xPrintFlags flags;
};
static void strbuf_init( struct SStringBuf * apStr,
char * apBuf,
const char * apMaxStr )
{
apStr->str = apBuf;
apStr->orgStr = apBuf;
apStr->nulPos = apMaxStr - 1;
apStr->curLen = 0;
memset( &apStr->flags, '\0', sizeof( apStr->flags ) );
}
/*-----------------------------------------------------------*/
static BaseType_t strbuf_printchar( struct SStringBuf * apStr,
int c )
{
if( apStr->str == NULL )
{
vOutputChar( ( char ) c, xTicksToWait );
apStr->curLen++;
return pdTRUE;
}
if( apStr->str < apStr->nulPos )
{
*( apStr->str++ ) = c;
apStr->curLen++;
return pdTRUE;
}
if( apStr->str == apStr->nulPos )
{
*( apStr->str++ ) = '\0';
}
return pdFALSE;
}
/*-----------------------------------------------------------*/
static portINLINE BaseType_t strbuf_printchar_inline( struct SStringBuf * apStr,
int c )
{
if( apStr->str == NULL )
{
vOutputChar( ( char ) c, xTicksToWait );
if( c == 0 )
{
return pdFALSE;
}
apStr->curLen++;
return pdTRUE;
}
if( apStr->str < apStr->nulPos )
{
*( apStr->str++ ) = c;
if( c == 0 )
{
return pdFALSE;
}
apStr->curLen++;
return pdTRUE;
}
if( apStr->str == apStr->nulPos )
{
*( apStr->str++ ) = '\0';
}
return pdFALSE;
}
/*-----------------------------------------------------------*/
static portINLINE int i2hex( int aCh )
{
int iResult;
if( aCh < 10 )
{
iResult = '0' + aCh;
}
else
{
iResult = 'A' + aCh - 10;
}
return iResult;
}
/*-----------------------------------------------------------*/
static BaseType_t prints( struct SStringBuf * apBuf,
const char * apString )
{
register int padchar = ' ';
int i, len;
if( xApplicationMemoryPermissions( ( uint32_t ) apString ) == 0 )
{
/* The user has probably made a mistake with the parameter
* for '%s', the memory is not readbale. */
apString = "INV_MEM";
}
if( apBuf->flags.width > 0 )
{
register int len = 0;
register const char * ptr;
for( ptr = apString; *ptr; ++ptr )
{
++len;
}
if( len >= apBuf->flags.width )
{
apBuf->flags.width = 0;
}
else
{
apBuf->flags.width -= len;
}
if( apBuf->flags.pad & PAD_ZERO )
{
padchar = '0';
}
}
if( ( apBuf->flags.pad & PAD_RIGHT ) == 0 )
{
for( ; apBuf->flags.width > 0; --apBuf->flags.width )
{
if( strbuf_printchar( apBuf, padchar ) == 0 )
{
return pdFALSE;
}
}
}
if( ( apBuf->flags.isNumber == pdTRUE ) && ( apBuf->flags.pad == pdTRUE ) )
{
/* The string to print represents an integer number.
* In this case, printLimit is the min number of digits to print
* If the length of the number to print is less than the min nb of i
* digits to display, we add 0 before printing the number
*/
len = strlen( apString );
if( len < apBuf->flags.printLimit )
{
i = apBuf->flags.printLimit - len;
for( ; i; i-- )
{
if( strbuf_printchar( apBuf, '0' ) == 0 )
{
return pdFALSE;
}
}
}
}
/* The string to print is not the result of a number conversion to ascii.
* For a string, printLimit is the max number of characters to display
*/
for( ; apBuf->flags.printLimit && *apString; ++apString, --apBuf->flags.printLimit )
{
if( !strbuf_printchar( apBuf, *apString ) )
{
return pdFALSE;
}
}
for( ; apBuf->flags.width > 0; --apBuf->flags.width )
{
if( !strbuf_printchar( apBuf, padchar ) )
{
return pdFALSE;
}
}
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* the following should be enough for 32 bit int */
#define PRINT_BUF_LEN 12 /* to print 4294967296 */
#if SPRINTF_LONG_LONG
#warning 64-bit libraries will be included as well
static BaseType_t printll( struct SStringBuf * apBuf,
long long i )
{
char print_buf[ 2 * PRINT_BUF_LEN ];
register char * s;
register int t, neg = 0;
register unsigned long long u = i;
lldiv_t lldiv_result;
/* typedef struct
* {
* long long int quot; // quotient
* long long int rem; // remainder
* } lldiv_t;
*/
apBuf->flags.isNumber = pdTRUE; /* Parameter for prints */
if( i == 0LL )
{
print_buf[ 0 ] = '0';
print_buf[ 1 ] = '\0';
return prints( apBuf, print_buf );
}
if( ( apBuf->flags.isSigned == pdTRUE ) && ( apBuf->flags.base == 10 ) && ( i < 0LL ) )
{
neg = 1;
u = -i;
}
s = print_buf + sizeof( print_buf ) - 1;
*s = '\0';
/* 18446744073709551616 */
while( u != 0 )
{
lldiv_result = lldiv( u, ( unsigned long long ) apBuf->flags.base );
t = lldiv_result.rem;
if( t >= 10 )
{
t += apBuf->flags.letBase - '0' - 10;
}
*( --s ) = t + '0';
u = lldiv_result.quot;
}
if( neg != 0 )
{
if( ( apBuf->flags.width != 0 ) && ( apBuf->flags.pad & PAD_ZERO ) )
{
if( !strbuf_printchar( apBuf, '-' ) )
{
return pdFALSE;
}
--apBuf->flags.width;
}
else
{
*( --s ) = '-';
}
}
return prints( apBuf, s );
}
#endif /* SPRINTF_LONG_LONG */
/*-----------------------------------------------------------*/
static BaseType_t printi( struct SStringBuf * apBuf,
int i )
{
char print_buf[ PRINT_BUF_LEN ];
register char * s;
register int t, neg = 0;
register unsigned int u = i;
register unsigned base = apBuf->flags.base;
apBuf->flags.isNumber = pdTRUE; /* Parameter for prints */
if( i == 0 )
{
print_buf[ 0 ] = '0';
print_buf[ 1 ] = '\0';
return prints( apBuf, print_buf );
}
if( ( apBuf->flags.isSigned == pdTRUE ) && ( base == 10 ) && ( i < 0 ) )
{
neg = 1;
u = -i;
}
s = print_buf + sizeof( print_buf ) - 1;
*s = '\0';
switch( base )
{
case 16:
while( u != 0 )
{
t = u & 0xF;
if( t >= 10 )
{
t += apBuf->flags.letBase - '0' - 10;
}
*( --s ) = t + '0';
u >>= 4;
}
break;
case 8:
case 10:
/* GCC compiles very efficient */
while( u )
{
t = u % base;
*( --s ) = t + '0';
u /= base;
}
break;
/*
* // The generic case, not yet in use
* default:
* while( u )
* {
* t = u % base;
* if( t >= 10)
* {
* t += apBuf->flags.letBase - '0' - 10;
* }
*( --s ) = t + '0';
* u /= base;
* }
* break;
*/
}
if( neg != 0 )
{
if( apBuf->flags.width && ( apBuf->flags.pad & PAD_ZERO ) )
{
if( strbuf_printchar( apBuf, '-' ) == 0 )
{
return pdFALSE;
}
--apBuf->flags.width;
}
else
{
*( --s ) = '-';
}
}
return prints( apBuf, s );
}
/*-----------------------------------------------------------*/
static BaseType_t printIp( struct SStringBuf * apBuf,
unsigned i )
{
char print_buf[ 16 ];
sprintf( print_buf, "%u.%u.%u.%u",
i >> 24,
( i >> 16 ) & 0xff,
( i >> 8 ) & 0xff,
i & 0xff );
apBuf->flags.isNumber = pdTRUE; /* Parameter for prints */
prints( apBuf, print_buf );
return pdTRUE;
}
/*-----------------------------------------------------------*/
static void tiny_print( struct SStringBuf * apBuf,
const char * format,
va_list args )
{
char scr[ 2 ];
for( ; ; )
{
int ch = *( format++ );
if( ch != '%' )
{
do
{
/* Put the most like flow in a small loop */
if( strbuf_printchar_inline( apBuf, ch ) == 0 )
{
return;
}
ch = *( format++ );
} while( ch != '%' );
}
ch = *( format++ );
/* Now ch has character after '%', format pointing to next */
if( ch == '\0' )
{
break;
}
if( ch == '%' )
{
if( strbuf_printchar( apBuf, ch ) == 0 )
{
return;
}
continue;
}
memset( &apBuf->flags, '\0', sizeof( apBuf->flags ) );
if( ch == '-' )
{
ch = *( format++ );
apBuf->flags.pad = PAD_RIGHT;
}
while( ch == '0' )
{
ch = *( format++ );
apBuf->flags.pad |= PAD_ZERO;
}
if( ch == '*' )
{
ch = *( format++ );
apBuf->flags.width = va_arg( args, int );
}
else
{
while( ch >= '0' && ch <= '9' )
{
apBuf->flags.width *= 10;
apBuf->flags.width += ch - '0';
ch = *( format++ );
}
}
if( ch == '.' )
{
ch = *( format++ );
if( ch == '*' )
{
apBuf->flags.printLimit = va_arg( args, int );
ch = *( format++ );
}
else
{
while( ch >= '0' && ch <= '9' )
{
apBuf->flags.printLimit *= 10;
apBuf->flags.printLimit += ch - '0';
ch = *( format++ );
}
}
}
if( apBuf->flags.printLimit == 0 )
{
apBuf->flags.printLimit--; /* -1: make it unlimited */
}
if( ch == 's' )
{
register char * s = ( char * ) va_arg( args, int );
if( prints( apBuf, s ? s : "(null)" ) == 0 )
{
break;
}
continue;
}
if( ch == 'c' )
{
/* char are converted to int then pushed on the stack */
scr[ 0 ] = ( char ) va_arg( args, int );
if( strbuf_printchar( apBuf, scr[ 0 ] ) == 0 )
{
return;
}
continue;
}
if( ch == 'l' )
{
ch = *( format++ );
apBuf->flags.long32 = 1;
/* Makes not difference as u32 == long */
}
if( ch == 'L' )
{
ch = *( format++ );
apBuf->flags.long64 = 1;
/* Does make a difference */
}
apBuf->flags.base = 10;
apBuf->flags.letBase = 'a';
if( ( ch == 'd' ) || ( ch == 'u' ) )
{
apBuf->flags.isSigned = ( ch == 'd' );
#if SPRINTF_LONG_LONG
if( apBuf->flags.long64 != pdFALSE )
{
if( printll( apBuf, va_arg( args, long long ) ) == 0 )
{
break;
}
}
else
#endif /* SPRINTF_LONG_LONG */
if( printi( apBuf, va_arg( args, int ) ) == 0 )
{
break;
}
continue;
}
apBuf->flags.base = 16; /* From here all hexadecimal */
if( ( ch == 'x' ) && ( format[ 0 ] == 'i' ) && ( format[ 1 ] == 'p' ) )
{
format += 2; /* eat the "xi" of "xip" */
/* Will use base 10 again */
if( printIp( apBuf, va_arg( args, int ) ) == 0 )
{
break;
}
continue;
}
if( ( ch == 'x' ) || ( ch == 'X' ) || ( ch == 'p' ) || ( ch == 'o' ) )
{
if( ch == 'X' )
{
apBuf->flags.letBase = 'A';
}
else if( ch == 'o' )
{
apBuf->flags.base = 8;
}
#if SPRINTF_LONG_LONG
if( apBuf->flags.long64 != pdFALSE )
{
if( printll( apBuf, va_arg( args, long long ) ) == 0 )
{
break;
}
}
else
#endif /* SPRINTF_LONG_LONG */
if( printi( apBuf, va_arg( args, int ) ) == 0 )
{
break;
}
continue;
}
}
strbuf_printchar( apBuf, '\0' );
}
/*-----------------------------------------------------------*/
int vsnprintf( char * apBuf,
size_t aMaxLen,
const char * apFmt,
va_list args )
{
struct SStringBuf strBuf;
strbuf_init( &strBuf, apBuf, ( const char * ) apBuf + aMaxLen );
tiny_print( &strBuf, apFmt, args );
return strBuf.curLen;
}
/*-----------------------------------------------------------*/
int snprintf( char * apBuf,
size_t aMaxLen,
const char * apFmt,
... )
{
va_list args;
va_start( args, apFmt );
struct SStringBuf strBuf;
strbuf_init( &strBuf, apBuf, ( const char * ) apBuf + aMaxLen );
tiny_print( &strBuf, apFmt, args );
va_end( args );
return strBuf.curLen;
}
/*-----------------------------------------------------------*/
int sprintf( char * apBuf,
const char * apFmt,
... )
{
va_list args;
va_start( args, apFmt );
struct SStringBuf strBuf;
strbuf_init( &strBuf, apBuf, ( const char * ) apBuf + 1024 );
tiny_print( &strBuf, apFmt, args );
va_end( args );
return strBuf.curLen;
}
/*-----------------------------------------------------------*/
int vsprintf( char * apBuf,
const char * apFmt,
va_list args )
{
struct SStringBuf strBuf;
strbuf_init( &strBuf, apBuf, ( const char * ) apBuf + 1024 );
tiny_print( &strBuf, apFmt, args );
return strBuf.curLen;
}
/*-----------------------------------------------------------*/
const char * mkSize( unsigned long long aSize,
char * apBuf,
int aLen )
{
static char retString[ 33 ];
size_t gb, mb, kb, sb;
if( apBuf == NULL )
{
apBuf = retString;
aLen = sizeof( retString );
}
gb = aSize / ( 1024 * 1024 * 1024 );
aSize -= gb * ( 1024 * 1024 * 1024 );
mb = aSize / ( 1024 * 1024 );
aSize -= mb * ( 1024 * 1024 );
kb = aSize / ( 1024 );
aSize -= kb * ( 1024 );
sb = aSize;
if( gb )
{
snprintf( apBuf, aLen, "%u.%02u GB", ( unsigned ) gb, ( unsigned ) ( ( 100 * mb ) / 1024ul ) );
}
else if( mb )
{
snprintf( apBuf, aLen, "%u.%02u MB", ( unsigned ) mb, ( unsigned ) ( ( 100 * kb ) / 1024ul ) );
}
else if( kb != 0ul )
{
snprintf( apBuf, aLen, "%u.%02u KB", ( unsigned ) kb, ( unsigned ) ( ( 100 * sb ) / 1024ul ) );
}
else
{
snprintf( apBuf, aLen, "%u bytes", ( unsigned ) sb );
}
return apBuf;
}

View File

@ -0,0 +1,209 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* http://www.freertos.org/a00110.html
*
* The bottom of this file contains some constants specific to running the UDP
* stack in this demo. Constants specific to FreeRTOS+TCP itself (rather than
* the demo) are contained in FreeRTOSIPConfig.h.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configMAX_PRIORITIES ( 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Event group related definitions. */
#define configUSE_EVENT_GROUPS 1
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_pcTaskGetTaskName 1
/* This demo makes use of one or more example stats formatting functions. These
* format the raw data provided by the uxTaskGetSystemState() function in to human
* readable ASCII form. See the notes in the implementation of vTaskList() within
* FreeRTOS/Source/tasks.c for limitations. configUSE_STATS_FORMATTING_FUNCTIONS
* is set to 2 so the formatting functions are included without the stdio.h being
* included in tasks.c. That is because this project defines its own sprintf()
* functions. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
/* Assert call defined for debug builds. */
#ifdef _DEBUG
extern void vAssertCalled( const char * pcFile,
uint32_t ulLine );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#endif /* _DEBUG */
/* Application specific definitions follow. **********************************/
/* Only used when running in the FreeRTOS Windows simulator. Defines the
* priority of the task used to simulate Ethernet interrupts. */
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
/* This demo creates a virtual network connection by accessing the raw Ethernet
* or WiFi data to and from a real network connection. Many computers have more
* than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
* the demo which real port should be used to create the virtual port. The ports
* available are displayed on the console when the application is executed. For
* example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
* results in the wired network being used, while setting
* configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
* used. */
#define configNETWORK_INTERFACE_TO_USE ( 0L )
/* The address to which logging is sent should UDP logging be enabled. */
#define configUDP_LOGGING_ADDR0 192
#define configUDP_LOGGING_ADDR1 168
#define configUDP_LOGGING_ADDR2 0
#define configUDP_LOGGING_ADDR3 11
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet/WiFi data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition above for information on how to
* configure the real network connection to use. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x11
#define configMAC_ADDR2 0x11
#define configMAC_ADDR3 0x11
#define configMAC_ADDR4 0x11
#define configMAC_ADDR5 0x41
/* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configIP_ADDR0 10
#define configIP_ADDR1 10
#define configIP_ADDR2 10
#define configIP_ADDR3 200
/* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to
* 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configGATEWAY_ADDR0 10
#define configGATEWAY_ADDR1 10
#define configGATEWAY_ADDR2 10
#define configGATEWAY_ADDR3 1
/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
* 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set
* to 1 but a DNS server cannot be contacted.*/
#define configDNS_SERVER_ADDR0 208
#define configDNS_SERVER_ADDR1 67
#define configDNS_SERVER_ADDR2 222
#define configDNS_SERVER_ADDR3 222
/* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configNET_MASK0 255
#define configNET_MASK1 0
#define configNET_MASK2 0
#define configNET_MASK3 0
/* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 )
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/* Visual studio does not have an implementation of strcasecmp(). */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strcmpi _strcmpi
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
#define configPRINTF( X ) vLoggingPrintf X
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,309 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*/
/*****************************************************************************
*
* See the following URL for configuration information.
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html
*
*****************************************************************************/
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
* 1 then FreeRTOS_debug_printf should be defined to the function used to print
* out the debugging messages. */
#define ipconfigHAS_DEBUG_PRINTF 0
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
#define FreeRTOS_debug_printf( X ) vLoggingPrintf X
#endif
/* Set to 1 to print out non debugging messages, for example the output of the
* FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
* then FreeRTOS_printf should be set to the function used to print out the
* messages. */
#define ipconfigHAS_PRINTF 1
#if ( ipconfigHAS_PRINTF == 1 )
#define FreeRTOS_printf( X ) vLoggingPrintf X
#endif
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
/* If the network card/driver includes checksum offloading (IP/TCP/UDP checksums)
* then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1 to prevent the software
* stack repeating the checksum calculations. */
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
/* Several API's will block until the result is known, or the action has been
* performed, for example FreeRTOS_send() and FreeRTOS_recv(). The timeouts can be
* set per socket, using setsockopt(). If not set, the times below will be
* used as defaults. */
#define ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME ( 2000 )
#define ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME ( 5000 )
/* Include support for LLMNR: Link-local Multicast Name Resolution
* (non-Microsoft) */
#define ipconfigUSE_LLMNR ( 0 )
/* Include support for NBNS: NetBIOS Name Service (Microsoft) */
#define ipconfigUSE_NBNS ( 0 )
/* Include support for DNS caching. For TCP, having a small DNS cache is very
* useful. When a cache is present, ipconfigDNS_REQUEST_ATTEMPTS can be kept low
* and also DNS may use small timeouts. If a DNS reply comes in after the DNS
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket. */
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 64 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
/* The IP stack executes it its own task (although any application task can make
* use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY
* sets the priority of the task that executes the IP stack. The priority is a
* standard FreeRTOS task priority so can take any value from 0 (the lowest
* priority) to (configMAX_PRIORITIES - 1) (the highest priority).
* configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in
* FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to
* the priority assigned to the task executing the IP stack relative to the
* priority assigned to tasks that use the IP stack. */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+TCP
* task. This setting is less important when the FreeRTOS Win32 simulator is used
* as the Win32 simulator only stores a fixed amount of information on the task
* stack. FreeRTOS includes optional stack overflow detection, see:
* http://www.freertos.org/Stacks-and-stack-overflow-checking.html */
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 5 )
/* ipconfigRAND32() is called by the IP stack to generate random numbers for
* things such as a DHCP transaction number or initial sequence number. Random
* number generation is performed via this macro to allow applications to use their
* own random number generation method. For example, it might be possible to
* generate a random number by sampling noise on an analogue input. */
extern UBaseType_t uxRand();
#define ipconfigRAND32() uxRand()
/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the
* network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK
* is not set to 1 then the network event hook will never be called. See
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml
*/
#define ipconfigUSE_NETWORK_EVENT_HOOK 1
/* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but
* a network buffer cannot be obtained then the calling task is held in the Blocked
* state (so other tasks can continue to executed) until either a network buffer
* becomes available or the send block time expires. If the send block time expires
* then the send operation is aborted. The maximum allowable send block time is
* capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the
* maximum allowable send block time prevents a deadlock occurring when
* all the network buffers are in use and the tasks that process (and subsequently
* free) the network buffers are themselves blocked waiting for a network buffer.
* ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
* milliseconds can be converted to a time in ticks by dividing the time in
* milliseconds by portTICK_PERIOD_MS. */
#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000 / portTICK_PERIOD_MS )
/* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP
* address, netmask, DNS server address and gateway address from a DHCP server. If
* ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will use a static IP address. The
* stack will revert to using the static IP address even when ipconfigUSE_DHCP is
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
* and accepted, or the interval between transmissions reaches
* ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the
* static IP address passed as a parameter to FreeRTOS_IPInit() if the
* re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without
* a DHCP reply being received. */
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_PERIOD_MS )
/* The ARP cache is a table that maps IP addresses to MAC addresses. The IP
* stack can only send a UDP message to a remove IP address if it knowns the MAC
* address associated with the IP address, or the MAC address of the router used to
* contact the remote IP address. When a UDP message is received from a remote IP
* address the MAC address and IP address are added to the ARP cache. When a UDP
* message is sent to a remote IP address that does not already appear in the ARP
* cache then the UDP message is replaced by a ARP message that solicits the
* required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum
* number of entries that can exist in the ARP table at any one time. */
#define ipconfigARP_CACHE_ENTRIES 6
/* ARP requests that do not result in an ARP response will be re-transmitted a
* maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is
* aborted. */
#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )
/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP
* table being created or refreshed and the entry being removed because it is stale.
* New ARP requests are sent for ARP cache entries that are nearing their maximum
* age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is
* equal to 1500 seconds (or 25 minutes). */
#define ipconfigMAX_ARP_AGE 150
/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling
* routines, which are relatively large. To save code space the full
* FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster
* alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr()
* takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.
* FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets
* (for example, 192, 168, 0, 1) as its parameters. If
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
#define ipconfigINCLUDE_FULL_INET_ADDR 1
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
* to ensure the total amount of RAM that can be consumed by the IP stack is capped
* to a pre-determinable value. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
/* A FreeRTOS queue is used to send events from application tasks to the IP
* stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can
* be queued for processing at any one time. The event queue must be a minimum of
* 5 greater than the total number of network buffers. */
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )
/* The address of a socket is the combination of its IP address and its port
* number. FreeRTOS_bind() is used to manually allocate a port number to a socket
* (to 'bind' the socket to a port), but manual binding is not normally necessary
* for client sockets (those sockets that initiate outgoing connections rather than
* wait for incoming connections on a known port number). If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling
* FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP
* stack automatically binding the socket to a port number from the range
* socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()
* on a socket that has not yet been bound will result in the send operation being
* aborted. */
#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1
/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */
#define ipconfigUDP_TIME_TO_LIVE 128
#define ipconfigTCP_TIME_TO_LIVE 128 /* also defined in FreeRTOSIPConfigDefaults.h */
/* USE_TCP: Use TCP and all its features */
#define ipconfigUSE_TCP ( 1 )
/* Use the TCP socket wake context with a callback. */
#define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK_WITH_CONTEXT ( 1 )
/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 1 )
/* The MTU is the maximum number of bytes the payload of a network frame can
* contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1200
/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
#define ipconfigREPLY_TO_INCOMING_PINGS 1
/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the
* FreeRTOS_SendPingRequest() API function is available. */
#define ipconfigSUPPORT_OUTGOING_PINGS 0
/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()
* (and associated) API function is available. */
#define ipconfigSUPPORT_SELECT_FUNCTION 1
/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames
* that are not in Ethernet II format will be dropped. This option is included for
* potential future IP stack developments. */
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the
* responsibility of the Ethernet interface to filter out packets that are of no
* interest. If the Ethernet interface does not implement this functionality, then
* set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack
* perform the filtering instead (it is much less efficient for the stack to do it
* because the packet will already have been passed into the stack). If the
* Ethernet driver does all the necessary filtering in hardware then software
* filtering can be removed by using a value other than 1 or 0. */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
/* The windows simulator cannot really simulate MAC interrupts, and needs to
* block occasionally to allow other tasks to run. */
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS )
/* Advanced only: in order to access 32-bit fields in the IP packets with
* 32-bit memory instructions, all packets will be stored 32-bit-aligned, plus 16-bits.
* This has to do with the contents of the IP-packets: all 32-bit fields are
* 32-bit-aligned, plus 16-bit(!) */
#define ipconfigPACKET_FILLER_SIZE 2
/* Define the size of the pool of TCP window descriptors. On the average, each
* TCP socket will use up to 2 x 6 descriptors, meaning that it can have 2 x 6
* outstanding packets (for Rx and Tx). When using up to 10 TP sockets
* simultaneously, one could define TCP_WIN_SEG_COUNT as 120. */
#define ipconfigTCP_WIN_SEG_COUNT 240
/* Each TCP socket has a circular buffers for Rx and Tx, which have a fixed
* maximum size. Define the size of Rx buffer for TCP sockets. */
#define ipconfigTCP_RX_BUFFER_LENGTH ( 5000 )
/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )
/* When using call-back handlers, the driver may check if the handler points to
* real program memory (RAM or flash) or just has a random non-zero value. */
#define ipconfigIS_VALID_PROG_ADDRESS( x ) ( ( x ) != NULL )
/* Include support for TCP hang protection. All sockets in a connecting or
* disconnecting stage will timeout after a period of non-activity. */
#define ipconfigTCP_HANG_PROTECTION ( 1 )
#define ipconfigTCP_HANG_PROTECTION_TIME ( 30 )
/* Include support for TCP keep-alive messages. */
#define ipconfigTCP_KEEP_ALIVE ( 1 )
#define ipconfigTCP_KEEP_ALIVE_INTERVAL ( 20 ) /* in seconds */
#define portINLINE __inline
#endif /* FREERTOS_IP_CONFIG_H */

View File

@ -0,0 +1,6 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://www.freertos.org/iot-device-shadow/index.html

View File

@ -0,0 +1,622 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging;..\..\..\Common\WinPCap;..\..\..\..\..\FreeRTOS\Source\include;..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp;..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls;..\..\..\..\Source\Utilities\mbedtls_freertos;..\..\..\..\..\Source\mbedtls_utils;..\..\..\..\ThirdParty\mbedtls\include;..\..\..\..\Source\AWS\device-shadow\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\Mqtt_Demo_Helpers;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/wd4210 /wd4127 /wd4214 /wd4201 /wd4244 /wd4310 /wd4200 %(AdditionalOptions)</AdditionalOptions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Common\WinPCap</AdditionalLibraryDirectories>
<Profile>false</Profile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\..\..\Source\include;..\..\..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.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\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\AWS\device-shadow\source\shadow.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c" />
<ClCompile Include="..\Common\main.c" />
<ClCompile Include="DemoTasks\ShadowDemoMainExample.c" />
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-shadow\source\include\shadow.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-shadow\source\include\shadow_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h" />
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.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\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h" />
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="mbedtls_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="core_mqtt_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,809 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="FreeRTOS">
<UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source">
<UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>
<Extensions>*.c</Extensions>
</Filter>
<Filter Include="FreeRTOS\Source\Portable">
<UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+">
<UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source\include">
<UniqueIdentifier>{d2dcd641-8d91-492b-852f-5563ffadaec6}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP">
<UniqueIdentifier>{8672fa26-b119-481f-8b8d-086419c01a3e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\portable">
<UniqueIdentifier>{4570be11-ec96-4b55-ac58-24b50ada980a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\include">
<UniqueIdentifier>{5d93ed51-023a-41ad-9243-8d230165d34b}</UniqueIdentifier>
</Filter>
<Filter Include="DemoTasks">
<UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries">
<UniqueIdentifier>{60717407-397f-4ea5-8492-3314acdd25f0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard">
<UniqueIdentifier>{8a90222f-d723-4b4e-8e6e-c57afaf7fa92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT">
<UniqueIdentifier>{2d17d5e6-ed70-4e42-9693-f7a63baf4948}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include">
<UniqueIdentifier>{6ad56e6d-c330-4830-8f4b-c75b05dfa866}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform">
<UniqueIdentifier>{84613aa2-91dc-4e1a-a3b3-823b6d7bf0e0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls">
<UniqueIdentifier>{7bedd2e3-adbb-4c95-9632-445132b459ce}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\include">
<UniqueIdentifier>{07a14673-4d02-4780-a099-6b8c654dff91}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\library">
<UniqueIdentifier>{e875c5e3-40a2-4408-941e-5e1a951cc663}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls">
<UniqueIdentifier>{8a0aa896-6b3a-49b3-997e-681f0d1949ae}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{c5a01679-3e7a-4320-97ac-ee5b872c1650}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include">
<UniqueIdentifier>{c992824d-4198-46b2-8d59-5f99ab9946ab}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{6a35782c-bc09-42d5-a850-98bcb668a4dc}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON">
<UniqueIdentifier>{20aee693-d2dc-480e-ae21-0db2156e54ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS">
<UniqueIdentifier>{0dacb84e-5cc3-4eed-8fb1-68b6e4741f77}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-shadow">
<UniqueIdentifier>{3dc3c37b-6417-4a84-a16e-b1acf21c04cf}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{8bb5ac40-c7e5-4912-b67f-12f4a1861c9f}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-shadow\include">
<UniqueIdentifier>{8917ce57-b461-4487-9431-1209cfeab048}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm">
<UniqueIdentifier>{fcf93295-15e2-4a84-a5e9-b3c162e9f061}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include">
<UniqueIdentifier>{f8333cbc-1d7c-410a-a5d8-a28be356a0c4}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\logging">
<UniqueIdentifier>{ef44e456-23be-4051-baf5-d523df57d4be}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include">
<UniqueIdentifier>{2e54e86d-3f5a-4a0b-a216-35e3862a51f7}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\Common\main.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="DemoTasks\ShadowDemoMainExample.c">
<Filter>DemoTasks</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\device-shadow\source\shadow.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-shadow</Filter>
</ClCompile>
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSIPConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\logging</Filter>
</ClInclude>
<ClInclude Include="mbedtls_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="..\..\..\..\Source\AWS\device-shadow\source\include\shadow.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-shadow\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\device-shadow\source\include\shadow_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\device-shadow\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,78 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.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
#endif /* ifndef CORE_MQTT_CONFIG_H */

View File

@ -0,0 +1,248 @@
/*
* FreeRTOS V202111.00
* 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
/* FreeRTOS config include. */
#include "FreeRTOSConfig.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 "ShadowDemo"
#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 The Thing resource registered on your AWS IoT account to use in the demo.
* A Thing resource is required to communicate with the AWS IoT Device Shadow service.
*
* @note The Things associated with your AWS account can be found in the
* AWS IoT console under Manage/Things, or using the ListThings REST API (that can
* be called with the AWS CLI command line tool).
*
* #define democonfigTHING_NAME "...insert here..."
*/
#ifndef democonfigCLIENT_IDENTIFIER
/**
* @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.
*
* @note Appending __TIME__ to the client id string will reduce the possibility of a
* client id collision in the broker. Note that the appended time is the compilation
* time. This client id can cause collision, if more than one instance of the same
* binary is used at the same time to connect to the broker.
*/
#define democonfigCLIENT_IDENTIFIER "testClient"__TIME__
#endif
/**
* @brief The AWS IoT broker endpoint to connect to in the demo.
*
* @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
* Settings/Custom Endpoint, or using the DescribeEndpoint REST API (that can
* be called with AWS CLI command line tool).
*
* #define democonfigMQTT_BROKER_ENDPOINT "...insert here..."
*/
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections.
*
* @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. )
*/
/**
* @brief AWS root CA certificate.
*
* This certificate is used to identify the AWS IoT server and is publicly available.
* Refer to the link below.
* https://www.amazontrust.com/repository/AmazonRootCA1.pem
*
* @note This certificate should be PEM-encoded.
*
* 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.
*
* Please 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 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 The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* Please 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.
*
* Please 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.
*/
#include "core_mqtt.h" /* Include coreMQTT header for MQTT_LIBRARY_VERSION macro. */
#define democonfigMQTT_LIB "core-mqtt@"MQTT_LIBRARY_VERSION
/**
* @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
/**
* @brief Size of the network buffer for MQTT packets.
*/
#define democonfigNETWORK_BUFFER_SIZE ( 1024U )
/**
* @brief Predefined shadow name.
*
* Defaults to unnamed "Classic" shadow. Change to a custom string to use a named shadow.
*/
#ifndef democonfigSHADOW_NAME
#define democonfigSHADOW_NAME SHADOW_NAME_CLASSIC
#endif
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,137 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/* This file configures mbed TLS for FreeRTOS. */
#ifndef MBEDTLS_CONFIG_H_
#define MBEDTLS_CONFIG_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Generate errors if deprecated functions are used. */
#define MBEDTLS_DEPRECATED_REMOVED
/* Place AES tables in ROM. */
#define MBEDTLS_AES_ROM_TABLES
/* Enable the following cipher modes. */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CFB
#define MBEDTLS_CIPHER_MODE_CTR
/* Enable the following cipher padding modes. */
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
#define MBEDTLS_CIPHER_PADDING_ZEROS
/* Cipher suite configuration. */
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/* Enable all SSL alert messages. */
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/* Enable the following SSL features. */
#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_ALPN
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/* Check certificate key usage. */
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/* Disable platform entropy functions. */
#define MBEDTLS_NO_PLATFORM_ENTROPY
/* Enable the following mbed TLS features. */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_GCM_C
#define MBEDTLS_MD_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_THREADING_ALT
#define MBEDTLS_THREADING_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
/* Set the memory allocation functions on FreeRTOS. */
void * mbedtls_platform_calloc( size_t nmemb,
size_t size );
void mbedtls_platform_free( void * ptr );
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
/* The network send and receive functions on FreeRTOS. */
int mbedtls_platform_send( void * ctx,
const unsigned char * buf,
size_t len );
int mbedtls_platform_recv( void * ctx,
unsigned char * buf,
size_t len );
/* These two macro used by mbedtls_ssl_set_bio in using_mbedtls network
* transport layer. */
#define MBEDTLS_SSL_SEND mbedtls_platform_send
#define MBEDTLS_SSL_RECV mbedtls_platform_recv
/* The entropy poll function. */
int mbedtls_platform_entropy_poll( void * data,
unsigned char * output,
size_t len,
size_t * olen );
#include "mbedtls/check_config.h"
#endif /* ifndef MBEDTLS_CONFIG_H_ */

View File

@ -0,0 +1,64 @@
/*
* AWS IoT Device SDK for Embedded C V202009.00
* 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.
*/
#ifndef SHADOW_CONFIG_H
#define SHADOW_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 Shadow library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "SHADOW"
#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 ****************/
#endif /* ifndef SHADOW_CONFIG_H */

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {150F08BF-9D61-4CC2-8DBF-1335172A1EA4}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FreeRTOS_Plus_TCP_Minimal.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,985 @@
/*
* FreeRTOS V202111.00
* 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 JobsDemoExample.c
*
* @brief Demo for showing use of the Jobs library API. This demo uses the Jobs library
* along with the coreMQTT, mbedTLS and FreeRTOS+TCP libraries to communicate with the AWS IoT Jobs service.
* Please refer to AWS documentation for more information about AWS IoT Jobs.
* https://docs.aws.amazon.com/iot/latest/developerguide/iot-jobs.html
*
* The Jobs library API provides macros and helper functions for assembling MQTT topics strings,
* and for determining whether an incoming MQTT message is related to the AWS IoT Jobs service.
* The Jobs library does not depend on an MQTT library, and therefore, the code for MQTT operations
* is placed in another file (mqtt_demo_helpers.c) for improving readability of the demo code about using
* the Jobs library.
*
* @note This demo requires setup of an AWS account, provisioning of a Thing resource on the AWS IoT account,
* and the creation of Jobs for the Thing resource. Please refer to AWS CLI documentation for more information
* in creating a job document.
* https://docs.aws.amazon.com/cli/latest/reference/iot/create-job.html
*
* This demo connects to the AWS IoT broker and calls the MQTT APIs of the AWS IoT Jobs service to receive
* jobs queued (as JSON documents) for the Thing resource (associated with this demo application) on the cloud,
* then executes the jobs and updates the status of the jobs back to the cloud.
* The demo expects job documents to have an "action" JSON key. Actions can
* be one of "print", "publish", or "exit".
* A "print" job logs a message to the local console, and must contain a "message",
* e.g. { "action": "print", "message": "Hello World!" }.
* A "publish" job publishes a message to an MQTT Topic. The job document must
* contain a "message" and "topic" to publish to, e.g.
* { "action": "publish", "topic": "demo/jobs", "message": "Hello World!" }.
* An "exit" job exits the demo. Sending { "action": "exit" } will end the demo program.
*/
/* Standard includes. */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
/* Demo Specific config file. */
#include "demo_config.h"
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Jobs library header. */
#include "jobs.h"
/* JSON library includes. */
#include "core_json.h"
/* Include common MQTT demo helpers. */
#include "mqtt_demo_helpers.h"
/*------------- Demo configurations -------------------------*/
#ifndef democonfigTHING_NAME
#error "Please define the Thing resource name, democonfigTHING_NAME, in demo_config.h"
#endif
/**
* @brief The length of #democonfigTHING_NAME.
*/
#define THING_NAME_LENGTH ( ( uint16_t ) ( sizeof( democonfigTHING_NAME ) - 1 ) )
/*-----------------------------------------------------------*/
/**
* @brief The JSON key of the execution object.
*
* Job documents received from the AWS IoT Jobs service are in JSON format.
* All such JSON documents will contain this key, whose value represents the unique
* identifier of a Job.
*/
#define jobsexampleEXECUTION_KEY "execution"
/**
* @brief The length of #jobsexampleEXECUTION_KEY.
*/
#define jobsexampleEXECUTION_KEY_LENGTH ( sizeof( jobsexampleEXECUTION_KEY ) - 1 )
/**
* @brief The query key to use for searching the Job ID key in message payload
* from AWS IoT Jobs service.
*
* Job documents received from the AWS IoT Jobs service are in JSON format.
* All such JSON documents will contain this key, whose value represents the unique
* identifier of a Job.
*/
#define jobsexampleQUERY_KEY_FOR_JOB_ID jobsexampleEXECUTION_KEY ".jobId"
/**
* @brief The length of #jobsexampleQUERY_KEY_FOR_JOB_ID.
*/
#define jobsexampleQUERY_KEY_FOR_JOB_ID_LENGTH ( sizeof( jobsexampleQUERY_KEY_FOR_JOB_ID ) - 1 )
/**
* @brief The query key to use for searching the Jobs document ID key in message payload
* from AWS IoT Jobs service.
*
* Job documents received from the AWS IoT Jobs service are in JSON format.
* All such JSON documents will contain this key, whose value represents the unique
* identifier of a Job.
*/
#define jobsexampleQUERY_KEY_FOR_JOBS_DOC jobsexampleEXECUTION_KEY ".jobDocument"
/**
* @brief The length of #jobsexampleQUERY_KEY_FOR_JOBS_DOC.
*/
#define jobsexampleQUERY_KEY_FOR_JOBS_DOC_LENGTH ( sizeof( jobsexampleQUERY_KEY_FOR_JOBS_DOC ) - 1 )
/**
* @brief The query key to use for searching the Action key in Jobs document
* from AWS IoT Jobs service.
*
* This demo program expects this key to be in the Job document. It is a key
* specific to this demo.
*/
#define jobsexampleQUERY_KEY_FOR_ACTION "action"
/**
* @brief The length of #jobsexampleQUERY_KEY_FOR_ACTION.
*/
#define jobsexampleQUERY_KEY_FOR_ACTION_LENGTH ( sizeof( jobsexampleQUERY_KEY_FOR_ACTION ) - 1 )
/**
* @brief The query key to use for searching the Message key in Jobs document
* from AWS IoT Jobs service.
*
* This demo program expects this key to be in the Job document if the "action"
* is either "publish" or "print". It represents the message that should be
* published or printed, respectively.
*/
#define jobsexampleQUERY_KEY_FOR_MESSAGE "message"
/**
* @brief The length of #jobsexampleQUERY_KEY_FOR_MESSAGE.
*/
#define jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH ( sizeof( jobsexampleQUERY_KEY_FOR_MESSAGE ) - 1 )
/**
* @brief The query key to use for searching the topic key in Jobs document
* from AWS IoT Jobs service.
*
* This demo program expects this key to be in the Job document if the "action"
* is "publish". It represents the MQTT topic on which the message should be
* published.
*/
#define jobsexampleQUERY_KEY_FOR_TOPIC "topic"
/**
* @brief The length of #jobsexampleQUERY_KEY_FOR_TOPIC.
*/
#define jobsexampleQUERY_KEY_FOR_TOPIC_LENGTH ( sizeof( jobsexampleQUERY_KEY_FOR_TOPIC ) - 1 )
/**
* @brief Utility macro to generate the PUBLISH topic string to the
* DescribeJobExecution API of AWS IoT Jobs service for requesting
* the next pending job information.
*
* @param[in] thingName The name of the Thing resource to query for the
* next pending job.
*/
#define DESCRIBE_NEXT_JOB_TOPIC( thingName ) \
( JOBS_API_PREFIX thingName JOBS_API_BRIDGE JOBS_API_JOBID_NEXT "/" JOBS_API_GETPENDING )
/**
* @brief Utility macro to generate the subscription topic string for the
* NextJobExecutionChanged API of AWS IoT Jobs service that is required
* for getting notification about changes in the next pending job in the queue.
*
* @param[in] thingName The name of the Thing resource to query for the
* next pending Job.
*/
#define NEXT_JOB_EXECUTION_CHANGED_TOPIC( thingName ) \
( JOBS_API_PREFIX thingName JOBS_API_BRIDGE JOBS_API_NEXTJOBCHANGED )
/**
* @brief Format a JSON status message.
*
* @param[in] x one of "IN_PROGRESS", "SUCCEEDED", or "FAILED"
*/
#define MAKE_STATUS_REPORT( x ) "{\"status\":\"" x "\"}"
/**
* @brief The maximum number of times to run the loop in this demo.
*
* @note The demo loop is attempted to re-run only if it fails in an iteration.
* Once the demo loop succeeds in an iteration, the demo exits successfully.
*/
#ifndef JOBS_MAX_DEMO_LOOP_COUNT
#define JOBS_MAX_DEMO_LOOP_COUNT ( 3 )
#endif
/**
* @brief Time in ticks to wait between retries of the demo loop if
* demo loop fails.
*/
#define DELAY_BETWEEN_DEMO_RETRY_ITERATIONS_TICKS ( pdMS_TO_TICKS( 5000U ) )
/*-----------------------------------------------------------*/
/**
* @brief Currently supported actions that a job document can specify.
*/
typedef enum JobActionType
{
JOB_ACTION_PRINT, /**< Print a message. */
JOB_ACTION_PUBLISH, /**< Publish a message to an MQTT topic. */
JOB_ACTION_EXIT, /**< Exit the demo. */
JOB_ACTION_UNKNOWN /**< Unknown action. */
} JobActionType;
/*-----------------------------------------------------------*/
/**
* @brief Each compilation unit that consumes the NetworkContext must define it.
* It should contain a single pointer to the type of your desired transport.
* When using multiple transports in the same compilation unit, define this pointer as void *.
*
* @note Transport stacks are defined in FreeRTOS-Plus/Source/Application-Protocols/network_transport.
*/
struct NetworkContext
{
TlsTransportParams_t * pParams;
};
/*-----------------------------------------------------------*/
/**
* @brief The MQTT context used for MQTT operation.
*/
static MQTTContext_t xMqttContext;
/**
* @brief The network context used for mbedTLS operation.
*/
static NetworkContext_t xNetworkContext;
/**
* @brief The parameters for the network context using mbedTLS operation.
*/
static TlsTransportParams_t xTlsTransportParams;
/**
* @brief Static buffer used to hold MQTT messages being sent and received.
*/
static uint8_t usMqttConnectionBuffer[ democonfigNETWORK_BUFFER_SIZE ];
/**
* @brief Static buffer used to hold the job ID of the single job that
* is executed at a time in the demo. This buffer allows re-use of the MQTT
* connection context for sending status updates of a job while it is being
* processed.
*/
static uint8_t usJobIdBuffer[ democonfigNETWORK_BUFFER_SIZE ];
/**
* @brief Static buffer used to hold the job document of the single job that
* is executed at a time in the demo. This buffer allows re-use of the MQTT
* connection context for sending status updates of a job while it is being processed.
*/
static uint8_t usJobsDocumentBuffer[ democonfigNETWORK_BUFFER_SIZE ];
/**
* @brief Static buffer used to hold MQTT messages being sent and received.
*/
static MQTTFixedBuffer_t xBuffer =
{
.pBuffer = usMqttConnectionBuffer,
.size = democonfigNETWORK_BUFFER_SIZE
};
/**
* @brief A global flag which represents whether a job for the "Exit" action
* has been received from AWS IoT Jobs service.
*/
static BaseType_t xExitActionJobReceived = pdFALSE;
/**
* @brief A global flag which represents whether an error was encountered while
* executing the demo.
*
* @note When this flag is set, the demo terminates execution.
*/
static BaseType_t xDemoEncounteredError = pdFALSE;
/*-----------------------------------------------------------*/
/**
* @brief Converts a string in a job document to a #JobActionType
* value.
*
* @param[in] pcAction The job action as a string.
* @param[in] xActionLength The length of @p pcAction.
*
* @return A #JobActionType equivalent to the given string.
*/
static JobActionType prvGetAction( const char * pcAction,
size_t xActionLength );
/**
* @brief This example uses the MQTT library of the AWS IoT Device SDK for
* Embedded C. This is the prototype of the callback function defined by
* that library. It will be invoked whenever the MQTT library receives an
* incoming message.
*
* @param[in] pxMqttContext MQTT context pointer.
* @param[in] pxPacketInfo Packet Info pointer for the incoming packet.
* @param[in] pxDeserializedInfo Deserialized information from the incoming packet.
*/
static void prvEventCallback( MQTTContext_t * pxMqttContext,
MQTTPacketInfo_t * pxPacketInfo,
MQTTDeserializedInfo_t * pxDeserializedInfo );
/**
* @brief Process payload from NextJobExecutionChanged and DescribeJobExecution
* API MQTT topics of AWS IoT Jobs service.
*
* This handler parses the received payload about the next pending job, identifies
* the action requested in the job document, and executes the action.
*
* @param[in] pPublishInfo Deserialized publish info pointer for the incoming
* packet.
*/
static void prvNextJobHandler( MQTTPublishInfo_t * pxPublishInfo );
/**
* @brief Sends an update for a job to the UpdateJobExecution API of the AWS IoT Jobs service.
*
* @param[in] pcJobId The job ID whose status has to be updated.
* @param[in] usJobIdLength The length of the job ID string.
* @param[in] pcJobStatusReport The JSON formatted report to send to the AWS IoT Jobs service
* to update the status of @p pcJobId.
*/
static void prvSendUpdateForJob( char * pcJobId,
uint16_t usJobIdLength,
const char * pcJobStatusReport );
/**
* @brief Executes a job received from AWS IoT Jobs service and sends an update back to the service.
* It parses the received job document, executes the job depending on the job "Action" type, and
* sends an update to AWS for the Job.
*
* @param[in] pcJobId The ID of the job to execute.
* @param[in] usJobIdLength The length of the job ID string.
* @param[in] pcJobDocument The JSON document associated with the @a pcJobID job
* that is to be processed.
* @param[in] usDocumentLength The length of the job document.
*/
static void prvProcessJobDocument( char * pcJobId,
uint16_t usJobIdLength,
char * pcJobDocument,
uint16_t jobDocumentLength );
/**
* @brief The task used to demonstrate the Jobs library API.
*
* @param[in] pvParameters Parameters as passed at the time of task creation.
* Not used in this example.
*/
static void prvJobsDemoTask( void * pvParameters );
/*-----------------------------------------------------------*/
static JobActionType prvGetAction( const char * pcAction,
size_t xActionLength )
{
JobActionType xAction = JOB_ACTION_UNKNOWN;
configASSERT( pcAction != NULL );
if( strncmp( pcAction, "print", xActionLength ) == 0 )
{
xAction = JOB_ACTION_PRINT;
}
else if( strncmp( pcAction, "publish", xActionLength ) == 0 )
{
xAction = JOB_ACTION_PUBLISH;
}
else if( strncmp( pcAction, "exit", xActionLength ) == 0 )
{
xAction = JOB_ACTION_EXIT;
}
return xAction;
}
static void prvSendUpdateForJob( char * pcJobId,
uint16_t usJobIdLength,
const char * pcJobStatusReport )
{
char pUpdateJobTopic[ JOBS_API_MAX_LENGTH( THING_NAME_LENGTH ) ];
size_t ulTopicLength = 0;
JobsStatus_t xStatus = JobsSuccess;
configASSERT( ( pcJobId != NULL ) && ( usJobIdLength > 0 ) );
configASSERT( pcJobStatusReport != NULL );
/* Generate the PUBLISH topic string for the UpdateJobExecution API of AWS IoT Jobs service. */
xStatus = Jobs_Update( pUpdateJobTopic,
sizeof( pUpdateJobTopic ),
democonfigTHING_NAME,
THING_NAME_LENGTH,
pcJobId,
usJobIdLength,
&ulTopicLength );
if( xStatus == JobsSuccess )
{
if( xPublishToTopic( &xMqttContext,
pUpdateJobTopic,
ulTopicLength,
pcJobStatusReport,
strlen( pcJobStatusReport ) ) == pdFALSE )
{
/* Set global flag to terminate demo as PUBLISH operation to update job status failed. */
xDemoEncounteredError = pdTRUE;
LogError( ( "Failed to update the status of job: JobID=%.*s, NewStatePayload=%s",
usJobIdLength, pcJobId, pcJobStatusReport ) );
}
}
else
{
/* Set global flag to terminate demo as topic generation for UpdateJobExecution API failed. */
xDemoEncounteredError = pdTRUE;
LogError( ( "Failed to generate Publish topic string for sending job update: "
"JobID=%.*s, NewStatePayload=%s",
usJobIdLength, pcJobId, pcJobStatusReport ) );
}
}
static void prvProcessJobDocument( char * pcJobId,
uint16_t usJobIdLength,
char * pcJobDocument,
uint16_t jobDocumentLength )
{
char * pcAction = NULL;
size_t uActionLength = 0U;
JSONStatus_t xJsonStatus = JSONSuccess;
configASSERT( pcJobId != NULL );
configASSERT( usJobIdLength > 0 );
configASSERT( pcJobDocument != NULL );
configASSERT( jobDocumentLength > 0 );
xJsonStatus = JSON_Search( pcJobDocument,
jobDocumentLength,
jobsexampleQUERY_KEY_FOR_ACTION,
jobsexampleQUERY_KEY_FOR_ACTION_LENGTH,
&pcAction,
&uActionLength );
if( xJsonStatus != JSONSuccess )
{
LogError( ( "Job document schema is invalid. Missing expected \"action\" key in document." ) );
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "FAILED" ) );
}
else
{
JobActionType xActionType = JOB_ACTION_UNKNOWN;
char * pcMessage = NULL;
size_t ulMessageLength = 0U;
xActionType = prvGetAction( pcAction, uActionLength );
switch( xActionType )
{
case JOB_ACTION_EXIT:
LogInfo( ( "Received job contains \"exit\" action. Updating state of demo." ) );
xExitActionJobReceived = pdTRUE;
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "SUCCEEDED" ) );
break;
case JOB_ACTION_PRINT:
LogInfo( ( "Received job contains \"print\" action." ) );
xJsonStatus = JSON_Search( pcJobDocument,
jobDocumentLength,
jobsexampleQUERY_KEY_FOR_MESSAGE,
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
&pcMessage,
&ulMessageLength );
if( xJsonStatus == JSONSuccess )
{
/* Print the given message if the action is "print". */
LogInfo( ( "\r\n"
"/*-----------------------------------------------------------*/\r\n"
"\r\n"
"%.*s\r\n"
"\r\n"
"/*-----------------------------------------------------------*/\r\n"
"\r\n", ulMessageLength, pcMessage ) );
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "SUCCEEDED" ) );
}
else
{
LogError( ( "Job document schema is invalid. Missing \"message\" for \"print\" action type." ) );
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "FAILED" ) );
}
break;
case JOB_ACTION_PUBLISH:
LogInfo( ( "Received job contains \"publish\" action." ) );
char * pcTopic = NULL;
size_t ulTopicLength = 0U;
xJsonStatus = JSON_Search( pcJobDocument,
jobDocumentLength,
jobsexampleQUERY_KEY_FOR_TOPIC,
jobsexampleQUERY_KEY_FOR_TOPIC_LENGTH,
&pcTopic,
&ulTopicLength );
/* Search for "topic" key in the Jobs document.*/
if( xJsonStatus != JSONSuccess )
{
LogError( ( "Job document schema is invalid. Missing \"topic\" key for \"publish\" action type." ) );
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "FAILED" ) );
}
else
{
xJsonStatus = JSON_Search( pcJobDocument,
jobDocumentLength,
jobsexampleQUERY_KEY_FOR_MESSAGE,
jobsexampleQUERY_KEY_FOR_MESSAGE_LENGTH,
&pcMessage,
&ulMessageLength );
/* Search for "message" key in Jobs document.*/
if( xJsonStatus == JSONSuccess )
{
/* Publish to the parsed MQTT topic with the message obtained from
* the Jobs document.*/
if( xPublishToTopic( &xMqttContext,
pcTopic,
ulTopicLength,
pcMessage,
ulMessageLength ) == pdFALSE )
{
/* Set global flag to terminate demo as PUBLISH operation to execute job failed. */
xDemoEncounteredError = pdTRUE;
LogError( ( "Failed to execute job with \"publish\" action: Failed to publish to topic. "
"JobID=%.*s, Topic=%.*s",
usJobIdLength, pcJobId, ulTopicLength, pcTopic ) );
}
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "SUCCEEDED" ) );
}
else
{
LogError( ( "Job document schema is invalid. Missing \"message\" key for \"publish\" action type." ) );
prvSendUpdateForJob( pcJobId, usJobIdLength, MAKE_STATUS_REPORT( "FAILED" ) );
}
}
break;
default:
configPRINTF( ( "Received Job document with unknown action %.*s.",
uActionLength, pcAction ) );
break;
}
}
}
static void prvNextJobHandler( MQTTPublishInfo_t * pxPublishInfo )
{
configASSERT( pxPublishInfo != NULL );
configASSERT( ( pxPublishInfo->pPayload != NULL ) && ( pxPublishInfo->payloadLength > 0 ) );
/* Check validity of JSON message response from server.*/
if( JSON_Validate( pxPublishInfo->pPayload, pxPublishInfo->payloadLength ) != JSONSuccess )
{
LogError( ( "Received invalid JSON payload from AWS IoT Jobs service" ) );
}
else
{
char * pcJobId = NULL;
size_t ulJobIdLength = 0UL;
/* Parse the Job ID of the next pending job execution from the JSON payload. */
if( JSON_Search( ( char * ) pxPublishInfo->pPayload,
pxPublishInfo->payloadLength,
jobsexampleQUERY_KEY_FOR_JOB_ID,
jobsexampleQUERY_KEY_FOR_JOB_ID_LENGTH,
&pcJobId,
&ulJobIdLength ) != JSONSuccess )
{
LogWarn( ( "Failed to parse Job ID in message received from AWS IoT Jobs service: "
"IncomingTopic=%.*s, Payload=%.*s",
pxPublishInfo->topicNameLength, pxPublishInfo->pTopicName,
pxPublishInfo->payloadLength, pxPublishInfo->pPayload ) );
}
else
{
char * pcJobDocLoc = NULL;
size_t ulJobDocLength = 0UL;
configASSERT( ulJobIdLength < JOBS_JOBID_MAX_LENGTH );
LogInfo( ( "Received a Job from AWS IoT Jobs service: JobId=%.*s",
ulJobIdLength, pcJobId ) );
/* Copy the Job ID in the global buffer. This is done so that
* the MQTT context's network buffer can be used for sending jobs
* status updates to the AWS IoT Jobs service. */
memcpy( usJobIdBuffer, pcJobId, ulJobIdLength );
/* Search for the jobs document in the payload. */
if( JSON_Search( ( char * ) pxPublishInfo->pPayload,
pxPublishInfo->payloadLength,
jobsexampleQUERY_KEY_FOR_JOBS_DOC,
jobsexampleQUERY_KEY_FOR_JOBS_DOC_LENGTH,
&pcJobDocLoc,
&ulJobDocLength ) != JSONSuccess )
{
LogWarn( ( "Failed to parse document of next job received from AWS IoT Jobs service: "
"Topic=%.*s, JobID=%.*s",
pxPublishInfo->topicNameLength, pxPublishInfo->pTopicName,
ulJobIdLength, pcJobId ) );
}
else
{
/* Copy the Job document in buffer. This is done so that the MQTT connection buffer can
* be used for sending jobs status updates to the AWS IoT Jobs service. */
memcpy( usJobsDocumentBuffer, pcJobDocLoc, ulJobDocLength );
/* Process the Job document and execute the job. */
prvProcessJobDocument( usJobIdBuffer,
( uint16_t ) ulJobIdLength,
usJobsDocumentBuffer,
ulJobDocLength );
}
}
}
}
/*-----------------------------------------------------------*/
/* This is the callback function invoked by the MQTT stack when it receives
* incoming messages. This function demonstrates how to use the Jobs_MatchTopic
* function to determine whether the incoming message is a Jobs message
* or not. If it is, it handles the message depending on the message type.
*/
static void prvEventCallback( MQTTContext_t * pxMqttContext,
MQTTPacketInfo_t * pxPacketInfo,
MQTTDeserializedInfo_t * pxDeserializedInfo )
{
uint16_t usPacketIdentifier;
( void ) pxMqttContext;
configASSERT( pxDeserializedInfo != NULL );
configASSERT( pxMqttContext != NULL );
configASSERT( pxPacketInfo != NULL );
usPacketIdentifier = pxDeserializedInfo->packetIdentifier;
/* Handle incoming publish. The lower 4 bits of the publish packet
* type is used for the dup, QoS, and retain flags. Hence masking
* out the lower bits to check if the packet is publish. */
if( ( pxPacketInfo->type & 0xF0U ) == MQTT_PACKET_TYPE_PUBLISH )
{
configASSERT( pxDeserializedInfo->pPublishInfo != NULL );
JobsTopic_t topicType = JobsMaxTopic;
JobsStatus_t xStatus = JobsError;
LogDebug( ( "Received an incoming publish message: TopicName=%.*s",
pxDeserializedInfo->pPublishInfo->topicNameLength,
( const char * ) pxDeserializedInfo->pPublishInfo->pTopicName ) );
/* Let the Jobs library tell us whether this is a Jobs message. */
xStatus = Jobs_MatchTopic( ( char * ) pxDeserializedInfo->pPublishInfo->pTopicName,
pxDeserializedInfo->pPublishInfo->topicNameLength,
democonfigTHING_NAME,
THING_NAME_LENGTH,
&topicType,
NULL,
NULL );
if( xStatus == JobsSuccess )
{
/* Upon successful return, the messageType has been filled in. */
if( ( topicType == JobsDescribeSuccess ) || ( topicType == JobsNextJobChanged ) )
{
/* Handler function to process payload. */
prvNextJobHandler( pxDeserializedInfo->pPublishInfo );
}
else if( topicType == JobsUpdateSuccess )
{
LogInfo( ( "Job update status request has been accepted by AWS Iot Jobs service." ) );
}
else if( topicType == JobsStartNextFailed )
{
LogWarn( ( "Request for next job description rejected: RejectedResponse=%.*s.",
pxDeserializedInfo->pPublishInfo->payloadLength,
( const char * ) pxDeserializedInfo->pPublishInfo->pPayload ) );
}
else if( topicType == JobsUpdateFailed )
{
/* Set the global flag to terminate the demo, because the request for updating and executing the job status
* has been rejected by the AWS IoT Jobs service. */
xDemoEncounteredError = pdTRUE;
LogWarn( ( "Request for job update rejected: RejectedResponse=%.*s.",
pxDeserializedInfo->pPublishInfo->payloadLength,
( const char * ) pxDeserializedInfo->pPublishInfo->pPayload ) );
LogError( ( "Terminating demo as request to update job status has been rejected by "
"AWS IoT Jobs service..." ) );
}
else
{
LogWarn( ( "Received an unexpected messages from AWS IoT Jobs service: "
"JobsTopicType=%u", topicType ) );
}
}
else if( xStatus == JobsNoMatch )
{
LogWarn( ( "Incoming message topic does not belong to AWS IoT Jobs!: topic=%.*s",
pxDeserializedInfo->pPublishInfo->topicNameLength,
( const char * ) pxDeserializedInfo->pPublishInfo->pTopicName ) );
}
else
{
LogError( ( "Failed to parse incoming publish job. Topic=%.*s!",
pxDeserializedInfo->pPublishInfo->topicNameLength,
( const char * ) pxDeserializedInfo->pPublishInfo->pTopicName ) );
}
}
else
{
vHandleOtherIncomingPacket( pxPacketInfo, usPacketIdentifier );
}
}
/*-----------------------------------------------------------*/
/*
* @brief Create the task that demonstrates the Jobs library API via a
* MQTT mutually authenticated network connection with the AWS IoT broker.
*/
void vStartJobsDemo( void )
{
/* This example uses a single application task, which shows that how to
* use Jobs library to generate and validate AWS IoT Jobs service MQTT topics
* via coreMQTT library to communicate with the AWS IoT Jobs service. */
xTaskCreate( prvJobsDemoTask, /* Function that implements the task. */
"DemoTask", /* Text name for the task - only used for debugging. */
democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */
NULL, /* Task parameter - not used in this case. */
tskIDLE_PRIORITY, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */
NULL ); /* Used to pass out a handle to the created task - not used in this case. */
}
/*-----------------------------------------------------------*/
/**
* @brief Entry point of the Jobs demo.
*
* This main function demonstrates how to use the Jobs library API library.
*
* This demo uses helper functions for MQTT operations that have internal
* loops to process incoming messages. Those are not the focus of this demo
* and therefore, are placed in a separate file mqtt_demo_helpers.c.
*
* This function also shows that the communication with the AWS IoT Jobs services does
* not require explicit subscriptions to the response MQTT topics for request commands that
* sent to the MQTT APIs (like DescribeJobExecution API) of the service. The service
* will send messages on the response topics for the request commands on the same
* MQTT connection irrespective of whether the client subscribes to the response topics.
* Therefore, this demo processes incoming messages from response topics of DescribeJobExecution
* and UpdateJobExecution APIs without explicitly subscribing to the topics.
*/
void prvJobsDemoTask( void * pvParameters )
{
BaseType_t xDemoStatus = pdPASS;
UBaseType_t uxDemoRunCount = 0UL;
BaseType_t retryDemoLoop = pdFALSE;
/* Remove compiler warnings about unused parameters. */
( void ) pvParameters;
/* Set the pParams member of the network context with desired transport. */
xNetworkContext.pParams = &xTlsTransportParams;
/* This demo runs a single loop unless there are failures in the demo execution.
* In case of failures in the demo execution, demo loop will be retried for up to
* JOBS_MAX_DEMO_LOOP_COUNT times. */
do
{
/* Establish an MQTT connection with AWS IoT over a mutually authenticated TLS session. */
xDemoStatus = xEstablishMqttSession( &xMqttContext,
&xNetworkContext,
&xBuffer,
prvEventCallback );
if( xDemoStatus == pdFAIL )
{
/* Log error to indicate connection failure. */
LogError( ( "Failed to connect to AWS IoT broker." ) );
}
else
{
/* Print out a short user guide to the console. The default logging
* limit of 255 characters can be changed in demo_logging.c, but breaking
* up the only instance of a 1000+ character string is more practical. */
LogInfo( ( "\r\n"
"/*-----------------------------------------------------------*/\r\n"
"\r\n"
"The Jobs demo is now ready to accept Jobs.\r\n"
"Jobs may be created using the AWS IoT console or AWS CLI.\r\n"
"See the following link for more information.\r\n" ) );
LogInfo( ( "\r"
"https://docs.aws.amazon.com/cli/latest/reference/iot/create-job.html\r\n"
"\r\n"
"This demo expects Job documents to have an \"action\" JSON key.\r\n"
"The following actions are currently supported:\r\n" ) );
LogInfo( ( "\r"
" - print \r\n"
" Logs a message to the local console. The Job document must also contain a \"message\".\r\n"
" For example: { \"action\": \"print\", \"message\": \"Hello world!\"} will cause\r\n"
" \"Hello world!\" to be printed on the console.\r\n" ) );
LogInfo( ( "\r"
" - publish \r\n"
" Publishes a message to an MQTT topic. The Job document must also contain a \"message\" and \"topic\".\r\n" ) );
LogInfo( ( "\r"
" For example: { \"action\": \"publish\", \"topic\": \"demo/jobs\", \"message\": \"Hello world!\"} will cause\r\n"
" \"Hello world!\" to be published to the topic \"demo/jobs\".\r\n" ) );
LogInfo( ( "\r"
" - exit \r\n"
" Exits the demo program. This program will run until { \"action\": \"exit\" } is received.\r\n"
"\r\n"
"/*-----------------------------------------------------------*/\r\n" ) );
/* Subscribe to the NextJobExecutionChanged API topic to receive notifications about the next pending
* job in the queue for the Thing resource used by this demo. */
if( xSubscribeToTopic( &xMqttContext,
NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ),
sizeof( NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ) ) - 1 ) != pdPASS )
{
xDemoStatus = pdFAIL;
LogError( ( "Failed to subscribe to NextJobExecutionChanged API of AWS IoT Jobs service: Topic=%s",
NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ) ) );
}
}
if( xDemoStatus == pdPASS )
{
/* Publish to AWS IoT Jobs on the DescribeJobExecution API to request the next pending job.
*
* Note: It is not required to make MQTT subscriptions to the response topics of the
* DescribeJobExecution API because the AWS IoT Jobs service sends responses for
* the PUBLISH commands on the same MQTT connection irrespective of whether the client has subscribed
* to the response topics or not.
* This demo processes incoming messages from the response topics of the API in the prvEventCallback()
* handler that is supplied to the coreMQTT library. */
if( xPublishToTopic( &xMqttContext,
DESCRIBE_NEXT_JOB_TOPIC( democonfigTHING_NAME ),
sizeof( DESCRIBE_NEXT_JOB_TOPIC( democonfigTHING_NAME ) ) - 1,
NULL,
0 ) != pdPASS )
{
xDemoStatus = pdFAIL;
LogError( ( "Failed to publish to DescribeJobExecution API of AWS IoT Jobs service: "
"Topic=%s", DESCRIBE_NEXT_JOB_TOPIC( democonfigTHING_NAME ) ) );
}
}
/* Keep on running the demo until we receive a job for the "exit" action to exit the demo. */
while( ( xExitActionJobReceived == pdFALSE ) &&
( xDemoEncounteredError == pdFALSE ) &&
( xDemoStatus == pdPASS ) )
{
MQTTStatus_t xMqttStatus = MQTTSuccess;
/* Check if we have notification for the next pending job in the queue from the
* NextJobExecutionChanged API of the AWS IoT Jobs service. */
xMqttStatus = MQTT_ProcessLoop( &xMqttContext, 300U );
if( xMqttStatus != MQTTSuccess )
{
xDemoStatus = pdFAIL;
LogError( ( "Failed to receive notification about next pending job: "
"MQTT_ProcessLoop failed" ) );
}
}
/* Increment the demo run count. */
uxDemoRunCount++;
/* Retry demo loop only if there is a failure before completing
* the processing of any pending jobs. Any failure in MQTT unsubscribe
* or disconnect is considered a failure in demo execution and retry
* will not be attempted since a retry without any pending jobs will
* make this demo indefinitely wait. */
if( ( xDemoStatus == pdFAIL ) || ( xDemoEncounteredError == pdTRUE ) )
{
if( uxDemoRunCount < JOBS_MAX_DEMO_LOOP_COUNT )
{
LogWarn( ( "Demo iteration %lu failed. Retrying...", uxDemoRunCount ) );
retryDemoLoop = pdTRUE;
}
else
{
LogError( ( "All %d demo iterations failed.", JOBS_MAX_DEMO_LOOP_COUNT ) );
retryDemoLoop = pdFALSE;
}
}
else
{
/* Reset the flag for demo retry. */
retryDemoLoop = pdFALSE;
}
/* Unsubscribe from the NextJobExecutionChanged API topic. */
if( xUnsubscribeFromTopic( &xMqttContext,
NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ),
sizeof( NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ) ) - 1 ) != pdPASS )
{
xDemoStatus = pdFAIL;
LogError( ( "Failed to subscribe unsubscribe from the NextJobExecutionChanged API of AWS IoT Jobs service: "
"Topic=%s", NEXT_JOB_EXECUTION_CHANGED_TOPIC( democonfigTHING_NAME ) ) );
}
/* Disconnect the MQTT and network connections with AWS IoT. */
if( xDisconnectMqttSession( &xMqttContext, &xNetworkContext ) != pdPASS )
{
xDemoStatus = pdFAIL;
LogError( ( "Disconnection from AWS IoT failed..." ) );
}
/* Add a delay if a retry is required. */
if( retryDemoLoop == pdTRUE )
{
/* Clear the flag that indicates that indicates the demo error
* before attempting a retry. */
xDemoEncounteredError = pdFALSE;
LogInfo( ( "A short delay before the next demo iteration." ) );
vTaskDelay( DELAY_BETWEEN_DEMO_RETRY_ITERATIONS_TICKS );
}
} while( retryDemoLoop == pdTRUE );
if( ( xDemoEncounteredError == pdFALSE ) && ( xDemoStatus == pdPASS ) )
{
LogInfo( ( "Demo completed successfully." ) );
}
/* Delete this demo task. */
LogInfo( ( "Deleting Jobs Demo task." ) );
vTaskDelete( NULL );
}

View File

@ -0,0 +1,209 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* http://www.freertos.org/a00110.html
*
* The bottom of this file contains some constants specific to running the UDP
* stack in this demo. Constants specific to FreeRTOS+TCP itself (rather than
* the demo) are contained in FreeRTOSIPConfig.h.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configMAX_PRIORITIES ( 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Event group related definitions. */
#define configUSE_EVENT_GROUPS 1
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_pcTaskGetTaskName 1
/* This demo makes use of one or more example stats formatting functions. These
* format the raw data provided by the uxTaskGetSystemState() function in to human
* readable ASCII form. See the notes in the implementation of vTaskList() within
* FreeRTOS/Source/tasks.c for limitations. configUSE_STATS_FORMATTING_FUNCTIONS
* is set to 2 so the formatting functions are included without the stdio.h being
* included in tasks.c. That is because this project defines its own sprintf()
* functions. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
/* Assert call defined for debug builds. */
#ifdef _DEBUG
extern void vAssertCalled( const char * pcFile,
uint32_t ulLine );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#endif /* _DEBUG */
/* Application specific definitions follow. **********************************/
/* Only used when running in the FreeRTOS Windows simulator. Defines the
* priority of the task used to simulate Ethernet interrupts. */
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
/* This demo creates a virtual network connection by accessing the raw Ethernet
* or WiFi data to and from a real network connection. Many computers have more
* than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
* the demo which real port should be used to create the virtual port. The ports
* available are displayed on the console when the application is executed. For
* example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
* results in the wired network being used, while setting
* configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
* used. */
#define configNETWORK_INTERFACE_TO_USE ( 0L )
/* The address to which logging is sent should UDP logging be enabled. */
#define configUDP_LOGGING_ADDR0 192
#define configUDP_LOGGING_ADDR1 168
#define configUDP_LOGGING_ADDR2 0
#define configUDP_LOGGING_ADDR3 11
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet/WiFi data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition above for information on how to
* configure the real network connection to use. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x11
#define configMAC_ADDR2 0x11
#define configMAC_ADDR3 0x11
#define configMAC_ADDR4 0x11
#define configMAC_ADDR5 0x41
/* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configIP_ADDR0 10
#define configIP_ADDR1 10
#define configIP_ADDR2 10
#define configIP_ADDR3 200
/* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to
* 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configGATEWAY_ADDR0 10
#define configGATEWAY_ADDR1 10
#define configGATEWAY_ADDR2 10
#define configGATEWAY_ADDR3 1
/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
* 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set
* to 1 but a DNS server cannot be contacted.*/
#define configDNS_SERVER_ADDR0 208
#define configDNS_SERVER_ADDR1 67
#define configDNS_SERVER_ADDR2 222
#define configDNS_SERVER_ADDR3 222
/* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configNET_MASK0 255
#define configNET_MASK1 0
#define configNET_MASK2 0
#define configNET_MASK3 0
/* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 )
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/* Visual studio does not have an implementation of strcasecmp(). */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strcmpi _strcmpi
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
#define configPRINTF( X ) vLoggingPrintf X
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,309 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*/
/*****************************************************************************
*
* See the following URL for configuration information.
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html
*
*****************************************************************************/
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
* 1 then FreeRTOS_debug_printf should be defined to the function used to print
* out the debugging messages. */
#define ipconfigHAS_DEBUG_PRINTF 0
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
#define FreeRTOS_debug_printf( X ) vLoggingPrintf X
#endif
/* Set to 1 to print out non debugging messages, for example the output of the
* FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
* then FreeRTOS_printf should be set to the function used to print out the
* messages. */
#define ipconfigHAS_PRINTF 1
#if ( ipconfigHAS_PRINTF == 1 )
#define FreeRTOS_printf( X ) vLoggingPrintf X
#endif
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
/* If the network card/driver includes checksum offloading (IP/TCP/UDP checksums)
* then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1 to prevent the software
* stack repeating the checksum calculations. */
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
/* Several API's will block until the result is known, or the action has been
* performed, for example FreeRTOS_send() and FreeRTOS_recv(). The timeouts can be
* set per socket, using setsockopt(). If not set, the times below will be
* used as defaults. */
#define ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME ( 2000 )
#define ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME ( 5000 )
/* Include support for LLMNR: Link-local Multicast Name Resolution
* (non-Microsoft) */
#define ipconfigUSE_LLMNR ( 0 )
/* Include support for NBNS: NetBIOS Name Service (Microsoft) */
#define ipconfigUSE_NBNS ( 0 )
/* Include support for DNS caching. For TCP, having a small DNS cache is very
* useful. When a cache is present, ipconfigDNS_REQUEST_ATTEMPTS can be kept low
* and also DNS may use small timeouts. If a DNS reply comes in after the DNS
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket. */
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 64 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
/* The IP stack executes it its own task (although any application task can make
* use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY
* sets the priority of the task that executes the IP stack. The priority is a
* standard FreeRTOS task priority so can take any value from 0 (the lowest
* priority) to (configMAX_PRIORITIES - 1) (the highest priority).
* configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in
* FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to
* the priority assigned to the task executing the IP stack relative to the
* priority assigned to tasks that use the IP stack. */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+TCP
* task. This setting is less important when the FreeRTOS Win32 simulator is used
* as the Win32 simulator only stores a fixed amount of information on the task
* stack. FreeRTOS includes optional stack overflow detection, see:
* http://www.freertos.org/Stacks-and-stack-overflow-checking.html */
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 5 )
/* ipconfigRAND32() is called by the IP stack to generate random numbers for
* things such as a DHCP transaction number or initial sequence number. Random
* number generation is performed via this macro to allow applications to use their
* own random number generation method. For example, it might be possible to
* generate a random number by sampling noise on an analogue input. */
extern UBaseType_t uxRand();
#define ipconfigRAND32() uxRand()
/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the
* network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK
* is not set to 1 then the network event hook will never be called. See
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml
*/
#define ipconfigUSE_NETWORK_EVENT_HOOK 1
/* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but
* a network buffer cannot be obtained then the calling task is held in the Blocked
* state (so other tasks can continue to executed) until either a network buffer
* becomes available or the send block time expires. If the send block time expires
* then the send operation is aborted. The maximum allowable send block time is
* capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the
* maximum allowable send block time prevents a deadlock occurring when
* all the network buffers are in use and the tasks that process (and subsequently
* free) the network buffers are themselves blocked waiting for a network buffer.
* ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
* milliseconds can be converted to a time in ticks by dividing the time in
* milliseconds by portTICK_PERIOD_MS. */
#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000 / portTICK_PERIOD_MS )
/* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP
* address, netmask, DNS server address and gateway address from a DHCP server. If
* ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will use a static IP address. The
* stack will revert to using the static IP address even when ipconfigUSE_DHCP is
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
* and accepted, or the interval between transmissions reaches
* ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the
* static IP address passed as a parameter to FreeRTOS_IPInit() if the
* re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without
* a DHCP reply being received. */
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_PERIOD_MS )
/* The ARP cache is a table that maps IP addresses to MAC addresses. The IP
* stack can only send a UDP message to a remove IP address if it knowns the MAC
* address associated with the IP address, or the MAC address of the router used to
* contact the remote IP address. When a UDP message is received from a remote IP
* address the MAC address and IP address are added to the ARP cache. When a UDP
* message is sent to a remote IP address that does not already appear in the ARP
* cache then the UDP message is replaced by a ARP message that solicits the
* required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum
* number of entries that can exist in the ARP table at any one time. */
#define ipconfigARP_CACHE_ENTRIES 6
/* ARP requests that do not result in an ARP response will be re-transmitted a
* maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is
* aborted. */
#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )
/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP
* table being created or refreshed and the entry being removed because it is stale.
* New ARP requests are sent for ARP cache entries that are nearing their maximum
* age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is
* equal to 1500 seconds (or 25 minutes). */
#define ipconfigMAX_ARP_AGE 150
/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling
* routines, which are relatively large. To save code space the full
* FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster
* alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr()
* takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.
* FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets
* (for example, 192, 168, 0, 1) as its parameters. If
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
#define ipconfigINCLUDE_FULL_INET_ADDR 1
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
* to ensure the total amount of RAM that can be consumed by the IP stack is capped
* to a pre-determinable value. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
/* A FreeRTOS queue is used to send events from application tasks to the IP
* stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can
* be queued for processing at any one time. The event queue must be a minimum of
* 5 greater than the total number of network buffers. */
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )
/* The address of a socket is the combination of its IP address and its port
* number. FreeRTOS_bind() is used to manually allocate a port number to a socket
* (to 'bind' the socket to a port), but manual binding is not normally necessary
* for client sockets (those sockets that initiate outgoing connections rather than
* wait for incoming connections on a known port number). If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling
* FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP
* stack automatically binding the socket to a port number from the range
* socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()
* on a socket that has not yet been bound will result in the send operation being
* aborted. */
#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1
/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */
#define ipconfigUDP_TIME_TO_LIVE 128
#define ipconfigTCP_TIME_TO_LIVE 128 /* also defined in FreeRTOSIPConfigDefaults.h */
/* USE_TCP: Use TCP and all its features */
#define ipconfigUSE_TCP ( 1 )
/* Use the TCP socket wake context with a callback. */
#define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK_WITH_CONTEXT ( 1 )
/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 1 )
/* The MTU is the maximum number of bytes the payload of a network frame can
* contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1200
/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
#define ipconfigREPLY_TO_INCOMING_PINGS 1
/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the
* FreeRTOS_SendPingRequest() API function is available. */
#define ipconfigSUPPORT_OUTGOING_PINGS 0
/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()
* (and associated) API function is available. */
#define ipconfigSUPPORT_SELECT_FUNCTION 1
/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames
* that are not in Ethernet II format will be dropped. This option is included for
* potential future IP stack developments. */
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the
* responsibility of the Ethernet interface to filter out packets that are of no
* interest. If the Ethernet interface does not implement this functionality, then
* set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack
* perform the filtering instead (it is much less efficient for the stack to do it
* because the packet will already have been passed into the stack). If the
* Ethernet driver does all the necessary filtering in hardware then software
* filtering can be removed by using a value other than 1 or 0. */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
/* The windows simulator cannot really simulate MAC interrupts, and needs to
* block occasionally to allow other tasks to run. */
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS )
/* Advanced only: in order to access 32-bit fields in the IP packets with
* 32-bit memory instructions, all packets will be stored 32-bit-aligned, plus 16-bits.
* This has to do with the contents of the IP-packets: all 32-bit fields are
* 32-bit-aligned, plus 16-bit(!) */
#define ipconfigPACKET_FILLER_SIZE 2
/* Define the size of the pool of TCP window descriptors. On the average, each
* TCP socket will use up to 2 x 6 descriptors, meaning that it can have 2 x 6
* outstanding packets (for Rx and Tx). When using up to 10 TP sockets
* simultaneously, one could define TCP_WIN_SEG_COUNT as 120. */
#define ipconfigTCP_WIN_SEG_COUNT 240
/* Each TCP socket has a circular buffers for Rx and Tx, which have a fixed
* maximum size. Define the size of Rx buffer for TCP sockets. */
#define ipconfigTCP_RX_BUFFER_LENGTH ( 5000 )
/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )
/* When using call-back handlers, the driver may check if the handler points to
* real program memory (RAM or flash) or just has a random non-zero value. */
#define ipconfigIS_VALID_PROG_ADDRESS( x ) ( ( x ) != NULL )
/* Include support for TCP hang protection. All sockets in a connecting or
* disconnecting stage will timeout after a period of non-activity. */
#define ipconfigTCP_HANG_PROTECTION ( 1 )
#define ipconfigTCP_HANG_PROTECTION_TIME ( 30 )
/* Include support for TCP keep-alive messages. */
#define ipconfigTCP_KEEP_ALIVE ( 1 )
#define ipconfigTCP_KEEP_ALIVE_INTERVAL ( 20 ) /* in seconds */
#define portINLINE __inline
#endif /* FREERTOS_IP_CONFIG_H */

View File

@ -0,0 +1,622 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging;..\..\..\Common\WinPCap;..\..\..\..\..\FreeRTOS\Source\include;..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp;..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls;..\..\..\..\Source\Utilities\mbedtls_freertos;..\..\..\..\..\Source\mbedtls_utils;..\..\..\..\ThirdParty\mbedtls\include;..\..\..\..\Source\AWS\jobs\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\Mqtt_Demo_Helpers;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/wd4210 /wd4127 /wd4214 /wd4201 /wd4244 /wd4310 /wd4200 %(AdditionalOptions)</AdditionalOptions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Common\WinPCap</AdditionalLibraryDirectories>
<Profile>false</Profile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\..\..\Source\include;..\..\..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.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\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\AWS\jobs\source\jobs.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c" />
<ClCompile Include="main.c" />
<ClCompile Include="DemoTasks\JobsDemoExample.c" />
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\jobs\source\include\jobs.h" />
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h" />
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.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\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_tls13_keys.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h" />
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="mbedtls_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="core_mqtt_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,809 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="FreeRTOS">
<UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source">
<UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>
<Extensions>*.c</Extensions>
</Filter>
<Filter Include="FreeRTOS\Source\Portable">
<UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+">
<UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source\include">
<UniqueIdentifier>{d2dcd641-8d91-492b-852f-5563ffadaec6}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP">
<UniqueIdentifier>{8672fa26-b119-481f-8b8d-086419c01a3e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\portable">
<UniqueIdentifier>{4570be11-ec96-4b55-ac58-24b50ada980a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\include">
<UniqueIdentifier>{5d93ed51-023a-41ad-9243-8d230165d34b}</UniqueIdentifier>
</Filter>
<Filter Include="DemoTasks">
<UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries">
<UniqueIdentifier>{60717407-397f-4ea5-8492-3314acdd25f0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard">
<UniqueIdentifier>{8a90222f-d723-4b4e-8e6e-c57afaf7fa92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT">
<UniqueIdentifier>{2d17d5e6-ed70-4e42-9693-f7a63baf4948}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include">
<UniqueIdentifier>{6ad56e6d-c330-4830-8f4b-c75b05dfa866}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform">
<UniqueIdentifier>{84613aa2-91dc-4e1a-a3b3-823b6d7bf0e0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls">
<UniqueIdentifier>{7bedd2e3-adbb-4c95-9632-445132b459ce}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\include">
<UniqueIdentifier>{07a14673-4d02-4780-a099-6b8c654dff91}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\library">
<UniqueIdentifier>{e875c5e3-40a2-4408-941e-5e1a951cc663}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls">
<UniqueIdentifier>{8a0aa896-6b3a-49b3-997e-681f0d1949ae}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{c5a01679-3e7a-4320-97ac-ee5b872c1650}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include">
<UniqueIdentifier>{c992824d-4198-46b2-8d59-5f99ab9946ab}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{6a35782c-bc09-42d5-a850-98bcb668a4dc}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON">
<UniqueIdentifier>{20aee693-d2dc-480e-ae21-0db2156e54ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS">
<UniqueIdentifier>{0dacb84e-5cc3-4eed-8fb1-68b6e4741f77}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\jobs">
<UniqueIdentifier>{3dc3c37b-6417-4a84-a16e-b1acf21c04cf}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\jobs\include">
<UniqueIdentifier>{e0b135a9-7746-4fea-baa7-288b070886a4}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{d286fe5f-3c24-4a2f-881c-4b458623648d}</UniqueIdentifier>
</Filter>
<Filter Include="Logging">
<UniqueIdentifier>{c8b7bd64-7a0e-458b-bcaa-8081806e4508}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include">
<UniqueIdentifier>{6c6bc472-3f73-42c1-83e0-ffe6cae93393}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm">
<UniqueIdentifier>{fcf93295-15e2-4a84-a5e9-b3c162e9f061}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include">
<UniqueIdentifier>{7de8717e-b494-4eba-ba10-bc8252d9876a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON</Filter>
</ClCompile>
<ClCompile Include="main.c" />
<ClCompile Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.c" />
<ClCompile Include="..\..\..\..\Source\AWS\jobs\source\jobs.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\jobs</Filter>
</ClCompile>
<ClCompile Include="DemoTasks\JobsDemoExample.c">
<Filter>DemoTasks</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c">
<Filter>Logging</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\jobs\source\include\jobs.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\jobs\include</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSIPConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="mbedtls_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\Mqtt_Demo_Helpers\mqtt_demo_helpers.h" />
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_tls13_keys.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,77 @@
/*
* FreeRTOS V202111.00
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.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
#endif /* ifndef CORE_MQTT_CONFIG_H */

View File

@ -0,0 +1,232 @@
/*
* FreeRTOS V202111.00
* 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
/* FreeRTOS config include. */
#include "FreeRTOSConfig.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 "JobsDemo"
#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 The Thing resource registered on your AWS IoT account to use in the demo.
* A Thing resource is required to communicate with the AWS IoT Jobs service.
*
* @note The Things associated with your AWS account can be found in the
* AWS IoT console under Manage/Things, or using the ListThings REST API (that can
* be called with the AWS CLI command line tool).
*
* #define democonfigTHING_NAME "...insert here..."
*/
/**
* @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.
*
* #define democonfigCLIENT_IDENTIFIER "...insert here..."
*/
/**
* @brief The AWS IoT broker endpoint to connect to in the demo.
*
* @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..."
*/
/**
* @brief The port to use for the demo.
*
* In general, port 8883 is for secured MQTT connections.
*
* @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. )
*/
/**
* @brief Root CA certificate of AWS IoT broker.
*
* This certificate is used to identify the AWS IoT server and is publicly
* available. Refer to the link below.
* https://www.amazontrust.com/repository/AmazonRootCA1.pem
*
* @note This certificate should be PEM-encoded.
*
* 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.
*
* Please 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 refer to the AWS documentation below for details
* regarding client authentication.
* 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 The username value for authenticating client to the MQTT broker when
* username/password based client authentication is used.
*
* Please 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.
*
* Please 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.
*/
#include "core_mqtt.h" /* Include coreMQTT header for MQTT_LIBRARY_VERSION macro. */
#define democonfigMQTT_LIB "core-mqtt@"MQTT_LIBRARY_VERSION
/**
* @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
/**
* @brief Size of the network buffer for MQTT packets.
*/
#define democonfigNETWORK_BUFFER_SIZE ( 1024U )
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {150F08BF-9D61-4CC2-8DBF-1335172A1EA4}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FreeRTOS_Plus_TCP_Minimal.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,376 @@
/*
* FreeRTOS V202111.00
* 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>
/* Visual studio intrinsics used so the __debugbreak() function is available
* should an assert get hit. */
#include <intrin.h>
/* FreeRTOS includes. */
#include <FreeRTOS.h>
#include "task.h"
/* TCP/IP stack includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*
* Prototypes for the demos that can be started from this project. Note the
* Jobs demo is not actually started until the network is already, which is
* indicated by vApplicationIPNetworkEventHook() executing - hence
* vStartJobsDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartJobsDemo( void );
/*
* Just seeds the simple pseudo random number generator.
*
* !!! NOTE !!!
* This is not a secure method of generating random numbers and production
* devices should use a true random number generator (TRNG).
*/
static void prvSRand( UBaseType_t ulSeed );
/*
* Miscellaneous initialization including preparing the logging and seeding the
* random number generator.
*/
static void prvMiscInitialisation( void );
/* The default IP and MAC address used by the demo. The address configuration
* defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is
* 1 but a DHCP server could not be contacted. See the online documentation for
* more information. */
static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };
static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };
static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };
static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };
/* Set the following constant to pdTRUE to log using the method indicated by the
* name of the constant, or pdFALSE to not log using the method indicated by the
* name of the constant. Options include to standard out (xLogToStdout), to a disk
* file (xLogToFile), and to a UDP port (xLogToUDP). If xLogToUDP is set to pdTRUE
* then UDP messages are sent to the IP address configured as the UDP logging server
* address (see the configUDP_LOGGING_ADDR0 definitions in FreeRTOSConfig.h) and
* the port number set by configPRINT_PORT in FreeRTOSConfig.h. */
const BaseType_t xLogToStdout = pdTRUE, xLogToFile = pdFALSE, xLogToUDP = pdFALSE;
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition for information on how to configure
* the real network connection to use. */
const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
/* Used by the pseudo random number generator. */
static UBaseType_t ulNextRand;
/*-----------------------------------------------------------*/
int main( void )
{
/* Miscellaneous initialization including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
/* Initialize the network interface.
*
***NOTE*** Tasks that use the network are created in the network event hook
* when the network is connected and ready for use (see the implementation of
* vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* 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 (this is standard text that is not
* really applicable to the Win32 simulator port). */
for( ; ; )
{
__debugbreak();
}
}
/*-----------------------------------------------------------*/
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
* events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
static BaseType_t xTasksAlreadyCreated = pdFALSE;
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
/* Create the tasks that use the IP stack if they have not already been
* created. */
if( xTasksAlreadyCreated == pdFALSE )
{
/* Demos that use the network are created after the network is
* up. */
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );
vStartJobsDemo();
xTasksAlreadyCreated = pdTRUE;
}
/* Print out the network configuration, which may have come from a DHCP
* server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
LogInfo( ( "\r\n\r\nIP Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer );
LogInfo( ( "Subnet Mask: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );
LogInfo( ( "Gateway Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );
LogInfo( ( "DNS Server Address: %s\r\n\r\n\r\n", cBuffer ) );
}
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile,
uint32_t ulLine )
{
volatile uint32_t ulBlockVariable = 0UL;
volatile char * pcFileName = ( volatile char * ) pcFile;
volatile uint32_t ulLineNumber = ulLine;
( void ) pcFileName;
( void ) ulLineNumber;
printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */
taskDISABLE_INTERRUPTS();
{
while( ulBlockVariable == 0UL )
{
__debugbreak();
}
}
taskENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
UBaseType_t uxRand( void )
{
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/*
* Utility function to generate a pseudo random number.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
}
/*-----------------------------------------------------------*/
static void prvSRand( UBaseType_t ulSeed )
{
/* Utility function to seed the pseudo random number generator. */
ulNextRand = ulSeed;
}
/*-----------------------------------------------------------*/
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
/*
* Seed random number generator.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
}
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
const char * pcApplicationHostnameHook( void )
{
/* Assign the name "FreeRTOS" to this network node. This function will
* be called during the DHCP: the machine will be registered with an IP
* address plus this name. */
return mainHOST_NAME;
}
#endif
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 )
BaseType_t xApplicationDNSQueryHook( const char * pcName )
{
BaseType_t xReturn;
/* Determine if a name lookup is for this node. Two names are given
* to this node: that returned by pcApplicationHostnameHook() and that set
* by mainDEVICE_NICK_NAME. */
if( _stricmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( _stricmp( pcName, mainDEVICE_NICK_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) */
/*-----------------------------------------------------------*/
/*
* Callback that provides the inputs necessary to generate a randomized TCP
* Initial Sequence Number per RFC 6528. THIS IS ONLY A DUMMY IMPLEMENTATION
* THAT RETURNS A PSEUDO RANDOM NUMBER SO IS NOT INTENDED FOR USE IN PRODUCTION
* SYSTEMS.
*/
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
{
( void ) ulSourceAddress;
( void ) usSourcePort;
( void ) ulDestinationAddress;
( void ) usDestinationPort;
return uxRand();
}
/*-----------------------------------------------------------*/
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.
*/
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
* implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
* used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
* state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
* application must provide an implementation of vApplicationGetTimerTaskMemory()
* to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
uint32_t * pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
* task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,137 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/* This file configures mbed TLS for FreeRTOS. */
#ifndef MBEDTLS_CONFIG_H_
#define MBEDTLS_CONFIG_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Generate errors if deprecated functions are used. */
#define MBEDTLS_DEPRECATED_REMOVED
/* Place AES tables in ROM. */
#define MBEDTLS_AES_ROM_TABLES
/* Enable the following cipher modes. */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CFB
#define MBEDTLS_CIPHER_MODE_CTR
/* Enable the following cipher padding modes. */
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
#define MBEDTLS_CIPHER_PADDING_ZEROS
/* Cipher suite configuration. */
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/* Enable all SSL alert messages. */
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/* Enable the following SSL features. */
#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_ALPN
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/* Check certificate key usage. */
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/* Disable platform entropy functions. */
#define MBEDTLS_NO_PLATFORM_ENTROPY
/* Enable the following mbed TLS features. */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_GCM_C
#define MBEDTLS_MD_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_THREADING_ALT
#define MBEDTLS_THREADING_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
/* Set the memory allocation functions on FreeRTOS. */
void * mbedtls_platform_calloc( size_t nmemb,
size_t size );
void mbedtls_platform_free( void * ptr );
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
/* The network send and receive functions on FreeRTOS. */
int mbedtls_platform_send( void * ctx,
const unsigned char * buf,
size_t len );
int mbedtls_platform_recv( void * ctx,
unsigned char * buf,
size_t len );
/* These two macro used by mbedtls_ssl_set_bio in using_mbedtls network
* transport layer. */
#define MBEDTLS_SSL_SEND mbedtls_platform_send
#define MBEDTLS_SSL_RECV mbedtls_platform_recv
/* The entropy poll function. */
int mbedtls_platform_entropy_poll( void * data,
unsigned char * output,
size_t len,
size_t * olen );
#include "mbedtls/check_config.h"
#endif /* ifndef MBEDTLS_CONFIG_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,137 @@
/*
* FreeRTOS V202111.00
* 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 MQTT_DEMO_HELPERS_H
#define MQTT_DEMO_HELPERS_H
/* MQTT API header. */
#include "core_mqtt.h"
/* Transport interface implementation include header for TLS. */
#include "using_mbedtls.h"
/**
* @brief Establish a MQTT connection.
*
* @param[in, out] pxMqttContext The memory for the MQTTContext_t that will be used for the
* MQTT connection.
* @param[out] pxNetworkContext The memory for the NetworkContext_t required for the
* MQTT connection.
* @param[in] pxNetworkBuffer The buffer space for initializing the @p pxMqttContext MQTT
* context used in the MQTT connection.
* @param[in] eventCallback The callback function used to receive incoming
* publishes and incoming acks from MQTT library.
*
* @return The status of the final connection attempt.
*/
BaseType_t xEstablishMqttSession( MQTTContext_t * pxMqttContext,
NetworkContext_t * pxNetworkContext,
MQTTFixedBuffer_t * pxNetworkBuffer,
MQTTEventCallback_t eventCallback );
/**
* @brief Handle the incoming packet if it's not related to the device shadow.
*
* @param[in] pxPacketInfo Packet Info pointer for the incoming packet.
* @param[in] usPacketIdentifier Packet identifier of the incoming packet.
*/
void vHandleOtherIncomingPacket( MQTTPacketInfo_t * pxPacketInfo,
uint16_t usPacketIdentifier );
/**
* @brief Close the MQTT connection.
*
* @param[in, out] pxMqttContext The MQTT context for the MQTT connection to close.
* @param[in, out] pxNetworkContext The network context for the TLS session to
* terminate.
*
* @return pdPASS if DISCONNECT was successfully sent;
* pdFAIL otherwise.
*/
BaseType_t xDisconnectMqttSession( MQTTContext_t * pxMqttContext,
NetworkContext_t * pxNetworkContext );
/**
* @brief Subscribe to a MQTT topic filter.
*
* @param[in] pxMqttContext The MQTT context for the MQTT connection.
* @param[in] pcTopicFilter Pointer to the shadow topic buffer.
* @param[in] usTopicFilterLength Indicates the length of the shadow
* topic buffer.
*
* @return pdPASS if SUBSCRIBE was successfully sent;
* pdFAIL otherwise.
*/
BaseType_t xSubscribeToTopic( MQTTContext_t * pxMqttContext,
const char * pcTopicFilter,
uint16_t usTopicFilterLength );
/**
* @brief Sends an MQTT UNSUBSCRIBE to unsubscribe from the shadow
* topic.
*
* @param[in] pxMqttContext The MQTT context for the MQTT connection.
* @param[in] pcTopicFilter Pointer to the MQTT topic filter.
* @param[in] usTopicFilterLength Indicates the length of the topic filter.
*
* @return pdPASS if UNSUBSCRIBE was successfully sent;
* pdFAIL otherwise.
*/
BaseType_t xUnsubscribeFromTopic( MQTTContext_t * pxMqttContext,
const char * pcTopicFilter,
uint16_t usTopicFilterLength );
/**
* @brief Publish a message to a MQTT topic.
*
* @param[in] pxMqttContext The MQTT context for the MQTT connection.
* @param[in] pcTopicFilter Points to the topic.
* @param[in] topicFilterLength The length of the topic.
* @param[in] pcPayload Points to the payload.
* @param[in] payloadLength The length of the payload.
*
* @return pdPASS if PUBLISH was successfully sent;
* pdFAIL otherwise.
*/
BaseType_t xPublishToTopic( MQTTContext_t * pxMqttContext,
const char * pcTopicFilter,
int32_t topicFilterLength,
const char * pcPayload,
size_t payloadLength );
/**
* @brief Invoke the core MQTT library's process loop function.
*
* @param[in] pxMqttContext The MQTT context for the MQTT connection.
* @param[in] ulTimeoutMs Minimum time for the loop to run, if no error occurs.
*
* @return pdPASS if process loop was successful;
* pdFAIL otherwise.
*/
BaseType_t xProcessLoop( MQTTContext_t * pxMqttContext,
uint32_t ulTimeoutMs );
#endif /* ifndef MQTT_DEMO_HELPERS_H */

View File

@ -0,0 +1,248 @@
/*
* FreeRTOS V202111.00
* 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"
/* Parser utilities. */
#include "http_parser.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 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 )
{
/* http-parser status. Initialized to 1 to signify failure. */
int lParserStatus = 1;
struct http_parser_url xUrlParser;
HTTPStatus_t xHTTPStatus = HTTPSuccess;
/* Sets all members in xUrlParser to 0. */
http_parser_url_init( &xUrlParser );
if( ( pcUrl == NULL ) || ( pcPath == NULL ) || ( pxPathLen == NULL ) )
{
LogError( ( "NULL parameter passed to getUrlPath()." ) );
xHTTPStatus = HTTPInvalidParameter;
}
if( xHTTPStatus == HTTPSuccess )
{
lParserStatus = http_parser_parse_url( pcUrl, xUrlLen, 0, &xUrlParser );
if( lParserStatus != 0 )
{
LogError( ( "Error parsing the input URL %.*s. Error code: %d.",
( int32_t ) xUrlLen,
pcUrl,
lParserStatus ) );
xHTTPStatus = HTTPParserInternalError;
}
}
if( xHTTPStatus == HTTPSuccess )
{
*pxPathLen = ( size_t ) ( xUrlParser.field_data[ UF_PATH ].len );
if( *pxPathLen == 0 )
{
xHTTPStatus = HTTPNoResponse;
*pcPath = NULL;
}
else
{
*pcPath = &pcUrl[ xUrlParser.field_data[ UF_PATH ].off ];
}
}
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 )
{
/* http-parser status. Initialized to 1 to signify failure. */
int lParserStatus = 1;
struct http_parser_url xUrlParser;
HTTPStatus_t xHTTPStatus = HTTPSuccess;
/* Sets all members in xUrlParser to 0. */
http_parser_url_init( &xUrlParser );
if( ( pcUrl == NULL ) || ( pcAddress == NULL ) || ( pxAddressLen == NULL ) )
{
LogError( ( "NULL parameter passed to getUrlAddress()." ) );
xHTTPStatus = HTTPInvalidParameter;
}
if( xHTTPStatus == HTTPSuccess )
{
lParserStatus = http_parser_parse_url( pcUrl, xUrlLen, 0, &xUrlParser );
if( lParserStatus != 0 )
{
LogError( ( "Error parsing the input URL %.*s. Error code: %d.",
( int32_t ) xUrlLen,
pcUrl,
lParserStatus ) );
xHTTPStatus = HTTPParserInternalError;
}
}
if( xHTTPStatus == HTTPSuccess )
{
*pxAddressLen = ( size_t ) ( xUrlParser.field_data[ UF_HOST ].len );
if( *pxAddressLen == 0 )
{
xHTTPStatus = HTTPNoResponse;
*pcAddress = NULL;
}
else
{
*pcAddress = &pcUrl[ xUrlParser.field_data[ UF_HOST ].off ];
}
}
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 V202111.00
* 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 V202111.00
* 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 V202111.00
* 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 V202111.00
* 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.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_ret(&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_ret(&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_ret(&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 V202111.00
* 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 V202111.00
* 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 V202111.00
* 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 V202111.00
* 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,210 @@
/*
* FreeRTOS V202111.00
* 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 FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* http://www.freertos.org/a00110.html
*
* The bottom of this file contains some constants specific to running the UDP
* stack in this demo. Constants specific to FreeRTOS+TCP itself (rather than
* the demo) are contained in FreeRTOSIPConfig.h.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configMAX_PRIORITIES ( 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Event group related definitions. */
#define configUSE_EVENT_GROUPS 1
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_pcTaskGetTaskName 1
/* This demo makes use of one or more example stats formatting functions. These
* format the raw data provided by the uxTaskGetSystemState() function in to human
* readable ASCII form. See the notes in the implementation of vTaskList() within
* FreeRTOS/Source/tasks.c for limitations. configUSE_STATS_FORMATTING_FUNCTIONS
* is set to 2 so the formatting functions are included without the stdio.h being
* included in tasks.c. That is because this project defines its own sprintf()
* functions. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
/* Assert call defined for debug builds. */
#ifdef _DEBUG
extern void vAssertCalled( const char * pcFile,
uint32_t ulLine );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#endif /* _DEBUG */
/* Application specific definitions follow. **********************************/
/* Only used when running in the FreeRTOS Windows simulator. Defines the
* priority of the task used to simulate Ethernet interrupts. */
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
/* This demo creates a virtual network connection by accessing the raw Ethernet
* or WiFi data to and from a real network connection. Many computers have more
* than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
* the demo which real port should be used to create the virtual port. The ports
* available are displayed on the console when the application is executed. For
* example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
* results in the wired network being used, while setting
* configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
* used. */
#define configNETWORK_INTERFACE_TO_USE ( 5L )
/* The address to which logging is sent should UDP logging be enabled. */
#define configUDP_LOGGING_ADDR0 192
#define configUDP_LOGGING_ADDR1 168
#define configUDP_LOGGING_ADDR2 0
#define configUDP_LOGGING_ADDR3 11
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet/WiFi data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition above for information on how to
* configure the real network connection to use. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x11
#define configMAC_ADDR2 0x11
#define configMAC_ADDR3 0x11
#define configMAC_ADDR4 0x11
#define configMAC_ADDR5 0x41
/* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configIP_ADDR0 10
#define configIP_ADDR1 10
#define configIP_ADDR2 10
#define configIP_ADDR3 200
/* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to
* 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configGATEWAY_ADDR0 10
#define configGATEWAY_ADDR1 10
#define configGATEWAY_ADDR2 10
#define configGATEWAY_ADDR3 1
/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
* 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set
* to 1 but a DNS server cannot be contacted.*/
#define configDNS_SERVER_ADDR0 208
#define configDNS_SERVER_ADDR1 67
#define configDNS_SERVER_ADDR2 222
#define configDNS_SERVER_ADDR3 222
/* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configNET_MASK0 255
#define configNET_MASK1 0
#define configNET_MASK2 0
#define configNET_MASK3 0
/* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 )
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/* Visual studio does not have an implementation of strcasecmp(). */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strcmpi _strcmpi
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
#define configPRINTF( X ) vLoggingPrintf X
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,310 @@
/*
* FreeRTOS V202111.00
* 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 the following URL for configuration information.
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html
*
*****************************************************************************/
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
* 1 then FreeRTOS_debug_printf should be defined to the function used to print
* out the debugging messages. */
#define ipconfigHAS_DEBUG_PRINTF 0
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
#define FreeRTOS_debug_printf( X ) vLoggingPrintf X
#endif
/* Set to 1 to print out non debugging messages, for example the output of the
* FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
* then FreeRTOS_printf should be set to the function used to print out the
* messages. */
#define ipconfigHAS_PRINTF 1
#if ( ipconfigHAS_PRINTF == 1 )
#define FreeRTOS_printf( X ) vLoggingPrintf X
#endif
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
/* If the network card/driver includes checksum offloading (IP/TCP/UDP checksums)
* then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1 to prevent the software
* stack repeating the checksum calculations. */
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
/* Several API's will block until the result is known, or the action has been
* performed, for example FreeRTOS_send() and FreeRTOS_recv(). The timeouts can be
* set per socket, using setsockopt(). If not set, the times below will be
* used as defaults. */
#define ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME ( 2000 )
#define ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME ( 5000 )
/* Include support for LLMNR: Link-local Multicast Name Resolution
* (non-Microsoft) */
#define ipconfigUSE_LLMNR ( 0 )
/* Include support for NBNS: NetBIOS Name Service (Microsoft) */
#define ipconfigUSE_NBNS ( 0 )
/* Include support for DNS caching. For TCP, having a small DNS cache is very
* useful. When a cache is present, ipconfigDNS_REQUEST_ATTEMPTS can be kept low
* and also DNS may use small timeouts. If a DNS reply comes in after the DNS
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket. */
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 64 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
/* The IP stack executes it its own task (although any application task can make
* use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY
* sets the priority of the task that executes the IP stack. The priority is a
* standard FreeRTOS task priority so can take any value from 0 (the lowest
* priority) to (configMAX_PRIORITIES - 1) (the highest priority).
* configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in
* FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to
* the priority assigned to the task executing the IP stack relative to the
* priority assigned to tasks that use the IP stack. */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+TCP
* task. This setting is less important when the FreeRTOS Win32 simulator is used
* as the Win32 simulator only stores a fixed amount of information on the task
* stack. FreeRTOS includes optional stack overflow detection, see:
* http://www.freertos.org/Stacks-and-stack-overflow-checking.html */
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 5 )
/* ipconfigRAND32() is called by the IP stack to generate random numbers for
* things such as a DHCP transaction number or initial sequence number. Random
* number generation is performed via this macro to allow applications to use their
* own random number generation method. For example, it might be possible to
* generate a random number by sampling noise on an analogue input. */
extern UBaseType_t uxRand();
#define ipconfigRAND32() uxRand()
/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the
* network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK
* is not set to 1 then the network event hook will never be called. See
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml
*/
#define ipconfigUSE_NETWORK_EVENT_HOOK 1
/* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but
* a network buffer cannot be obtained then the calling task is held in the Blocked
* state (so other tasks can continue to executed) until either a network buffer
* becomes available or the send block time expires. If the send block time expires
* then the send operation is aborted. The maximum allowable send block time is
* capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the
* maximum allowable send block time prevents a deadlock occurring when
* all the network buffers are in use and the tasks that process (and subsequently
* free) the network buffers are themselves blocked waiting for a network buffer.
* ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
* milliseconds can be converted to a time in ticks by dividing the time in
* milliseconds by portTICK_PERIOD_MS. */
#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000 / portTICK_PERIOD_MS )
/* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP
* address, netmask, DNS server address and gateway address from a DHCP server. If
* ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will use a static IP address. The
* stack will revert to using the static IP address even when ipconfigUSE_DHCP is
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
* and accepted, or the interval between transmissions reaches
* ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the
* static IP address passed as a parameter to FreeRTOS_IPInit() if the
* re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without
* a DHCP reply being received. */
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_PERIOD_MS )
/* The ARP cache is a table that maps IP addresses to MAC addresses. The IP
* stack can only send a UDP message to a remove IP address if it knowns the MAC
* address associated with the IP address, or the MAC address of the router used to
* contact the remote IP address. When a UDP message is received from a remote IP
* address the MAC address and IP address are added to the ARP cache. When a UDP
* message is sent to a remote IP address that does not already appear in the ARP
* cache then the UDP message is replaced by a ARP message that solicits the
* required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum
* number of entries that can exist in the ARP table at any one time. */
#define ipconfigARP_CACHE_ENTRIES 6
/* ARP requests that do not result in an ARP response will be re-transmitted a
* maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is
* aborted. */
#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )
/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP
* table being created or refreshed and the entry being removed because it is stale.
* New ARP requests are sent for ARP cache entries that are nearing their maximum
* age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is
* equal to 1500 seconds (or 25 minutes). */
#define ipconfigMAX_ARP_AGE 150
/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling
* routines, which are relatively large. To save code space the full
* FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster
* alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr()
* takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.
* FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets
* (for example, 192, 168, 0, 1) as its parameters. If
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
#define ipconfigINCLUDE_FULL_INET_ADDR 1
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
* to ensure the total amount of RAM that can be consumed by the IP stack is capped
* to a pre-determinable value. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
/* A FreeRTOS queue is used to send events from application tasks to the IP
* stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can
* be queued for processing at any one time. The event queue must be a minimum of
* 5 greater than the total number of network buffers. */
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )
/* The address of a socket is the combination of its IP address and its port
* number. FreeRTOS_bind() is used to manually allocate a port number to a socket
* (to 'bind' the socket to a port), but manual binding is not normally necessary
* for client sockets (those sockets that initiate outgoing connections rather than
* wait for incoming connections on a known port number). If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling
* FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP
* stack automatically binding the socket to a port number from the range
* socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()
* on a socket that has not yet been bound will result in the send operation being
* aborted. */
#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1
/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */
#define ipconfigUDP_TIME_TO_LIVE 128
#define ipconfigTCP_TIME_TO_LIVE 128 /* also defined in FreeRTOSIPConfigDefaults.h */
/* USE_TCP: Use TCP and all its features */
#define ipconfigUSE_TCP ( 1 )
/* Use the TCP socket wake context with a callback. */
#define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK_WITH_CONTEXT ( 1 )
/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 1 )
/* The MTU is the maximum number of bytes the payload of a network frame can
* contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1200
/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
#define ipconfigREPLY_TO_INCOMING_PINGS 1
/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the
* FreeRTOS_SendPingRequest() API function is available. */
#define ipconfigSUPPORT_OUTGOING_PINGS 0
/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()
* (and associated) API function is available. */
#define ipconfigSUPPORT_SELECT_FUNCTION 1
/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames
* that are not in Ethernet II format will be dropped. This option is included for
* potential future IP stack developments. */
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the
* responsibility of the Ethernet interface to filter out packets that are of no
* interest. If the Ethernet interface does not implement this functionality, then
* set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack
* perform the filtering instead (it is much less efficient for the stack to do it
* because the packet will already have been passed into the stack). If the
* Ethernet driver does all the necessary filtering in hardware then software
* filtering can be removed by using a value other than 1 or 0. */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
/* The windows simulator cannot really simulate MAC interrupts, and needs to
* block occasionally to allow other tasks to run. */
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS )
/* Advanced only: in order to access 32-bit fields in the IP packets with
* 32-bit memory instructions, all packets will be stored 32-bit-aligned, plus 16-bits.
* This has to do with the contents of the IP-packets: all 32-bit fields are
* 32-bit-aligned, plus 16-bit(!) */
#define ipconfigPACKET_FILLER_SIZE 2
/* Define the size of the pool of TCP window descriptors. On the average, each
* TCP socket will use up to 2 x 6 descriptors, meaning that it can have 2 x 6
* outstanding packets (for Rx and Tx). When using up to 10 TP sockets
* simultaneously, one could define TCP_WIN_SEG_COUNT as 120. */
#define ipconfigTCP_WIN_SEG_COUNT 240
/* Each TCP socket has a circular buffers for Rx and Tx, which have a fixed
* maximum size. Define the size of Rx buffer for TCP sockets. */
#define ipconfigTCP_RX_BUFFER_LENGTH ( 5000 )
/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )
/* When using call-back handlers, the driver may check if the handler points to
* real program memory (RAM or flash) or just has a random non-zero value. */
#define ipconfigIS_VALID_PROG_ADDRESS( x ) ( ( x ) != NULL )
/* Include support for TCP hang protection. All sockets in a connecting or
* disconnecting stage will timeout after a period of non-activity. */
#define ipconfigTCP_HANG_PROTECTION ( 1 )
#define ipconfigTCP_HANG_PROTECTION_TIME ( 30 )
/* Include support for TCP keep-alive messages. */
#define ipconfigTCP_KEEP_ALIVE ( 1 )
#define ipconfigTCP_KEEP_ALIVE_INTERVAL ( 20 ) /* in seconds */
#define portINLINE __inline
#endif /* FREERTOS_IP_CONFIG_H */

View File

@ -0,0 +1,678 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging;..\..\..\Common\WinPCap;..\..\..\..\..\FreeRTOS\Source\include;..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp;..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls;..\..\..\..\Source\Utilities\mbedtls_freertos;..\..\..\..\..\Source\mbedtls_utils;..\..\..\..\ThirdParty\mbedtls\include;..\..\..\..\Source\AWS\jobs\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Ota_Over_Http_Demo;..\..\..\..\..\FreeRTOS-Plus\Demo\Common\coreMQTT_Agent_Interface\include;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\include;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\subscription-manager;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\portable\os;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\Ota_PAL\Win32;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src;..\..\..\..\Source\Application-Protocols\coreHTTP\source\include;..\..\..\..\..\FreeRTOS-Plus\Source\Application-Protocols\coreHTTP\source\dependency\3rdparty\http_parser;..\..\..\..\..\\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\Ota_PAL\Win32\Code_Signature_Verification;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\HTTP_Utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/wd4210 /wd4127 /wd4214 /wd4201 /wd4244 /wd4310 /wd4200 %(AdditionalOptions)</AdditionalOptions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Common\WinPCap</AdditionalLibraryDirectories>
<Profile>false</Profile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\..\..\Source\include;..\..\..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\core_http_client.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\dependency\3rdparty\http_parser\http_parser.c" />
<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\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder_close_container_checked.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborerrorstrings.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser_dup_string.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty_stdio.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborvalidation.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\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.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\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.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="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\dependency\3rdparty\http_parser\http_parser.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\include\core_http_client.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\include\core_http_client_private.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreHTTP\source\include\core_http_config_defaults.h" />
<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_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cbor.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborinternal_p.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborjson.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\compilersupport_p.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\tinycbor-version.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\utf8_p.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\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.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\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.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_http_config.h" />
<ClInclude Include="mbedtls_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="core_mqtt_config.h" />
<ClInclude Include="ota_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,57 @@
/*
* FreeRTOS V202111.00
* 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_HTTP_CONFIG_H_
#define CORE_HTTP_CONFIG_H_
/**************************************************/
/******* DO NOT CHANGE the following order ********/
/**************************************************/
/* Logging config definition and header files inclusion are required 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 HTTP.
* 3. Include the header file "logging_stack.h", if logging is enabled for HTTP.
*/
#include "logging_levels.h"
/* Logging configuration for the HTTP library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "HTTP"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
#endif /* ifndef CORE_HTTP_CONFIG_H_ */

View File

@ -0,0 +1,109 @@
/*
* FreeRTOS V202111.00
* 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,187 @@
/*
* FreeRTOS V202111.00
* 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 core_pkcs11_config.h
* @brief PCKS#11 config options.
*/
#ifndef _CORE_PKCS11_CONFIG_H_
#define _CORE_PKCS11_CONFIG_H_
#include "FreeRTOS.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 PKCS #11.
* 3. Include the header file "logging_stack.h", if logging is enabled for PKCS #11.
*/
#include "logging_levels.h"
/* Logging configuration for the PKCS #11 library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "PKCS11"
#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"
/**
* @brief Malloc API used by core_pkcs11.h
*/
#define PKCS11_MALLOC pvPortMalloc
/**
* @brief Free API used by core_pkcs11.h
*/
#define PKCS11_FREE vPortFree
/**
* @brief PKCS #11 default user PIN.
*
* The PKCS #11 standard specifies the presence of a user PIN. That feature is
* sensible for applications that have an interactive user interface and memory
* protections. However, since typical microcontroller applications lack one or
* both of those, the user PIN is assumed to be used herein for interoperability
* purposes only, and not as a security feature.
*
* Note: Do not cast this to a pointer! The library calls sizeof to get the length
* of this string.
*/
#define configPKCS11_DEFAULT_USER_PIN "0000"
/**
* @brief Maximum length (in characters) for a PKCS #11 CKA_LABEL
* attribute.
*/
#define pkcs11configMAX_LABEL_LENGTH 32
/**
* @brief Maximum number of token objects that can be stored
* by the PKCS #11 module.
*/
#define pkcs11configMAX_NUM_OBJECTS 6
/**
* @brief Maximum number of sessions that can be stored
* by the PKCS #11 module.
*/
#define pkcs11configMAX_SESSIONS 10
/**
* @brief Set to 1 if a PAL destroy object is implemented.
*
* If set to 0, no PAL destroy object is implemented, and this functionality
* is implemented in the common PKCS #11 layer.
*/
#define pkcs11configPAL_DESTROY_SUPPORTED 0
/**
* @brief Set to 1 if OTA image verification via PKCS #11 module is supported.
*
* If set to 0, OTA code signing certificate is built in via
* aws_ota_codesigner_certificate.h.
*/
#define pkcs11configOTA_SUPPORTED 0
/**
* @brief Set to 1 if PAL supports storage for JITP certificate,
* code verify certificate, and trusted server root certificate.
*
* If set to 0, PAL does not support storage mechanism for these, and
* they are accessed via headers compiled into the code.
*/
#define pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED 0
/**
* @brief The PKCS #11 label for device private key.
*
* Private key for connection to AWS IoT endpoint. The corresponding
* public key should be registered with the AWS IoT endpoint.
*/
#define pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS "Device Priv TLS Key"
/**
* @brief The PKCS #11 label for device public key.
*
* The public key corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
*/
#define pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS "Device Pub TLS Key"
/**
* @brief The PKCS #11 label for the device certificate.
*
* Device certificate corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
*/
#define pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS "Device Cert"
/**
* @brief The PKCS #11 label for the object to be used for code verification.
*
* Used by over-the-air update code to verify an incoming signed image.
*/
#define pkcs11configLABEL_CODE_VERIFICATION_KEY "Code Verify Key"
/**
* @brief The PKCS #11 label for Just-In-Time-Provisioning.
*
* The certificate corresponding to the issuer of the device certificate
* (pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS) when using the JITR or
* JITP flow.
*/
#define pkcs11configLABEL_JITP_CERTIFICATE "JITP Cert"
/**
* @brief The PKCS #11 label for the AWS Trusted Root Certificate.
*
* @see aws_default_root_certificates.h
*/
#define pkcs11configLABEL_ROOT_CERTIFICATE "Root Cert"
#endif /* _CORE_PKCS11_CONFIG_H_ */

View File

@ -0,0 +1,464 @@
/*
* FreeRTOS V202111.00
* 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 Baltimore Cybertrust 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" \
"MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ\n" \
"RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD\n" \
"VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX\n" \
"DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y\n" \
"ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy\n" \
"VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr\n" \
"mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr\n" \
"IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK\n" \
"mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu\n" \
"XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy\n" \
"dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye\n" \
"jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1\n" \
"BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3\n" \
"DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92\n" \
"9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx\n" \
"jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0\n" \
"Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz\n" \
"ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\n" \
"R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\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
/**********************************************************************************
* Error checks and derived values only below here - do not edit below here. -----*
**********************************************************************************/
/* Compile time error for some undefined configs, and provide default values
* for others. */
#ifndef democonfigMQTT_BROKER_ENDPOINT
#error "Please define democonfigMQTT_BROKER_ENDPOINT in demo_config.h."
#endif
#ifndef democonfigCLIENT_IDENTIFIER
/**
* @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. Using a #define is for convenience
* of demonstration only - production devices should use something unique to the
* device that can be read from software - such as a production serial number.
*/
#error "Please define democonfigCLIENT_IDENTIFIER in demo_config.h to something unique for this device."
#endif
#if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 )
#ifndef democonfigROOT_CA_PEM
#error "Please define Root CA certificate of the MQTT broker(democonfigROOT_CA_PEM) in demo_config.h."
#endif
/* If no username is defined, then a client certificate/key is required. */
#ifndef democonfigCLIENT_USERNAME
/*
*!!! Please note democonfigCLIENT_PRIVATE_KEY_PEM in used for
*!!! convenience of demonstration only. Production devices should
*!!! store keys securely, such as within a secure element.
*/
#ifndef democonfigCLIENT_CERTIFICATE_PEM
#error "Please define client certificate(democonfigCLIENT_CERTIFICATE_PEM) in demo_config.h."
#endif
#ifndef democonfigCLIENT_PRIVATE_KEY_PEM
#error "Please define client private key(democonfigCLIENT_PRIVATE_KEY_PEM) in demo_config.h."
#endif
#else
/* If a username is defined, a client password also would need to be defined for
* client authentication. */
#ifndef democonfigCLIENT_PASSWORD
#error "Please define client password(democonfigCLIENT_PASSWORD) in demo_config.h for client authentication based on username/password."
#endif
/* AWS IoT MQTT broker port needs to be 443 for client authentication based on
* username/password. */
#if defined( democonfigUSE_AWS_IOT_CORE_BROKER ) && democonfigMQTT_BROKER_PORT != 443
#error "Broker port(democonfigMQTT_BROKER_PORT) should be defined as 443 in demo_config.h for client authentication based on username/password in AWS IoT Core."
#endif
#endif /* ifndef democonfigCLIENT_USERNAME */
#ifndef democonfigMQTT_BROKER_PORT
#define democonfigMQTT_BROKER_PORT ( 8883 )
#endif
#else /* if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 ) */
#ifndef democonfigMQTT_BROKER_PORT
#define democonfigMQTT_BROKER_PORT ( 1883 )
#endif
#endif /* if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 ) */
/**
* @brief ALPN (Application-Layer Protocol Negotiation) protocol name for AWS IoT MQTT.
*
* This will be used if democonfigMQTT_BROKER_PORT is configured as 443 for the AWS IoT MQTT broker.
* Please see more details about the ALPN protocol for AWS IoT MQTT endpoint
* in the link below.
* https://aws.amazon.com/blogs/iot/mqtt-with-tls-client-authentication-on-port-443-why-it-is-useful-and-how-it-works/
*/
#define AWS_IOT_MQTT_ALPN "\x0ex-amzn-mqtt-ca"
/**
* @brief This is the ALPN (Application-Layer Protocol Negotiation) string
* required by AWS IoT for password-based authentication using TCP port 443.
*/
#define AWS_IOT_CUSTOM_AUTH_ALPN "\x04mqtt"
/**
* Provide default values for undefined configuration settings.
*/
#ifndef democonfigOS_NAME
#define democonfigOS_NAME "FreeRTOS"
#endif
#ifndef democonfigOS_VERSION
#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER
#endif
#ifndef democonfigHARDWARE_PLATFORM_NAME
#define democonfigHARDWARE_PLATFORM_NAME "WinSim"
#endif
#ifndef democonfigMQTT_LIB
#define democonfigMQTT_LIB "core-mqtt@1.0.0"
#endif
/**
* @brief The MQTT metrics string expected by AWS IoT.
*/
#define AWS_IOT_METRICS_STRING \
"?SDK=" democonfigOS_NAME "&Version=" democonfigOS_VERSION \
"&Platform=" democonfigHARDWARE_PLATFORM_NAME "&MQTTLib=" democonfigMQTT_LIB
/**
* @brief The length of the MQTT metrics string expected by AWS IoT.
*/
#define AWS_IOT_METRICS_STRING_LENGTH ( ( uint16_t ) ( sizeof( AWS_IOT_METRICS_STRING ) - 1 ) )
#ifdef democonfigCLIENT_USERNAME
/**
* @brief Append the username with the metrics string if #democonfigCLIENT_USERNAME is defined.
*
* This is to support both metrics reporting and username/password based client
* authentication by AWS IoT.
*/
#define CLIENT_USERNAME_WITH_METRICS democonfigCLIENT_USERNAME AWS_IOT_METRICS_STRING
#endif
/**
* @brief Length of client identifier.
*/
#define democonfigCLIENT_IDENTIFIER_LENGTH ( ( uint16_t ) ( sizeof( democonfigCLIENT_IDENTIFIER ) - 1 ) )
/**
* @brief Length of MQTT server host name.
*/
#define democonfigBROKER_ENDPOINT_LENGTH ( ( uint16_t ) ( sizeof( democonfigMQTT_BROKER_ENDPOINT ) - 1 ) )
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,375 @@
/*
* FreeRTOS V202111.00
* 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>
/* Visual studio intrinsics used so the __debugbreak() function is available
* should an assert get hit. */
#include <intrin.h>
/* FreeRTOS includes. */
#include <FreeRTOS.h>
#include "task.h"
/* TCP/IP stack includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*
* Prototypes for the demos that can be started from this project. Note the
* Ota demo is not actually started until the network is already, which is
* indicated by vApplicationIPNetworkEventHook() executing - hence
* vStartOtaDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartOtaDemo( void );
/*
* Just seeds the simple pseudo random number generator.
*
* !!! NOTE !!!
* This is not a secure method of generating random numbers and production
* devices should use a true random number generator (TRNG).
*/
static void prvSRand( UBaseType_t ulSeed );
/*
* Miscellaneous initialization including preparing the logging and seeding the
* random number generator.
*/
static void prvMiscInitialisation( void );
/* The default IP and MAC address used by the demo. The address configuration
* defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is
* 1 but a DHCP server could not be contacted. See the online documentation for
* more information. */
static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };
static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };
static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };
static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };
/* Set the following constant to pdTRUE to log using the method indicated by the
* name of the constant, or pdFALSE to not log using the method indicated by the
* name of the constant. Options include to standard out (xLogToStdout), to a disk
* file (xLogToFile), and to a UDP port (xLogToUDP). If xLogToUDP is set to pdTRUE
* then UDP messages are sent to the IP address configured as the UDP logging server
* address (see the configUDP_LOGGING_ADDR0 definitions in FreeRTOSConfig.h) and
* the port number set by configPRINT_PORT in FreeRTOSConfig.h. */
const BaseType_t xLogToStdout = pdTRUE, xLogToFile = pdFALSE, xLogToUDP = pdFALSE;
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition for information on how to configure
* the real network connection to use. */
const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
/* Used by the pseudo random number generator. */
static UBaseType_t ulNextRand;
/*-----------------------------------------------------------*/
int main( void )
{
/* Miscellaneous initialization including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
/* Initialize the network interface.
*
***NOTE*** Tasks that use the network are created in the network event hook
* when the network is connected and ready for use (see the implementation of
* vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* 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 (this is standard text that is not
* really applicable to the Win32 simulator port). */
for( ; ; )
{
__debugbreak();
}
}
/*-----------------------------------------------------------*/
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
* events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
static BaseType_t xTasksAlreadyCreated = pdFALSE;
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
/* Create the tasks that use the IP stack if they have not already been
* created. */
if( xTasksAlreadyCreated == pdFALSE )
{
/* Demos that use the network are created after the network is
* up. */
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );
vStartOtaDemo();
xTasksAlreadyCreated = pdTRUE;
}
/* Print out the network configuration, which may have come from a DHCP
* server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
LogInfo( ( "\r\n\r\nIP Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer );
LogInfo( ( "Subnet Mask: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );
LogInfo( ( "Gateway Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );
LogInfo( ( "DNS Server Address: %s\r\n\r\n\r\n", cBuffer ) );
}
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile,
uint32_t ulLine )
{
volatile uint32_t ulBlockVariable = 0UL;
volatile char * pcFileName = ( volatile char * ) pcFile;
volatile uint32_t ulLineNumber = ulLine;
( void ) pcFileName;
( void ) ulLineNumber;
printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */
taskDISABLE_INTERRUPTS();
{
while( ulBlockVariable == 0UL )
{
__debugbreak();
}
}
taskENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
UBaseType_t uxRand( void )
{
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/*
* Utility function to generate a pseudo random number.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
}
/*-----------------------------------------------------------*/
static void prvSRand( UBaseType_t ulSeed )
{
/* Utility function to seed the pseudo random number generator. */
ulNextRand = ulSeed;
}
/*-----------------------------------------------------------*/
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
/*
* Seed random number generator.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
}
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
const char * pcApplicationHostnameHook( void )
{
/* Assign the name "FreeRTOS" to this network node. This function will
* be called during the DHCP: the machine will be registered with an IP
* address plus this name. */
return mainHOST_NAME;
}
#endif
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 )
BaseType_t xApplicationDNSQueryHook( const char * pcName )
{
BaseType_t xReturn;
/* Determine if a name lookup is for this node. Two names are given
* to this node: that returned by pcApplicationHostnameHook() and that set
* by mainDEVICE_NICK_NAME. */
if( _stricmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( _stricmp( pcName, mainDEVICE_NICK_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) */
/*-----------------------------------------------------------*/
/*
* Callback that provides the inputs necessary to generate a randomized TCP
* Initial Sequence Number per RFC 6528. THIS IS ONLY A DUMMY IMPLEMENTATION
* THAT RETURNS A PSEUDO RANDOM NUMBER SO IS NOT INTENDED FOR USE IN PRODUCTION
* SYSTEMS.
*/
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
{
( void ) ulSourceAddress;
( void ) usSourcePort;
( void ) ulDestinationAddress;
( void ) usDestinationPort;
return uxRand();
}
/*-----------------------------------------------------------*/
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.
*/
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
* implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
* used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
* state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
* application must provide an implementation of vApplicationGetTimerTaskMemory()
* to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
uint32_t * pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
* task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,140 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/* This file configures mbed TLS for FreeRTOS. */
#ifndef MBEDTLS_CONFIG_H_
#define MBEDTLS_CONFIG_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Generate errors if deprecated functions are used. */
#define MBEDTLS_DEPRECATED_REMOVED
/* Place AES tables in ROM. */
#define MBEDTLS_AES_ROM_TABLES
/* Enable the following cipher modes. */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CFB
#define MBEDTLS_CIPHER_MODE_CTR
/* Enable the following cipher padding modes. */
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
#define MBEDTLS_CIPHER_PADDING_ZEROS
/* Cipher suite configuration. */
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/* Enable all SSL alert messages. */
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/* Enable the following SSL features. */
#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_ALPN
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/* Check certificate key usage. */
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
#define MBEDTLS_X509_CREATE_C
#define MBEDTLS_PK_WRITE_C
#define MBEDTLS_X509_CSR_WRITE_C
/* Disable platform entropy functions. */
#define MBEDTLS_NO_PLATFORM_ENTROPY
/* Enable the following mbed TLS features. */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_GCM_C
#define MBEDTLS_MD_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_THREADING_ALT
#define MBEDTLS_THREADING_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
/* Set the memory allocation functions on FreeRTOS. */
void * mbedtls_platform_calloc( size_t nmemb,
size_t size );
void mbedtls_platform_free( void * ptr );
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
/* The network send and receive functions on FreeRTOS. */
int mbedtls_platform_send( void * ctx,
const unsigned char * buf,
size_t len );
int mbedtls_platform_recv( void * ctx,
unsigned char * buf,
size_t len );
/* These two macro used by mbedtls_ssl_set_bio in using_mbedtls network
* transport layer. */
#define MBEDTLS_SSL_SEND mbedtls_platform_send
#define MBEDTLS_SSL_RECV mbedtls_platform_recv
/* The entropy poll function. */
int mbedtls_platform_entropy_poll( void * data,
unsigned char * output,
size_t len,
size_t * olen );
#include "mbedtls/check_config.h"
#endif /* ifndef MBEDTLS_CONFIG_H_ */

View File

@ -0,0 +1,200 @@
/*
* FreeRTOS V202111.00
* 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,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {150F08BF-9D61-4CC2-8DBF-1335172A1EA4}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FreeRTOS_Plus_TCP_Minimal.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,210 @@
/*
* FreeRTOS V202111.00
* 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 FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* http://www.freertos.org/a00110.html
*
* The bottom of this file contains some constants specific to running the UDP
* stack in this demo. Constants specific to FreeRTOS+TCP itself (rather than
* the demo) are contained in FreeRTOSIPConfig.h.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configMAX_PRIORITIES ( 7 )
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048U * 1024U ) )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Event group related definitions. */
#define configUSE_EVENT_GROUPS 1
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_pcTaskGetTaskName 1
/* This demo makes use of one or more example stats formatting functions. These
* format the raw data provided by the uxTaskGetSystemState() function in to human
* readable ASCII form. See the notes in the implementation of vTaskList() within
* FreeRTOS/Source/tasks.c for limitations. configUSE_STATS_FORMATTING_FUNCTIONS
* is set to 2 so the formatting functions are included without the stdio.h being
* included in tasks.c. That is because this project defines its own sprintf()
* functions. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
/* Assert call defined for debug builds. */
#ifdef _DEBUG
extern void vAssertCalled( const char * pcFile,
uint32_t ulLine );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#endif /* _DEBUG */
/* Application specific definitions follow. **********************************/
/* Only used when running in the FreeRTOS Windows simulator. Defines the
* priority of the task used to simulate Ethernet interrupts. */
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
/* This demo creates a virtual network connection by accessing the raw Ethernet
* or WiFi data to and from a real network connection. Many computers have more
* than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
* the demo which real port should be used to create the virtual port. The ports
* available are displayed on the console when the application is executed. For
* example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
* results in the wired network being used, while setting
* configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
* used. */
#define configNETWORK_INTERFACE_TO_USE ( 0L )
/* The address to which logging is sent should UDP logging be enabled. */
#define configUDP_LOGGING_ADDR0 192
#define configUDP_LOGGING_ADDR1 168
#define configUDP_LOGGING_ADDR2 0
#define configUDP_LOGGING_ADDR3 11
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet/WiFi data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition above for information on how to
* configure the real network connection to use. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x11
#define configMAC_ADDR2 0x11
#define configMAC_ADDR3 0x11
#define configMAC_ADDR4 0x11
#define configMAC_ADDR5 0x41
/* Default IP address configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configIP_ADDR0 10
#define configIP_ADDR1 10
#define configIP_ADDR2 10
#define configIP_ADDR3 200
/* Default gateway IP address configuration. Used in ipconfigUSE_DNS is set to
* 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configGATEWAY_ADDR0 10
#define configGATEWAY_ADDR1 10
#define configGATEWAY_ADDR2 10
#define configGATEWAY_ADDR3 1
/* Default DNS server configuration. OpenDNS addresses are 208.67.222.222 and
* 208.67.220.220. Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set
* to 1 but a DNS server cannot be contacted.*/
#define configDNS_SERVER_ADDR0 208
#define configDNS_SERVER_ADDR1 67
#define configDNS_SERVER_ADDR2 222
#define configDNS_SERVER_ADDR3 222
/* Default netmask configuration. Used in ipconfigUSE_DNS is set to 0, or
* ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
#define configNET_MASK0 255
#define configNET_MASK1 0
#define configNET_MASK2 0
#define configNET_MASK3 0
/* The UDP port to which print messages are sent. */
#define configPRINT_PORT ( 15000 )
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )
/* Map to Windows names. */
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
/* Visual studio does not have an implementation of strcasecmp(). */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define strcmpi _strcmpi
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
#define configPRINTF( X ) vLoggingPrintf X
#endif /* FREERTOS_CONFIG_H */

View File

@ -0,0 +1,310 @@
/*
* FreeRTOS V202111.00
* 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 the following URL for configuration information.
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration.html
*
*****************************************************************************/
#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H
/* Prototype for the function used to print out. In this case it prints to the
* console before the network is connected then a UDP port after the network has
* connected. */
extern void vLoggingPrintf( const char * pcFormatString,
... );
/* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to
* 1 then FreeRTOS_debug_printf should be defined to the function used to print
* out the debugging messages. */
#define ipconfigHAS_DEBUG_PRINTF 0
#if ( ipconfigHAS_DEBUG_PRINTF == 1 )
#define FreeRTOS_debug_printf( X ) vLoggingPrintf X
#endif
/* Set to 1 to print out non debugging messages, for example the output of the
* FreeRTOS_netstat() command, and ping replies. If ipconfigHAS_PRINTF is set to 1
* then FreeRTOS_printf should be set to the function used to print out the
* messages. */
#define ipconfigHAS_PRINTF 1
#if ( ipconfigHAS_PRINTF == 1 )
#define FreeRTOS_printf( X ) vLoggingPrintf X
#endif
/* Define the byte order of the target MCU (the MCU FreeRTOS+TCP is executing
* on). Valid options are pdFREERTOS_BIG_ENDIAN and pdFREERTOS_LITTLE_ENDIAN. */
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
/* If the network card/driver includes checksum offloading (IP/TCP/UDP checksums)
* then set ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM to 1 to prevent the software
* stack repeating the checksum calculations. */
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1
/* Several API's will block until the result is known, or the action has been
* performed, for example FreeRTOS_send() and FreeRTOS_recv(). The timeouts can be
* set per socket, using setsockopt(). If not set, the times below will be
* used as defaults. */
#define ipconfigSOCK_DEFAULT_RECEIVE_BLOCK_TIME ( 2000 )
#define ipconfigSOCK_DEFAULT_SEND_BLOCK_TIME ( 5000 )
/* Include support for LLMNR: Link-local Multicast Name Resolution
* (non-Microsoft) */
#define ipconfigUSE_LLMNR ( 0 )
/* Include support for NBNS: NetBIOS Name Service (Microsoft) */
#define ipconfigUSE_NBNS ( 0 )
/* Include support for DNS caching. For TCP, having a small DNS cache is very
* useful. When a cache is present, ipconfigDNS_REQUEST_ATTEMPTS can be kept low
* and also DNS may use small timeouts. If a DNS reply comes in after the DNS
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket. */
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 64 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
/* The IP stack executes it its own task (although any application task can make
* use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY
* sets the priority of the task that executes the IP stack. The priority is a
* standard FreeRTOS task priority so can take any value from 0 (the lowest
* priority) to (configMAX_PRIORITIES - 1) (the highest priority).
* configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in
* FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to
* the priority assigned to the task executing the IP stack relative to the
* priority assigned to tasks that use the IP stack. */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+TCP
* task. This setting is less important when the FreeRTOS Win32 simulator is used
* as the Win32 simulator only stores a fixed amount of information on the task
* stack. FreeRTOS includes optional stack overflow detection, see:
* http://www.freertos.org/Stacks-and-stack-overflow-checking.html */
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 5 )
/* ipconfigRAND32() is called by the IP stack to generate random numbers for
* things such as a DHCP transaction number or initial sequence number. Random
* number generation is performed via this macro to allow applications to use their
* own random number generation method. For example, it might be possible to
* generate a random number by sampling noise on an analogue input. */
extern UBaseType_t uxRand();
#define ipconfigRAND32() uxRand()
/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the
* network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK
* is not set to 1 then the network event hook will never be called. See
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml
*/
#define ipconfigUSE_NETWORK_EVENT_HOOK 1
/* Sockets have a send block time attribute. If FreeRTOS_sendto() is called but
* a network buffer cannot be obtained then the calling task is held in the Blocked
* state (so other tasks can continue to executed) until either a network buffer
* becomes available or the send block time expires. If the send block time expires
* then the send operation is aborted. The maximum allowable send block time is
* capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS. Capping the
* maximum allowable send block time prevents a deadlock occurring when
* all the network buffers are in use and the tasks that process (and subsequently
* free) the network buffers are themselves blocked waiting for a network buffer.
* ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
* milliseconds can be converted to a time in ticks by dividing the time in
* milliseconds by portTICK_PERIOD_MS. */
#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000 / portTICK_PERIOD_MS )
/* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP
* address, netmask, DNS server address and gateway address from a DHCP server. If
* ipconfigUSE_DHCP is 0 then FreeRTOS+TCP will use a static IP address. The
* stack will revert to using the static IP address even when ipconfigUSE_DHCP is
* set to 1 if a valid configuration cannot be obtained from a DHCP server for any
* reason. The static configuration used is that passed into the stack by the
* FreeRTOS_IPInit() function call. */
#define ipconfigUSE_DHCP 1
/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at
* increasing time intervals until either a reply is received from a DHCP server
* and accepted, or the interval between transmissions reaches
* ipconfigMAXIMUM_DISCOVER_TX_PERIOD. The IP stack will revert to using the
* static IP address passed as a parameter to FreeRTOS_IPInit() if the
* re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without
* a DHCP reply being received. */
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 120000 / portTICK_PERIOD_MS )
/* The ARP cache is a table that maps IP addresses to MAC addresses. The IP
* stack can only send a UDP message to a remove IP address if it knowns the MAC
* address associated with the IP address, or the MAC address of the router used to
* contact the remote IP address. When a UDP message is received from a remote IP
* address the MAC address and IP address are added to the ARP cache. When a UDP
* message is sent to a remote IP address that does not already appear in the ARP
* cache then the UDP message is replaced by a ARP message that solicits the
* required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum
* number of entries that can exist in the ARP table at any one time. */
#define ipconfigARP_CACHE_ENTRIES 6
/* ARP requests that do not result in an ARP response will be re-transmitted a
* maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is
* aborted. */
#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )
/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP
* table being created or refreshed and the entry being removed because it is stale.
* New ARP requests are sent for ARP cache entries that are nearing their maximum
* age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is
* equal to 1500 seconds (or 25 minutes). */
#define ipconfigMAX_ARP_AGE 150
/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling
* routines, which are relatively large. To save code space the full
* FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster
* alternative called FreeRTOS_inet_addr_quick() is provided. FreeRTOS_inet_addr()
* takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.
* FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets
* (for example, 192, 168, 0, 1) as its parameters. If
* ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and
* FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is
* not set to 1 then only FreeRTOS_indet_addr_quick() is available. */
#define ipconfigINCLUDE_FULL_INET_ADDR 1
/* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that
* are available to the IP stack. The total number of network buffers is limited
* to ensure the total amount of RAM that can be consumed by the IP stack is capped
* to a pre-determinable value. */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
/* A FreeRTOS queue is used to send events from application tasks to the IP
* stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can
* be queued for processing at any one time. The event queue must be a minimum of
* 5 greater than the total number of network buffers. */
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )
/* The address of a socket is the combination of its IP address and its port
* number. FreeRTOS_bind() is used to manually allocate a port number to a socket
* (to 'bind' the socket to a port), but manual binding is not normally necessary
* for client sockets (those sockets that initiate outgoing connections rather than
* wait for incoming connections on a known port number). If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling
* FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP
* stack automatically binding the socket to a port number from the range
* socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff. If
* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()
* on a socket that has not yet been bound will result in the send operation being
* aborted. */
#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1
/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */
#define ipconfigUDP_TIME_TO_LIVE 128
#define ipconfigTCP_TIME_TO_LIVE 128 /* also defined in FreeRTOSIPConfigDefaults.h */
/* USE_TCP: Use TCP and all its features */
#define ipconfigUSE_TCP ( 1 )
/* Use the TCP socket wake context with a callback. */
#define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK_WITH_CONTEXT ( 1 )
/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 1 )
/* The MTU is the maximum number of bytes the payload of a network frame can
* contain. For normal Ethernet V2 frames the maximum MTU is 1500. Setting a
* lower value can save RAM, depending on the buffer management scheme used. If
* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must
* be divisible by 8. */
#define ipconfigNETWORK_MTU 1200
/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver. DNS is used
* through the FreeRTOS_gethostbyname() API function. */
#define ipconfigUSE_DNS 1
/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will
* generate replies to incoming ICMP echo (ping) requests. */
#define ipconfigREPLY_TO_INCOMING_PINGS 1
/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the
* FreeRTOS_SendPingRequest() API function is available. */
#define ipconfigSUPPORT_OUTGOING_PINGS 0
/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()
* (and associated) API function is available. */
#define ipconfigSUPPORT_SELECT_FUNCTION 1
/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames
* that are not in Ethernet II format will be dropped. This option is included for
* potential future IP stack developments. */
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the
* responsibility of the Ethernet interface to filter out packets that are of no
* interest. If the Ethernet interface does not implement this functionality, then
* set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack
* perform the filtering instead (it is much less efficient for the stack to do it
* because the packet will already have been passed into the stack). If the
* Ethernet driver does all the necessary filtering in hardware then software
* filtering can be removed by using a value other than 1 or 0. */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
/* The windows simulator cannot really simulate MAC interrupts, and needs to
* block occasionally to allow other tasks to run. */
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS )
/* Advanced only: in order to access 32-bit fields in the IP packets with
* 32-bit memory instructions, all packets will be stored 32-bit-aligned, plus 16-bits.
* This has to do with the contents of the IP-packets: all 32-bit fields are
* 32-bit-aligned, plus 16-bit(!) */
#define ipconfigPACKET_FILLER_SIZE 2
/* Define the size of the pool of TCP window descriptors. On the average, each
* TCP socket will use up to 2 x 6 descriptors, meaning that it can have 2 x 6
* outstanding packets (for Rx and Tx). When using up to 10 TP sockets
* simultaneously, one could define TCP_WIN_SEG_COUNT as 120. */
#define ipconfigTCP_WIN_SEG_COUNT 240
/* Each TCP socket has a circular buffers for Rx and Tx, which have a fixed
* maximum size. Define the size of Rx buffer for TCP sockets. */
#define ipconfigTCP_RX_BUFFER_LENGTH ( 5000 )
/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )
/* When using call-back handlers, the driver may check if the handler points to
* real program memory (RAM or flash) or just has a random non-zero value. */
#define ipconfigIS_VALID_PROG_ADDRESS( x ) ( ( x ) != NULL )
/* Include support for TCP hang protection. All sockets in a connecting or
* disconnecting stage will timeout after a period of non-activity. */
#define ipconfigTCP_HANG_PROTECTION ( 1 )
#define ipconfigTCP_HANG_PROTECTION_TIME ( 30 )
/* Include support for TCP keep-alive messages. */
#define ipconfigTCP_KEEP_ALIVE ( 1 )
#define ipconfigTCP_KEEP_ALIVE_INTERVAL ( 20 ) /* in seconds */
#define portINLINE __inline
#endif /* FREERTOS_IP_CONFIG_H */

View File

@ -0,0 +1,670 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging;..\..\..\Common\WinPCap;..\..\..\..\..\FreeRTOS\Source\include;..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\..\Source\Application-Protocols\coreMQTT\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface;..\..\..\..\Source\Utilities\backoff_algorithm\source\include;..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp;..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls;..\..\..\..\Source\Utilities\mbedtls_freertos;..\..\..\..\..\Source\mbedtls_utils;..\..\..\..\ThirdParty\mbedtls\include;..\..\..\..\Source\AWS\jobs\source\include;..\..\..\..\Source\coreJSON\source\include;..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Ota_Over_Mqtt_Demo;..\..\..\..\..\FreeRTOS-Plus\Demo\Common\coreMQTT_Agent_Interface\include;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\include;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\subscription-manager;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\portable\os;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\Ota_PAL\Win32;..\..\..\..\..\FreeRTOS-Plus\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src;..\..\..\..\..\FreeRTOS-Plus\Demo\AWS\Ota_Windows_Simulator\Common\Ota_PAL\Win32\Code_Signature_Verification;..\..\..\..\..\FreeRTOS-Plus\Source\Application-Protocols\coreMQTT-Agent\source\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/wd4210 /wd4127 /wd4214 /wd4201 /wd4244 /wd4310 /wd4200 %(AdditionalOptions)</AdditionalOptions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<ExceptionHandling>false</ExceptionHandling>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\Common\WinPCap</AdditionalLibraryDirectories>
<Profile>false</Profile>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\..\..\Source\include;..\..\..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>
<AdditionalDependencies>wpcap.lib;Bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />
<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\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder_close_container_checked.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborerrorstrings.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser_dup_string.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty_stdio.c" />
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborvalidation.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\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.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\coreMQTT\source\core_mqtt.c" />
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c" />
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TurnOffAllWarnings</WarningLevel>
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TurnOffAllWarnings</WarningLevel>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.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="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h" />
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h" />
<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_config_defaults.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cbor.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborinternal_p.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborjson.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\compilersupport_p.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\tinycbor-version.h" />
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\utf8_p.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\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h" />
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.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\include\core_mqtt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.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_pkcs11_config.h" />
<ClInclude Include="mbedtls_config.h" />
<ClInclude Include="demo_config.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="core_mqtt_config.h" />
<ClInclude Include="ota_config.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,992 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="FreeRTOS">
<UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source">
<UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>
<Extensions>*.c</Extensions>
</Filter>
<Filter Include="FreeRTOS\Source\Portable">
<UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+">
<UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS\Source\include">
<UniqueIdentifier>{d2dcd641-8d91-492b-852f-5563ffadaec6}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP">
<UniqueIdentifier>{8672fa26-b119-481f-8b8d-086419c01a3e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\portable">
<UniqueIdentifier>{4570be11-ec96-4b55-ac58-24b50ada980a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS+TCP\include">
<UniqueIdentifier>{5d93ed51-023a-41ad-9243-8d230165d34b}</UniqueIdentifier>
</Filter>
<Filter Include="DemoTasks">
<UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries">
<UniqueIdentifier>{60717407-397f-4ea5-8492-3314acdd25f0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard">
<UniqueIdentifier>{8a90222f-d723-4b4e-8e6e-c57afaf7fa92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT">
<UniqueIdentifier>{2d17d5e6-ed70-4e42-9693-f7a63baf4948}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include">
<UniqueIdentifier>{6ad56e6d-c330-4830-8f4b-c75b05dfa866}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform">
<UniqueIdentifier>{84613aa2-91dc-4e1a-a3b3-823b6d7bf0e0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls">
<UniqueIdentifier>{7bedd2e3-adbb-4c95-9632-445132b459ce}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\include">
<UniqueIdentifier>{07a14673-4d02-4780-a099-6b8c654dff91}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\mbedtls\library">
<UniqueIdentifier>{e875c5e3-40a2-4408-941e-5e1a951cc663}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls">
<UniqueIdentifier>{8a0aa896-6b3a-49b3-997e-681f0d1949ae}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{c5a01679-3e7a-4320-97ac-ee5b872c1650}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include">
<UniqueIdentifier>{c992824d-4198-46b2-8d59-5f99ab9946ab}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\transport">
<UniqueIdentifier>{6a35782c-bc09-42d5-a850-98bcb668a4dc}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON">
<UniqueIdentifier>{20aee693-d2dc-480e-ae21-0db2156e54ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS">
<UniqueIdentifier>{0dacb84e-5cc3-4eed-8fb1-68b6e4741f77}</UniqueIdentifier>
</Filter>
<Filter Include="Config">
<UniqueIdentifier>{d286fe5f-3c24-4a2f-881c-4b458623648d}</UniqueIdentifier>
</Filter>
<Filter Include="Logging">
<UniqueIdentifier>{c8b7bd64-7a0e-458b-bcaa-8081806e4508}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include">
<UniqueIdentifier>{6c6bc472-3f73-42c1-83e0-ffe6cae93393}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm">
<UniqueIdentifier>{fcf93295-15e2-4a84-a5e9-b3c162e9f061}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include">
<UniqueIdentifier>{7de8717e-b494-4eba-ba10-bc8252d9876a}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota">
<UniqueIdentifier>{3cce55b5-995f-476c-a3a5-9c659a977c89}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include">
<UniqueIdentifier>{d6ca6595-6585-4fd8-b0dd-224128fbd230}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent">
<UniqueIdentifier>{044f1490-9d76-41d8-9887-94f5e89cab11}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include">
<UniqueIdentifier>{28ef5930-f7c7-44f3-9189-749dcdf13cdd}</UniqueIdentifier>
</Filter>
<Filter Include="subscription-manager">
<UniqueIdentifier>{0025af31-a87a-438e-86fd-8048c9f98025}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\portable">
<UniqueIdentifier>{e7b017ae-316c-4d8b-b427-5df150109d0f}</UniqueIdentifier>
</Filter>
<Filter Include="otapal">
<UniqueIdentifier>{0d8ed7df-8ac2-4ac0-ba27-ca59624bf363}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\tinycbor">
<UniqueIdentifier>{b43eb5ed-8c56-41eb-a67a-4ce41403629e}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\tinycbor\include">
<UniqueIdentifier>{4650e6af-01d5-46c3-9674-8554dab982ac}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface">
<UniqueIdentifier>{e3a23704-31ed-4869-b74e-6d09f842b336}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface\include">
<UniqueIdentifier>{b5277e13-3a7f-46ab-a73d-7a8aa2831f98}</UniqueIdentifier>
</Filter>
<Filter Include="otapal\code_signature_verification">
<UniqueIdentifier>{920f406b-9c90-4ea6-8a0b-6e328d6ff095}</UniqueIdentifier>
</Filter>
<Filter Include="otapal\code_signature_verification\include">
<UniqueIdentifier>{9d7ce275-011a-4bdc-bba5-ad569f629872}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\timers.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\list.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\queue.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\tasks.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_UDP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Sockets.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\BufferManagement\BufferAllocation_2.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\portable\NetworkInterface\WinPCap\NetworkInterface.c">
<Filter>FreeRTOS+\FreeRTOS+TCP\portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_IP.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_TCP_WIN.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\event_groups.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c">
<Filter>FreeRTOS\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\FreeRTOS_Stream_Buffer.c">
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\FreeRTOS\Source\stream_buffer.c">
<Filter>FreeRTOS\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_freertos_port.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\backoff_algorithm.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aes.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aesni.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\arc4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\aria.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1parse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\asn1write.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\base64.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\bignum.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\blowfish.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\camellia.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ccm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\certs.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chacha20.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\chachapoly.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cipher_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\cmac.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ctr_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\debug.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\des.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\dhm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdh.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecdsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecjpake.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ecp_curves.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\entropy_poll.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\gcm.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\havege.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hkdf.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\hmac_drbg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md2.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md4.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\md5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\memory_buffer_alloc.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\net_sockets.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\nist_kw.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\oid.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\padlock.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pem.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs11.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs12.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkcs5.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkparse.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pkwrite.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\pk_wrap.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\platform_util.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\poly1305.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ripemd160.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\rsa_internal.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha1.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha256.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\sha512.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cache.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ciphersuites.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cli.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_cookie.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_msg.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_srv.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_ticket.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\ssl_tls.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\threading.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\timing.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\version_features.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509write_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_create.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crl.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_crt.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\x509_csr.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\xtea.c">
<Filter>FreeRTOS+\mbedtls\library</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\coreJSON\source\core_json.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON</Filter>
</ClCompile>
<ClCompile Include="main.c" />
<ClCompile Include="..\..\..\..\..\FreeRTOS-Plus\Demo\Common\Logging\windows\Logging_WinSim.c">
<Filter>Logging</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_state.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\core_mqtt_serializer.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT</Filter>
</ClCompile>
<ClCompile Include="DemoTasks\OtaOverMqttDemoExample.c">
<Filter>DemoTasks</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_base64.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_cbor.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_http.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_interface.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\ota_mqtt.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\portable</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\ota_pal.c">
<Filter>otapal</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborencoder_close_container_checked.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborerrorstrings.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborparser_dup_string.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborpretty_stdio.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborvalidation.c">
<Filter>FreeRTOS+\tinycbor</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_agent_message.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface\include</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Common\coreMQTT_Agent_Interface\freertos_command_pool.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface\include</Filter>
</ClCompile>
<ClCompile Include="..\Common\subscription-manager\subscription_manager.c">
<Filter>subscription-manager</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\core_mqtt_agent_command_functions.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent</Filter>
</ClCompile>
<ClCompile Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification_mbedtls.c">
<Filter>otapal\code_signature_verification</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Utilities\mbedtls_freertos\mbedtls_bio_freertos_plus_tcp.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\ThirdParty\mbedtls\library\error.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DNS.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Sockets.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_UDP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\timers.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\event_groups.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\FreeRTOS.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\queue.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\semphr.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\task.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP_Private.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\NetworkBufferManagement.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_IP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_TCP_WIN.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\IPTraceMacroDefaults.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_Stream_Buffer.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\portable.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS\Source\include\projdefs.h">
<Filter>FreeRTOS\Source\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_serializer.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_state.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\interface\transport_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\mbedtls_freertos\threading_alt.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mbedtls</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aes.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aesni.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\arc4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\aria.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\asn1write.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\base64.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bignum.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\blowfish.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\bn_mul.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\camellia.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ccm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\certs.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chacha20.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\chachapoly.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\check_config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cipher_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\cmac.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\compat-1.3.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\config.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ctr_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\debug.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\des.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\dhm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdh.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecdsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecjpake.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ecp_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\entropy_poll.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\gcm.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\havege.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hkdf.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\hmac_drbg.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md2.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md4.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\md_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\memory_buffer_alloc.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\net_sockets.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\nist_kw.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\oid.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\padlock.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pem.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs11.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs12.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pkcs5.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\pk_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_time.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\platform_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\poly1305.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\psa_util.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ripemd160.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\rsa_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha1.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha256.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\sha512.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cache.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ciphersuites.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_cookie.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_internal.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\ssl_ticket.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\threading.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\timing.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\version.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crl.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_crt.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\x509_csr.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\xtea.h">
<Filter>FreeRTOS+\mbedtls\include</Filter>
</ClInclude>
<ClInclude Include="core_mqtt_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="demo_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSIPConfig.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_levels.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\FreeRTOS-Plus\Source\Utilities\logging\logging_stack.h">
<Filter>Logging</Filter>
</ClInclude>
<ClInclude Include="mbedtls_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_errno_TCP.h">
<Filter>FreeRTOS+\FreeRTOS+TCP\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT\source\include\core_mqtt_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\coreJSON\source\include\core_json.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreJSON\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Utilities\backoff_algorithm\source\include\backoff_algorithm.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\backoff_algorithm\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_appversion32.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_base64_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_cbor_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_config_defaults.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_http_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_interface_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_mqtt_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_os_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_platform_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\include\ota_private.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\include</Filter>
</ClInclude>
<ClInclude Include="ota_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\portable\os\ota_os_freertos.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\AWS\ota\portable</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\ota_pal.h">
<Filter>otapal</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cbor.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborinternal_p.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\cborjson.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\compilersupport_p.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\tinycbor-version.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\AWS\ota\source\dependency\3rdparty\tinycbor\src\utf8_p.h">
<Filter>FreeRTOS+\tinycbor\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_agent_message.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Common\coreMQTT_Agent_Interface\include\freertos_command_pool.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\mqtt-agent-interface\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\subscription-manager\subscription_manager.h">
<Filter>subscription-manager</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\code_signature_verification.h">
<Filter>otapal\code_signature_verification\include</Filter>
</ClInclude>
<ClInclude Include="core_pkcs11_config.h">
<Filter>Config</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_command_functions.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\coreMQTT-Agent\source\include\core_mqtt_agent_message_interface.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\coreMQTT-Agent\include</Filter>
</ClInclude>
<ClInclude Include="..\Common\Ota_PAL\Win32\Code_Signature_Verification\aws_ota_codesigner_certificate.h">
<Filter>otapal\code_signature_verification\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\ThirdParty\mbedtls\include\mbedtls\error.h" />
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\sockets_wrapper\freertos_plus_tcp\sockets_wrapper.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\Source\Application-Protocols\network_transport\using_mbedtls\using_mbedtls\using_mbedtls.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\platform\transport\include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,109 @@
/*
* FreeRTOS V202111.00
* 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,187 @@
/*
* FreeRTOS V202111.00
* 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 core_pkcs11_config.h
* @brief PCKS#11 config options.
*/
#ifndef _CORE_PKCS11_CONFIG_H_
#define _CORE_PKCS11_CONFIG_H_
#include "FreeRTOS.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 PKCS #11.
* 3. Include the header file "logging_stack.h", if logging is enabled for PKCS #11.
*/
#include "logging_levels.h"
/* Logging configuration for the PKCS #11 library. */
#ifndef LIBRARY_LOG_NAME
#define LIBRARY_LOG_NAME "PKCS11"
#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"
/**
* @brief Malloc API used by core_pkcs11.h
*/
#define PKCS11_MALLOC pvPortMalloc
/**
* @brief Free API used by core_pkcs11.h
*/
#define PKCS11_FREE vPortFree
/**
* @brief PKCS #11 default user PIN.
*
* The PKCS #11 standard specifies the presence of a user PIN. That feature is
* sensible for applications that have an interactive user interface and memory
* protections. However, since typical microcontroller applications lack one or
* both of those, the user PIN is assumed to be used herein for interoperability
* purposes only, and not as a security feature.
*
* Note: Do not cast this to a pointer! The library calls sizeof to get the length
* of this string.
*/
#define configPKCS11_DEFAULT_USER_PIN "0000"
/**
* @brief Maximum length (in characters) for a PKCS #11 CKA_LABEL
* attribute.
*/
#define pkcs11configMAX_LABEL_LENGTH 32
/**
* @brief Maximum number of token objects that can be stored
* by the PKCS #11 module.
*/
#define pkcs11configMAX_NUM_OBJECTS 6
/**
* @brief Maximum number of sessions that can be stored
* by the PKCS #11 module.
*/
#define pkcs11configMAX_SESSIONS 10
/**
* @brief Set to 1 if a PAL destroy object is implemented.
*
* If set to 0, no PAL destroy object is implemented, and this functionality
* is implemented in the common PKCS #11 layer.
*/
#define pkcs11configPAL_DESTROY_SUPPORTED 0
/**
* @brief Set to 1 if OTA image verification via PKCS #11 module is supported.
*
* If set to 0, OTA code signing certificate is built in via
* aws_ota_codesigner_certificate.h.
*/
#define pkcs11configOTA_SUPPORTED 0
/**
* @brief Set to 1 if PAL supports storage for JITP certificate,
* code verify certificate, and trusted server root certificate.
*
* If set to 0, PAL does not support storage mechanism for these, and
* they are accessed via headers compiled into the code.
*/
#define pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED 0
/**
* @brief The PKCS #11 label for device private key.
*
* Private key for connection to AWS IoT endpoint. The corresponding
* public key should be registered with the AWS IoT endpoint.
*/
#define pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS "Device Priv TLS Key"
/**
* @brief The PKCS #11 label for device public key.
*
* The public key corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
*/
#define pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS "Device Pub TLS Key"
/**
* @brief The PKCS #11 label for the device certificate.
*
* Device certificate corresponding to pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS.
*/
#define pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS "Device Cert"
/**
* @brief The PKCS #11 label for the object to be used for code verification.
*
* Used by over-the-air update code to verify an incoming signed image.
*/
#define pkcs11configLABEL_CODE_VERIFICATION_KEY "Code Verify Key"
/**
* @brief The PKCS #11 label for Just-In-Time-Provisioning.
*
* The certificate corresponding to the issuer of the device certificate
* (pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS) when using the JITR or
* JITP flow.
*/
#define pkcs11configLABEL_JITP_CERTIFICATE "JITP Cert"
/**
* @brief The PKCS #11 label for the AWS Trusted Root Certificate.
*
* @see aws_default_root_certificates.h
*/
#define pkcs11configLABEL_ROOT_CERTIFICATE "Root Cert"
#endif /* _CORE_PKCS11_CONFIG_H_ */

View File

@ -0,0 +1,413 @@
/*
* FreeRTOS V202111.00
* 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
/**********************************************************************************
* Error checks and derived values only below here - do not edit below here. -----*
**********************************************************************************/
/* Compile time error for some undefined configs, and provide default values
* for others. */
#ifndef democonfigMQTT_BROKER_ENDPOINT
#error "Please define democonfigMQTT_BROKER_ENDPOINT in demo_config.h."
#endif
#ifndef democonfigCLIENT_IDENTIFIER
/**
* @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. Using a #define is for convenience
* of demonstration only - production devices should use something unique to the
* device that can be read from software - such as a production serial number.
*/
#error "Please define democonfigCLIENT_IDENTIFIER in demo_config.h to something unique for this device."
#endif
#if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 )
#ifndef democonfigROOT_CA_PEM
#error "Please define Root CA certificate of the MQTT broker(democonfigROOT_CA_PEM) in demo_config.h."
#endif
/* If no username is defined, then a client certificate/key is required. */
#ifndef democonfigCLIENT_USERNAME
/*
*!!! Please note democonfigCLIENT_PRIVATE_KEY_PEM in used for
*!!! convenience of demonstration only. Production devices should
*!!! store keys securely, such as within a secure element.
*/
#ifndef democonfigCLIENT_CERTIFICATE_PEM
#error "Please define client certificate(democonfigCLIENT_CERTIFICATE_PEM) in demo_config.h."
#endif
#ifndef democonfigCLIENT_PRIVATE_KEY_PEM
#error "Please define client private key(democonfigCLIENT_PRIVATE_KEY_PEM) in demo_config.h."
#endif
#else
/* If a username is defined, a client password also would need to be defined for
* client authentication. */
#ifndef democonfigCLIENT_PASSWORD
#error "Please define client password(democonfigCLIENT_PASSWORD) in demo_config.h for client authentication based on username/password."
#endif
/* AWS IoT MQTT broker port needs to be 443 for client authentication based on
* username/password. */
#if defined( democonfigUSE_AWS_IOT_CORE_BROKER ) && democonfigMQTT_BROKER_PORT != 443
#error "Broker port(democonfigMQTT_BROKER_PORT) should be defined as 443 in demo_config.h for client authentication based on username/password in AWS IoT Core."
#endif
#endif /* ifndef democonfigCLIENT_USERNAME */
#ifndef democonfigMQTT_BROKER_PORT
#define democonfigMQTT_BROKER_PORT ( 8883 )
#endif
#else /* if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 ) */
#ifndef democonfigMQTT_BROKER_PORT
#define democonfigMQTT_BROKER_PORT ( 1883 )
#endif
#endif /* if defined( democonfigUSE_TLS ) && ( democonfigUSE_TLS == 1 ) */
/**
* @brief ALPN (Application-Layer Protocol Negotiation) protocol name for AWS IoT MQTT.
*
* This will be used if democonfigMQTT_BROKER_PORT is configured as 443 for the AWS IoT MQTT broker.
* Please see more details about the ALPN protocol for AWS IoT MQTT endpoint
* in the link below.
* https://aws.amazon.com/blogs/iot/mqtt-with-tls-client-authentication-on-port-443-why-it-is-useful-and-how-it-works/
*/
#define AWS_IOT_MQTT_ALPN "\x0ex-amzn-mqtt-ca"
/**
* @brief This is the ALPN (Application-Layer Protocol Negotiation) string
* required by AWS IoT for password-based authentication using TCP port 443.
*/
#define AWS_IOT_CUSTOM_AUTH_ALPN "\x04mqtt"
/**
* Provide default values for undefined configuration settings.
*/
#ifndef democonfigOS_NAME
#define democonfigOS_NAME "FreeRTOS"
#endif
#ifndef democonfigOS_VERSION
#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER
#endif
#ifndef democonfigHARDWARE_PLATFORM_NAME
#define democonfigHARDWARE_PLATFORM_NAME "WinSim"
#endif
#ifndef democonfigMQTT_LIB
#define democonfigMQTT_LIB "core-mqtt@1.0.0"
#endif
/**
* @brief The MQTT metrics string expected by AWS IoT.
*/
#define AWS_IOT_METRICS_STRING \
"?SDK=" democonfigOS_NAME "&Version=" democonfigOS_VERSION \
"&Platform=" democonfigHARDWARE_PLATFORM_NAME "&MQTTLib=" democonfigMQTT_LIB
/**
* @brief The length of the MQTT metrics string expected by AWS IoT.
*/
#define AWS_IOT_METRICS_STRING_LENGTH ( ( uint16_t ) ( sizeof( AWS_IOT_METRICS_STRING ) - 1 ) )
#ifdef democonfigCLIENT_USERNAME
/**
* @brief Append the username with the metrics string if #democonfigCLIENT_USERNAME is defined.
*
* This is to support both metrics reporting and username/password based client
* authentication by AWS IoT.
*/
#define CLIENT_USERNAME_WITH_METRICS democonfigCLIENT_USERNAME AWS_IOT_METRICS_STRING
#endif
/**
* @brief Length of client identifier.
*/
#define democonfigCLIENT_IDENTIFIER_LENGTH ( ( uint16_t ) ( sizeof( democonfigCLIENT_IDENTIFIER ) - 1 ) )
/**
* @brief Length of MQTT server host name.
*/
#define democonfigBROKER_ENDPOINT_LENGTH ( ( uint16_t ) ( sizeof( democonfigMQTT_BROKER_ENDPOINT ) - 1 ) )
#endif /* DEMO_CONFIG_H */

View File

@ -0,0 +1,376 @@
/*
* FreeRTOS V202111.00
* 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>
/* Visual studio intrinsics used so the __debugbreak() function is available
* should an assert get hit. */
#include <intrin.h>
/* FreeRTOS includes. */
#include <FreeRTOS.h>
#include "task.h"
/* TCP/IP stack includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* Demo logging includes. */
#include "logging.h"
/* Demo Specific configs. */
#include "demo_config.h"
/*
* Prototypes for the demos that can be started from this project. Note the
* Ota demo is not actually started until the network is already, which is
* indicated by vApplicationIPNetworkEventHook() executing - hence
* vStartOtaDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartOtaDemo( void );
/*
* Just seeds the simple pseudo random number generator.
*
* !!! NOTE !!!
* This is not a secure method of generating random numbers and production
* devices should use a true random number generator (TRNG).
*/
static void prvSRand( UBaseType_t ulSeed );
/*
* Miscellaneous initialization including preparing the logging and seeding the
* random number generator.
*/
static void prvMiscInitialisation( void );
/* The default IP and MAC address used by the demo. The address configuration
* defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is
* 1 but a DHCP server could not be contacted. See the online documentation for
* more information. */
static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };
static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };
static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };
static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };
/* Set the following constant to pdTRUE to log using the method indicated by the
* name of the constant, or pdFALSE to not log using the method indicated by the
* name of the constant. Options include to standard out (xLogToStdout), to a disk
* file (xLogToFile), and to a UDP port (xLogToUDP). If xLogToUDP is set to pdTRUE
* then UDP messages are sent to the IP address configured as the UDP logging server
* address (see the configUDP_LOGGING_ADDR0 definitions in FreeRTOSConfig.h) and
* the port number set by configPRINT_PORT in FreeRTOSConfig.h. */
const BaseType_t xLogToStdout = pdTRUE, xLogToFile = pdFALSE, xLogToUDP = pdFALSE;
/* Default MAC address configuration. The demo creates a virtual network
* connection that uses this MAC address by accessing the raw Ethernet data
* to and from a real network connection on the host PC. See the
* configNETWORK_INTERFACE_TO_USE definition for information on how to configure
* the real network connection to use. */
const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };
/* Used by the pseudo random number generator. */
static UBaseType_t ulNextRand;
/*-----------------------------------------------------------*/
int main( void )
{
/* Miscellaneous initialization including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
/* Initialize the network interface.
*
***NOTE*** Tasks that use the network are created in the network event hook
* when the network is connected and ready for use (see the implementation of
* vApplicationIPNetworkEventHook() below). The address values passed in here
* are used if ipconfigUSE_DHCP is set to 0, or if ipconfigUSE_DHCP is set to 1
* but a DHCP server cannot be contacted. */
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
/* 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 (this is standard text that is not
* really applicable to the Win32 simulator port). */
for( ; ; )
{
__debugbreak();
}
}
/*-----------------------------------------------------------*/
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
* events are only received if implemented in the MAC driver. */
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
{
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
char cBuffer[ 16 ];
static BaseType_t xTasksAlreadyCreated = pdFALSE;
/* If the network has just come up...*/
if( eNetworkEvent == eNetworkUp )
{
/* Create the tasks that use the IP stack if they have not already been
* created. */
if( xTasksAlreadyCreated == pdFALSE )
{
/* Demos that use the network are created after the network is
* up. */
LogInfo( ( "---------STARTING DEMO---------\r\n" ) );
vStartOtaDemo();
xTasksAlreadyCreated = pdTRUE;
}
/* Print out the network configuration, which may have come from a DHCP
* server. */
FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
LogInfo( ( "\r\n\r\nIP Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulNetMask, cBuffer );
LogInfo( ( "Subnet Mask: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );
LogInfo( ( "Gateway Address: %s\r\n", cBuffer ) );
FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );
LogInfo( ( "DNS Server Address: %s\r\n\r\n\r\n", cBuffer ) );
}
}
/*-----------------------------------------------------------*/
void vAssertCalled( const char * pcFile,
uint32_t ulLine )
{
volatile uint32_t ulBlockVariable = 0UL;
volatile char * pcFileName = ( volatile char * ) pcFile;
volatile uint32_t ulLineNumber = ulLine;
( void ) pcFileName;
( void ) ulLineNumber;
printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */
taskDISABLE_INTERRUPTS();
{
while( ulBlockVariable == 0UL )
{
__debugbreak();
}
}
taskENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
UBaseType_t uxRand( void )
{
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
/*
* Utility function to generate a pseudo random number.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
return( ( int ) ( ulNextRand >> 16UL ) & 0x7fffUL );
}
/*-----------------------------------------------------------*/
static void prvSRand( UBaseType_t ulSeed )
{
/* Utility function to seed the pseudo random number generator. */
ulNextRand = ulSeed;
}
/*-----------------------------------------------------------*/
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
/*
* Seed random number generator.
*
* !!!NOTE!!!
* This is not a secure method of generating a random number. Production
* devices should use a True Random Number Generator (TRNG).
*/
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
}
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
const char * pcApplicationHostnameHook( void )
{
/* Assign the name "FreeRTOS" to this network node. This function will
* be called during the DHCP: the machine will be registered with an IP
* address plus this name. */
return mainHOST_NAME;
}
#endif
/*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 )
BaseType_t xApplicationDNSQueryHook( const char * pcName )
{
BaseType_t xReturn;
/* Determine if a name lookup is for this node. Two names are given
* to this node: that returned by pcApplicationHostnameHook() and that set
* by mainDEVICE_NICK_NAME. */
if( _stricmp( pcName, pcApplicationHostnameHook() ) == 0 )
{
xReturn = pdPASS;
}
else if( _stricmp( pcName, mainDEVICE_NICK_NAME ) == 0 )
{
xReturn = pdPASS;
}
else
{
xReturn = pdFAIL;
}
return xReturn;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) */
/*-----------------------------------------------------------*/
/*
* Callback that provides the inputs necessary to generate a randomized TCP
* Initial Sequence Number per RFC 6528. THIS IS ONLY A DUMMY IMPLEMENTATION
* THAT RETURNS A PSEUDO RANDOM NUMBER SO IS NOT INTENDED FOR USE IN PRODUCTION
* SYSTEMS.
*/
extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
uint16_t usSourcePort,
uint32_t ulDestinationAddress,
uint16_t usDestinationPort )
{
( void ) ulSourceAddress;
( void ) usSourcePort;
( void ) ulDestinationAddress;
( void ) usDestinationPort;
return uxRand();
}
/*-----------------------------------------------------------*/
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.
*/
BaseType_t xApplicationGetRandomNumber( uint32_t * pulNumber )
{
*pulNumber = uxRand();
return pdTRUE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
* implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
* used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
* state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
* application must provide an implementation of vApplicationGetTimerTaskMemory()
* to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer,
uint32_t * pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
* function then they must be declared static - otherwise they will be allocated on
* the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
* task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
* Note that, as the array is necessarily of type StackType_t,
* configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,140 @@
/*
* FreeRTOS V202111.00
* 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
*
*/
/* This file configures mbed TLS for FreeRTOS. */
#ifndef MBEDTLS_CONFIG_H_
#define MBEDTLS_CONFIG_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Generate errors if deprecated functions are used. */
#define MBEDTLS_DEPRECATED_REMOVED
/* Place AES tables in ROM. */
#define MBEDTLS_AES_ROM_TABLES
/* Enable the following cipher modes. */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CFB
#define MBEDTLS_CIPHER_MODE_CTR
/* Enable the following cipher padding modes. */
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
#define MBEDTLS_CIPHER_PADDING_ZEROS
/* Cipher suite configuration. */
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/* Enable all SSL alert messages. */
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/* Enable the following SSL features. */
#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_ALPN
#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/* Check certificate key usage. */
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
#define MBEDTLS_X509_CREATE_C
#define MBEDTLS_PK_WRITE_C
#define MBEDTLS_X509_CSR_WRITE_C
/* Disable platform entropy functions. */
#define MBEDTLS_NO_PLATFORM_ENTROPY
/* Enable the following mbed TLS features. */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_ERROR_C
#define MBEDTLS_GCM_C
#define MBEDTLS_MD_C
#define MBEDTLS_OID_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_TLS_C
#define MBEDTLS_THREADING_ALT
#define MBEDTLS_THREADING_C
#define MBEDTLS_X509_USE_C
#define MBEDTLS_X509_CRT_PARSE_C
/* Set the memory allocation functions on FreeRTOS. */
void * mbedtls_platform_calloc( size_t nmemb,
size_t size );
void mbedtls_platform_free( void * ptr );
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
/* The network send and receive functions on FreeRTOS. */
int mbedtls_platform_send( void * ctx,
const unsigned char * buf,
size_t len );
int mbedtls_platform_recv( void * ctx,
unsigned char * buf,
size_t len );
/* These two macro used by mbedtls_ssl_set_bio in using_mbedtls network
* transport layer. */
#define MBEDTLS_SSL_SEND mbedtls_platform_send
#define MBEDTLS_SSL_RECV mbedtls_platform_recv
/* The entropy poll function. */
int mbedtls_platform_entropy_poll( void * data,
unsigned char * output,
size_t len,
size_t * olen );
#include "mbedtls/check_config.h"
#endif /* ifndef MBEDTLS_CONFIG_H_ */

View File

@ -0,0 +1,200 @@
/*
* FreeRTOS V202111.00
* 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,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {150F08BF-9D61-4CC2-8DBF-1335172A1EA4}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FreeRTOS_Plus_TCP_Minimal.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.freertos.org/labs
IDList=

View File

@ -0,0 +1,353 @@
/*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
#include "FreeRTOS_TCP_server.h"
#include "FreeRTOS_server_private.h"
/* Remove the entire file if TCP is not being used. */
#if( ipconfigUSE_TCP == 1 ) && ( ( ipconfigUSE_HTTP == 1 ) || ( ipconfigUSE_FTP == 1 ) )
#if !defined( ARRAY_SIZE )
#define ARRAY_SIZE(x) ( BaseType_t ) (sizeof( x ) / sizeof( x )[ 0 ] )
#endif
static void prvReceiveNewClient( TCPServer_t *pxServer, BaseType_t xIndex, Socket_t xNexSocket );
static char *strnew( const char *pcString );
/* Remove slashes at the end of a path. */
static void prvRemoveSlash( char *pcDir );
TCPServer_t *FreeRTOS_CreateTCPServer( const struct xSERVER_CONFIG *pxConfigs, BaseType_t xCount )
{
TCPServer_t *pxServer;
SocketSet_t xSocketSet;
/* Create a new server.
xPort / xPortAlt : Make the service available on 1 or 2 public port numbers. */
xSocketSet = FreeRTOS_CreateSocketSet();
if( xSocketSet != NULL )
{
BaseType_t xSize;
xSize = sizeof( *pxServer ) - sizeof( pxServer->xServers ) + xCount * sizeof( pxServer->xServers[ 0 ] );
pxServer = ( TCPServer_t * ) pvPortMallocLarge( xSize );
if( pxServer != NULL )
{
struct freertos_sockaddr xAddress;
BaseType_t xNoTimeout = 0;
BaseType_t xIndex;
memset( pxServer, '\0', xSize );
pxServer->xServerCount = xCount;
pxServer->xSocketSet = xSocketSet;
for( xIndex = 0; xIndex < xCount; xIndex++ )
{
BaseType_t xPortNumber = pxConfigs[ xIndex ].xPortNumber;
if( xPortNumber > 0 )
{
Socket_t xSocket;
xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_STREAM, FREERTOS_IPPROTO_TCP );
FreeRTOS_printf( ( "TCP socket on port %d\n", ( int )xPortNumber ) );
if( xSocket != FREERTOS_INVALID_SOCKET )
{
xAddress.sin_addr = FreeRTOS_GetIPAddress(); // Single NIC, currently not used
xAddress.sin_port = FreeRTOS_htons( xPortNumber );
FreeRTOS_bind( xSocket, &xAddress, sizeof( xAddress ) );
FreeRTOS_listen( xSocket, pxConfigs[ xIndex ].xBackLog );
FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xNoTimeout, sizeof( BaseType_t ) );
FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xNoTimeout, sizeof( BaseType_t ) );
#if( ipconfigHTTP_RX_BUFSIZE > 0 )
{
if( pxConfigs[ xIndex ].eType == eSERVER_HTTP )
{
WinProperties_t xWinProps;
memset( &xWinProps, '\0', sizeof( xWinProps ) );
/* The parent socket itself won't get connected. The properties below
will be inherited by each new child socket. */
xWinProps.lTxBufSize = ipconfigHTTP_TX_BUFSIZE;
xWinProps.lTxWinSize = ipconfigHTTP_TX_WINSIZE;
xWinProps.lRxBufSize = ipconfigHTTP_RX_BUFSIZE;
xWinProps.lRxWinSize = ipconfigHTTP_RX_WINSIZE;
/* Set the window and buffer sizes. */
FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_WIN_PROPERTIES, ( void * ) &xWinProps, sizeof( xWinProps ) );
}
}
#endif
FreeRTOS_FD_SET( xSocket, xSocketSet, eSELECT_READ|eSELECT_EXCEPT );
pxServer->xServers[ xIndex ].xSocket = xSocket;
pxServer->xServers[ xIndex ].eType = pxConfigs[ xIndex ].eType;
pxServer->xServers[ xIndex ].pcRootDir = strnew( pxConfigs[ xIndex ].pcRootDir );
prvRemoveSlash( ( char * ) pxServer->xServers[ xIndex ].pcRootDir );
}
}
}
}
else
{
/* Could not allocate the server, delete the socket set */
FreeRTOS_DeleteSocketSet( xSocketSet );
}
}
else
{
/* Could not create a socket set, return NULL */
pxServer = NULL;
}
return pxServer;
}
/*-----------------------------------------------------------*/
static void prvReceiveNewClient( TCPServer_t *pxServer, BaseType_t xIndex, Socket_t xNexSocket )
{
TCPClient_t *pxClient = NULL;
BaseType_t xSize = 0;
FTCPWorkFunction fWorkFunc = NULL;
FTCPDeleteFunction fDeleteFunc = NULL;
const char *pcType = "Unknown";
/*_RB_ Can the work and delete functions be part of the xSERVER_CONFIG structure
becomes generic, with no pre-processing required? */
#if( ipconfigUSE_HTTP != 0 )
{
if( pxServer->xServers[ xIndex ].eType == eSERVER_HTTP )
{
xSize = sizeof( HTTPClient_t );
fWorkFunc = xHTTPClientWork;
fDeleteFunc = vHTTPClientDelete;
pcType = "HTTP";
}
}
#endif /* ipconfigUSE_HTTP != 0 */
#if( ipconfigUSE_FTP != 0 )
{
if( pxServer->xServers[ xIndex ].eType == eSERVER_FTP )
{
xSize = sizeof( FTPClient_t );
fWorkFunc = xFTPClientWork;
fDeleteFunc = vFTPClientDelete;
pcType = "FTP";
}
}
#endif /* ipconfigUSE_FTP != 0 */
/* Malloc enough space for a new HTTP-client */
if( xSize )
{
pxClient = ( TCPClient_t* ) pvPortMallocLarge( xSize );
}
if( pxClient != NULL )
{
memset( pxClient, '\0', xSize );
/* Put the new client in front of the list. */
pxClient->eType = pxServer->xServers[ xIndex ].eType;
pxClient->pcRootDir = pxServer->xServers[ xIndex ].pcRootDir;
pxClient->pxParent = pxServer;
pxClient->xSocket = xNexSocket;
pxClient->pxNextClient = pxServer->pxClients;
pxClient->fWorkFunction = fWorkFunc;
pxClient->fDeleteFunction = fDeleteFunc;
pxServer->pxClients = pxClient;
FreeRTOS_FD_SET( xNexSocket, pxServer->xSocketSet, eSELECT_READ|eSELECT_EXCEPT );
}
else
{
pcType = "closed";
FreeRTOS_closesocket( xNexSocket );
}
{
struct freertos_sockaddr xRemoteAddress;
FreeRTOS_GetRemoteAddress( pxClient->xSocket, &xRemoteAddress );
FreeRTOS_printf( ( "TPC-server: new %s client %xip\n", pcType, (unsigned)FreeRTOS_ntohl( xRemoteAddress.sin_addr ) ) );
}
/* Remove compiler warnings in case FreeRTOS_printf() is not used. */
( void ) pcType;
}
/*-----------------------------------------------------------*/
void FreeRTOS_TCPServerWork( TCPServer_t *pxServer, TickType_t xBlockingTime )
{
TCPClient_t **ppxClient;
BaseType_t xIndex;
BaseType_t xRc;
/* Let the server do one working cycle */
xRc = FreeRTOS_select( pxServer->xSocketSet, xBlockingTime );
if( xRc != 0 )
{
for( xIndex = 0; xIndex < pxServer->xServerCount; xIndex++ )
{
struct freertos_sockaddr xAddress;
Socket_t xNexSocket;
socklen_t xSocketLength;
if( pxServer->xServers[ xIndex ].xSocket == FREERTOS_NO_SOCKET )
{
continue;
}
xSocketLength = sizeof( xAddress );
xNexSocket = FreeRTOS_accept( pxServer->xServers[ xIndex ].xSocket, &xAddress, &xSocketLength);
if( ( xNexSocket != FREERTOS_NO_SOCKET ) && ( xNexSocket != FREERTOS_INVALID_SOCKET ) )
{
prvReceiveNewClient( pxServer, xIndex, xNexSocket );
}
}
}
ppxClient = &pxServer->pxClients;
while( ( * ppxClient ) != NULL )
{
TCPClient_t *pxThis = *ppxClient;
/* Almost C++ */
xRc = pxThis->fWorkFunction( pxThis );
if (xRc < 0 )
{
*ppxClient = pxThis->pxNextClient;
/* Close handles, resources */
pxThis->fDeleteFunction( pxThis );
/* Free the space */
vPortFreeLarge( pxThis );
}
else
{
ppxClient = &( pxThis->pxNextClient );
}
}
}
/*-----------------------------------------------------------*/
static char *strnew( const char *pcString )
{
BaseType_t xLength;
char *pxBuffer;
xLength = strlen( pcString ) + 1;
pxBuffer = ( char * ) pvPortMalloc( xLength );
if( pxBuffer != NULL )
{
memcpy( pxBuffer, pcString, xLength );
}
return pxBuffer;
}
/*-----------------------------------------------------------*/
static void prvRemoveSlash( char *pcDir )
{
BaseType_t xLength = strlen( pcDir );
while( ( xLength > 0 ) && ( pcDir[ xLength - 1 ] == '/' ) )
{
pcDir[ --xLength ] = '\0';
}
}
/*-----------------------------------------------------------*/
#if( ipconfigSUPPORT_SIGNALS != 0 )
/* FreeRTOS_TCPServerWork() calls select().
The two functions below provide a possibility to interrupt
the call to select(). After the interruption, resume
by calling FreeRTOS_TCPServerWork() again. */
BaseType_t FreeRTOS_TCPServerSignal( TCPServer_t *pxServer )
{
BaseType_t xIndex;
BaseType_t xResult = pdFALSE;
for( xIndex = 0; xIndex < pxServer->xServerCount; xIndex++ )
{
if( pxServer->xServers[ xIndex ].xSocket != FREERTOS_NO_SOCKET )
{
FreeRTOS_SignalSocket( pxServer->xServers[ xIndex ].xSocket );
xResult = pdTRUE;
break;
}
}
return xResult;
}
#endif /* ipconfigSUPPORT_SIGNALS */
/*-----------------------------------------------------------*/
#if( ipconfigSUPPORT_SIGNALS != 0 )
/* Same as above: this function may be called from an ISR,
for instance a GPIO interrupt. */
BaseType_t FreeRTOS_TCPServerSignalFromISR( TCPServer_t *pxServer, BaseType_t *pxHigherPriorityTaskWoken )
{
BaseType_t xIndex;
BaseType_t xResult = pdFALSE;
for( xIndex = 0; xIndex < pxServer->xServerCount; xIndex++ )
{
if( pxServer->xServers[ xIndex ].xSocket != FREERTOS_NO_SOCKET )
{
FreeRTOS_SignalSocketFromISR( pxServer->xServers[ xIndex ].xSocket, pxHigherPriorityTaskWoken );
xResult = pdTRUE;
break;
}
}
return xResult;
}
#endif /* ipconfigSUPPORT_SIGNALS */
/*-----------------------------------------------------------*/
#endif /* ( ipconfigUSE_TCP == 1 ) && ( ( ipconfigUSE_HTTP == 1 ) || ( ipconfigUSE_FTP == 1 ) ) */

View File

@ -0,0 +1,74 @@
/*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_FTP_commands.h"
const FTPCommand_t xFTPCommands[ FTP_CMD_COUNT ] =
{
/* cmdLen cmdName[7] cmdType checkLogin checkNullArg */
{ 4, "USER", ECMD_USER, pdFALSE, pdFALSE },
{ 4, "PASS", ECMD_PASS, pdFALSE, pdFALSE },
{ 4, "ACCT", ECMD_ACCT, pdTRUE, pdFALSE },
{ 3, "CWD", ECMD_CWD, pdTRUE, pdTRUE },
{ 4, "CDUP", ECMD_CDUP, pdTRUE, pdFALSE },
{ 4, "SMNT", ECMD_SMNT, pdTRUE, pdFALSE },
{ 4, "QUIT", ECMD_QUIT, pdTRUE, pdFALSE },
{ 4, "REIN", ECMD_REIN, pdTRUE, pdFALSE },
{ 4, "PORT", ECMD_PORT, pdTRUE, pdFALSE },
{ 4, "PASV", ECMD_PASV, pdTRUE, pdFALSE },
{ 4, "TYPE", ECMD_TYPE, pdTRUE, pdFALSE },
{ 4, "STRU", ECMD_STRU, pdTRUE, pdFALSE },
{ 4, "MODE", ECMD_MODE, pdTRUE, pdFALSE },
{ 4, "RETR", ECMD_RETR, pdTRUE, pdTRUE },
{ 4, "STOR", ECMD_STOR, pdTRUE, pdTRUE },
{ 4, "STOU", ECMD_STOU, pdTRUE, pdFALSE },
{ 4, "APPE", ECMD_APPE, pdTRUE, pdFALSE },
{ 4, "ALLO", ECMD_ALLO, pdTRUE, pdFALSE },
{ 4, "REST", ECMD_REST, pdTRUE, pdFALSE },
{ 4, "RNFR", ECMD_RNFR, pdTRUE, pdTRUE },
{ 4, "RNTO", ECMD_RNTO, pdTRUE, pdTRUE },
{ 4, "ABOR", ECMD_ABOR, pdTRUE, pdFALSE },
{ 4, "SIZE", ECMD_SIZE, pdTRUE, pdTRUE },
{ 4, "MDTM", ECMD_MDTM, pdTRUE, pdTRUE },
{ 4, "DELE", ECMD_DELE, pdTRUE, pdTRUE },
{ 3, "RMD", ECMD_RMD, pdTRUE, pdTRUE },
{ 3, "MKD", ECMD_MKD, pdTRUE, pdTRUE },
{ 3, "PWD", ECMD_PWD, pdTRUE, pdFALSE },
{ 4, "LIST", ECMD_LIST, pdTRUE, pdFALSE },
{ 4, "NLST", ECMD_NLST, pdTRUE, pdFALSE },
{ 4, "SITE", ECMD_SITE, pdTRUE, pdFALSE },
{ 4, "SYST", ECMD_SYST, pdFALSE, pdFALSE },
{ 4, "FEAT", ECMD_FEAT, pdFALSE, pdFALSE },
{ 4, "STAT", ECMD_STAT, pdTRUE, pdFALSE },
{ 4, "HELP", ECMD_HELP, pdFALSE, pdFALSE },
{ 4, "NOOP", ECMD_NOOP, pdFALSE, pdFALSE },
{ 4, "EMPT", ECMD_EMPTY, pdFALSE, pdFALSE },
{ 4, "CLOS", ECMD_CLOSE, pdTRUE, pdFALSE },
{ 4, "UNKN", ECMD_UNKNOWN, pdFALSE, pdFALSE },
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
The protocols implemented in this directory are intended to be demo quality
examples only. They are not intended for inclusion in production devices.

View File

@ -0,0 +1,76 @@
/*
*!
*! The protocols implemented in this file are intended to be demo quality only,
*! and not for production devices.
*!
*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/* Standard includes. */
#include <stdio.h>
#include <stdlib.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "FreeRTOS_HTTP_commands.h"
const struct xWEB_COMMAND xWebCommands[ WEB_CMD_COUNT ] =
{
{ 3, "GET", ECMD_GET },
{ 4, "HEAD", ECMD_HEAD },
{ 4, "POST", ECMD_POST },
{ 3, "PUT", ECMD_PUT },
{ 6, "DELETE", ECMD_DELETE },
{ 5, "TRACE", ECMD_TRACE },
{ 7, "OPTIONS", ECMD_OPTIONS },
{ 7, "CONNECT", ECMD_CONNECT },
{ 5, "PATCH", ECMD_PATCH },
{ 4, "UNKN", ECMD_UNK },
};
const char *webCodename (int aCode)
{
switch (aCode) {
case WEB_REPLY_OK: // = 200,
return "OK";
case WEB_NO_CONTENT: // 204
return "No content";
case WEB_BAD_REQUEST: // = 400,
return "Bad request";
case WEB_UNAUTHORIZED: // = 401,
return "Authorization Required";
case WEB_NOT_FOUND: // = 404,
return "Not Found";
case WEB_GONE: // = 410,
return "Done";
case WEB_PRECONDITION_FAILED: // = 412,
return "Precondition Failed";
case WEB_INTERNAL_SERVER_ERROR: // = 500,
return "Internal Server Error";
}
return "Unknown";
}

View File

@ -0,0 +1,433 @@
/*
*!
*! The protocols implemented in this file are intended to be demo quality only,
*! and not for production devices.
*!
*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/* Standard includes. */
#include <stdio.h>
#include <stdlib.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
/* FreeRTOS Protocol includes. */
#include "FreeRTOS_HTTP_commands.h"
#include "FreeRTOS_TCP_server.h"
#include "FreeRTOS_server_private.h"
/* Remove the whole file if HTTP is not supported. */
#if( ipconfigUSE_HTTP == 1 )
/* FreeRTOS+FAT includes. */
#include "ff_stdio.h"
#ifndef HTTP_SERVER_BACKLOG
#define HTTP_SERVER_BACKLOG ( 12 )
#endif
#ifndef USE_HTML_CHUNKS
#define USE_HTML_CHUNKS ( 0 )
#endif
#if !defined( ARRAY_SIZE )
#define ARRAY_SIZE(x) ( BaseType_t ) (sizeof( x ) / sizeof( x )[ 0 ] )
#endif
/* Some defines to make the code more readbale */
#define pcCOMMAND_BUFFER pxClient->pxParent->pcCommandBuffer
#define pcNEW_DIR pxClient->pxParent->pcNewDir
#define pcFILE_BUFFER pxClient->pxParent->pcFileBuffer
#ifndef ipconfigHTTP_REQUEST_CHARACTER
#define ipconfigHTTP_REQUEST_CHARACTER '?'
#endif
/*_RB_ Need comment block, although fairly self evident. */
static void prvFileClose( HTTPClient_t *pxClient );
static BaseType_t prvProcessCmd( HTTPClient_t *pxClient, BaseType_t xIndex );
static const char *pcGetContentsType( const char *apFname );
static BaseType_t prvOpenURL( HTTPClient_t *pxClient );
static BaseType_t prvSendFile( HTTPClient_t *pxClient );
static BaseType_t prvSendReply( HTTPClient_t *pxClient, BaseType_t xCode );
static const char pcEmptyString[1] = { '\0' };
typedef struct xTYPE_COUPLE
{
const char *pcExtension;
const char *pcType;
} TypeCouple_t;
static TypeCouple_t pxTypeCouples[ ] =
{
{ "html", "text/html" },
{ "css", "text/css" },
{ "js", "text/javascript" },
{ "png", "image/png" },
{ "jpg", "image/jpeg" },
{ "gif", "image/gif" },
{ "txt", "text/plain" },
{ "mp3", "audio/mpeg3" },
{ "wav", "audio/wav" },
{ "flac", "audio/ogg" },
{ "pdf", "application/pdf" },
{ "ttf", "application/x-font-ttf" },
{ "ttc", "application/x-font-ttf" }
};
void vHTTPClientDelete( TCPClient_t *pxTCPClient )
{
HTTPClient_t *pxClient = ( HTTPClient_t * ) pxTCPClient;
/* This HTTP client stops, close / release all resources. */
if( pxClient->xSocket != FREERTOS_NO_SOCKET )
{
FreeRTOS_FD_CLR( pxClient->xSocket, pxClient->pxParent->xSocketSet, eSELECT_ALL );
FreeRTOS_closesocket( pxClient->xSocket );
pxClient->xSocket = FREERTOS_NO_SOCKET;
}
prvFileClose( pxClient );
}
/*-----------------------------------------------------------*/
static void prvFileClose( HTTPClient_t *pxClient )
{
if( pxClient->pxFileHandle != NULL )
{
FreeRTOS_printf( ( "Closing file: %s\n", pxClient->pcCurrentFilename ) );
ff_fclose( pxClient->pxFileHandle );
pxClient->pxFileHandle = NULL;
}
}
/*-----------------------------------------------------------*/
static BaseType_t prvSendReply( HTTPClient_t *pxClient, BaseType_t xCode )
{
struct xTCP_SERVER *pxParent = pxClient->pxParent;
BaseType_t xRc;
/* A normal command reply on the main socket (port 21). */
char *pcBuffer = pxParent->pcFileBuffer;
xRc = snprintf( pcBuffer, sizeof( pxParent->pcFileBuffer ),
"HTTP/1.1 %d %s\r\n"
#if USE_HTML_CHUNKS
"Transfer-Encoding: chunked\r\n"
#endif
"Content-Type: %s\r\n"
"Connection: keep-alive\r\n"
"%s\r\n",
( int ) xCode,
webCodename (xCode),
pxParent->pcContentsType[0] ? pxParent->pcContentsType : "text/html",
pxParent->pcExtraContents );
pxParent->pcContentsType[0] = '\0';
pxParent->pcExtraContents[0] = '\0';
xRc = FreeRTOS_send( pxClient->xSocket, ( const void * ) pcBuffer, xRc, 0 );
pxClient->bits.bReplySent = pdTRUE_UNSIGNED;
return xRc;
}
/*-----------------------------------------------------------*/
static BaseType_t prvSendFile( HTTPClient_t *pxClient )
{
size_t uxSpace;
size_t uxCount;
BaseType_t xRc = 0;
if( pxClient->bits.bReplySent == pdFALSE_UNSIGNED )
{
pxClient->bits.bReplySent = pdTRUE_UNSIGNED;
strcpy( pxClient->pxParent->pcContentsType, pcGetContentsType( pxClient->pcCurrentFilename ) );
snprintf( pxClient->pxParent->pcExtraContents, sizeof( pxClient->pxParent->pcExtraContents ),
"Content-Length: %d\r\n", ( int ) pxClient->uxBytesLeft );
/* "Requested file action OK". */
xRc = prvSendReply( pxClient, WEB_REPLY_OK );
}
if( xRc >= 0 ) do
{
uxSpace = FreeRTOS_tx_space( pxClient->xSocket );
if( pxClient->uxBytesLeft < uxSpace )
{
uxCount = pxClient->uxBytesLeft;
}
else
{
uxCount = uxSpace;
}
if( uxCount > 0u )
{
if( uxCount > sizeof( pxClient->pxParent->pcFileBuffer ) )
{
uxCount = sizeof( pxClient->pxParent->pcFileBuffer );
}
ff_fread( pxClient->pxParent->pcFileBuffer, 1, uxCount, pxClient->pxFileHandle );
pxClient->uxBytesLeft -= uxCount;
xRc = FreeRTOS_send( pxClient->xSocket, pxClient->pxParent->pcFileBuffer, uxCount, 0 );
if( xRc < 0 )
{
break;
}
}
} while( uxCount > 0u );
if( pxClient->uxBytesLeft == 0u )
{
/* Writing is ready, no need for further 'eSELECT_WRITE' events. */
FreeRTOS_FD_CLR( pxClient->xSocket, pxClient->pxParent->xSocketSet, eSELECT_WRITE );
prvFileClose( pxClient );
}
else
{
/* Wake up the TCP task as soon as this socket may be written to. */
FreeRTOS_FD_SET( pxClient->xSocket, pxClient->pxParent->xSocketSet, eSELECT_WRITE );
}
return xRc;
}
/*-----------------------------------------------------------*/
static BaseType_t prvOpenURL( HTTPClient_t *pxClient )
{
BaseType_t xRc;
char pcSlash[ 2 ];
pxClient->bits.ulFlags = 0;
#if( ipconfigHTTP_HAS_HANDLE_REQUEST_HOOK != 0 )
{
if( strchr( pxClient->pcUrlData, ipconfigHTTP_REQUEST_CHARACTER ) != NULL )
{
size_t xResult;
xResult = uxApplicationHTTPHandleRequestHook( pxClient->pcUrlData, pxClient->pcCurrentFilename, sizeof( pxClient->pcCurrentFilename ) );
if( xResult > 0 )
{
strcpy( pxClient->pxParent->pcContentsType, "text/html" );
snprintf( pxClient->pxParent->pcExtraContents, sizeof( pxClient->pxParent->pcExtraContents ),
"Content-Length: %d\r\n", ( int ) xResult );
xRc = prvSendReply( pxClient, WEB_REPLY_OK ); /* "Requested file action OK" */
if( xRc > 0 )
{
xRc = FreeRTOS_send( pxClient->xSocket, pxClient->pcCurrentFilename, xResult, 0 );
}
/* Although against the coding standard of FreeRTOS, a return is
done here to simplify this conditional code. */
return xRc;
}
}
}
#endif /* ipconfigHTTP_HAS_HANDLE_REQUEST_HOOK */
if( pxClient->pcUrlData[ 0 ] != '/' )
{
/* Insert a slash before the file name. */
pcSlash[ 0 ] = '/';
pcSlash[ 1 ] = '\0';
}
else
{
/* The browser provided a starting '/' already. */
pcSlash[ 0 ] = '\0';
}
snprintf( pxClient->pcCurrentFilename, sizeof( pxClient->pcCurrentFilename ), "%s%s%s",
pxClient->pcRootDir,
pcSlash,
pxClient->pcUrlData);
pxClient->pxFileHandle = ff_fopen( pxClient->pcCurrentFilename, "rb" );
FreeRTOS_printf( ( "Open file '%s': %s\n", pxClient->pcCurrentFilename,
pxClient->pxFileHandle != NULL ? "Ok" : strerror( stdioGET_ERRNO() ) ) );
if( pxClient->pxFileHandle == NULL )
{
/* "404 File not found". */
xRc = prvSendReply( pxClient, WEB_NOT_FOUND );
}
else
{
pxClient->uxBytesLeft = ( size_t ) pxClient->pxFileHandle->ulFileSize;
xRc = prvSendFile( pxClient );
}
return xRc;
}
/*-----------------------------------------------------------*/
static BaseType_t prvProcessCmd( HTTPClient_t *pxClient, BaseType_t xIndex )
{
BaseType_t xResult = 0;
/* A new command has been received. Process it. */
switch( xIndex )
{
case ECMD_GET:
xResult = prvOpenURL( pxClient );
break;
case ECMD_HEAD:
case ECMD_POST:
case ECMD_PUT:
case ECMD_DELETE:
case ECMD_TRACE:
case ECMD_OPTIONS:
case ECMD_CONNECT:
case ECMD_PATCH:
case ECMD_UNK:
{
FreeRTOS_printf( ( "prvProcessCmd: Not implemented: %s\n",
xWebCommands[xIndex].pcCommandName ) );
}
break;
}
return xResult;
}
/*-----------------------------------------------------------*/
BaseType_t xHTTPClientWork( TCPClient_t *pxTCPClient )
{
BaseType_t xRc;
HTTPClient_t *pxClient = ( HTTPClient_t * ) pxTCPClient;
if( pxClient->pxFileHandle != NULL )
{
prvSendFile( pxClient );
}
xRc = FreeRTOS_recv( pxClient->xSocket, ( void * )pcCOMMAND_BUFFER, sizeof( pcCOMMAND_BUFFER ), 0 );
if( xRc > 0 )
{
BaseType_t xIndex;
const char *pcEndOfCmd;
const struct xWEB_COMMAND *curCmd;
char *pcBuffer = pcCOMMAND_BUFFER;
if( xRc < ( BaseType_t ) sizeof( pcCOMMAND_BUFFER ) )
{
pcBuffer[ xRc ] = '\0';
}
while( xRc && ( pcBuffer[ xRc - 1 ] == 13 || pcBuffer[ xRc - 1 ] == 10 ) )
{
pcBuffer[ --xRc ] = '\0';
}
pcEndOfCmd = pcBuffer + xRc;
curCmd = xWebCommands;
/* Pointing to "/index.html HTTP/1.1". */
pxClient->pcUrlData = pcBuffer;
/* Pointing to "HTTP/1.1". */
pxClient->pcRestData = pcEmptyString;
/* Last entry is "ECMD_UNK". */
for( xIndex = 0; xIndex < WEB_CMD_COUNT - 1; xIndex++, curCmd++ )
{
BaseType_t xLength;
xLength = curCmd->xCommandLength;
if( ( xRc >= xLength ) && ( memcmp( curCmd->pcCommandName, pcBuffer, xLength ) == 0 ) )
{
char *pcLastPtr;
pxClient->pcUrlData += xLength + 1;
for( pcLastPtr = (char *)pxClient->pcUrlData; pcLastPtr < pcEndOfCmd; pcLastPtr++ )
{
char ch = *pcLastPtr;
if( ( ch == '\0' ) || ( strchr( "\n\r \t", ch ) != NULL ) )
{
*pcLastPtr = '\0';
pxClient->pcRestData = pcLastPtr + 1;
break;
}
}
break;
}
}
if( xIndex < ( WEB_CMD_COUNT - 1 ) )
{
xRc = prvProcessCmd( pxClient, xIndex );
}
}
else if( xRc < 0 )
{
/* The connection will be closed and the client will be deleted. */
FreeRTOS_printf( ( "xHTTPClientWork: rc = %ld\n", xRc ) );
}
return xRc;
}
/*-----------------------------------------------------------*/
static const char *pcGetContentsType (const char *apFname)
{
const char *slash = NULL;
const char *dot = NULL;
const char *ptr;
const char *pcResult = "text/html";
BaseType_t x;
for( ptr = apFname; *ptr; ptr++ )
{
if (*ptr == '.') dot = ptr;
if (*ptr == '/') slash = ptr;
}
if( dot > slash )
{
dot++;
for( x = 0; x < ARRAY_SIZE( pxTypeCouples ); x++ )
{
if( strcasecmp( dot, pxTypeCouples[ x ].pcExtension ) == 0 )
{
pcResult = pxTypeCouples[ x ].pcType;
break;
}
}
}
return pcResult;
}
#endif /* ipconfigUSE_HTTP */

View File

@ -0,0 +1,2 @@
The protocols implemented in this directory are intended to be demo quality
examples only. They are not intended for inclusion in production devices.

View File

@ -0,0 +1,445 @@
/*
*!
*! The protocols implemented in this file are intended to be demo quality only,
*! and not for production devices.
*!
*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/*
* NTPDemo.c
*
* An example of how to lookup a domain using DNS
* And also how to send and receive UDP messages to get the NTP time
*
*/
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
#include "FreeRTOS_DNS.h"
#include "FreeRTOS_Stream_Buffer.h"
/* Use the date & time functions from +FAT. */
#include "ff_time.h"
#include "NTPDemo.h"
#include "ntpClient.h"
#include "date_and_time.h"
enum EStatus {
EStatusLookup,
EStatusAsking,
EStatusPause,
EStatusFailed,
};
static struct SNtpPacket xNTPPacket;
#if( ipconfigUSE_CALLBACKS == 0 )
static char cRecvBuffer[ sizeof( struct SNtpPacket ) + 64 ];
#endif
static enum EStatus xStatus = EStatusLookup;
static const char *pcTimeServers[] = {
"0.asia.pool.ntp.org",
"0.europe.pool.ntp.org",
"0.id.pool.ntp.org",
"0.south-america.pool.ntp.org",
"0.oceania.pool.ntp.org",
"0.north-america.pool.ntp.org"
};
static SemaphoreHandle_t xNTPWakeupSem = NULL;
static uint32_t ulIPAddressFound;
static Socket_t xUDPSocket = NULL;
static TaskHandle_t xNTPTaskhandle = NULL;
static TickType_t uxSendTime;
static void prvNTPTask( void *pvParameters );
static void vSignalTask( void )
{
#if( ipconfigUSE_CALLBACKS == 0 )
if( xUDPSocket != NULL )
{
/* Send a signal to the socket so that the
FreeRTOS_recvfrom will get interrupted. */
FreeRTOS_SignalSocket( xUDPSocket );
}
else
#endif
if( xNTPWakeupSem != NULL )
{
xSemaphoreGive( xNTPWakeupSem );
}
}
void vStartNTPTask( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority )
{
/* The only public function in this module: start a task to contact
some NTP server. */
if( xNTPTaskhandle != NULL )
{
switch( xStatus )
{
case EStatusPause:
xStatus = EStatusAsking;
vSignalTask();
break;
case EStatusLookup:
FreeRTOS_printf( ( "NTP looking up server\n" ) );
break;
case EStatusAsking:
FreeRTOS_printf( ( "NTP still asking\n" ) );
break;
case EStatusFailed:
FreeRTOS_printf( ( "NTP failed somehow\n" ) );
ulIPAddressFound = 0ul;
xStatus = EStatusLookup;
vSignalTask();
break;
}
}
else
{
xUDPSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );
if( xUDPSocket != FREERTOS_INVALID_SOCKET )
{
struct freertos_sockaddr xAddress;
#if( ipconfigUSE_CALLBACKS != 0 )
BaseType_t xReceiveTimeOut = pdMS_TO_TICKS( 0 );
#else
BaseType_t xReceiveTimeOut = pdMS_TO_TICKS( 5000 );
#endif
xAddress.sin_addr = 0ul;
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
FreeRTOS_bind( xUDPSocket, &xAddress, sizeof( xAddress ) );
FreeRTOS_setsockopt( xUDPSocket, 0, FREERTOS_SO_RCVTIMEO, &xReceiveTimeOut, sizeof( xReceiveTimeOut ) );
xTaskCreate( prvNTPTask, /* The function that implements the task. */
( const char * ) "NTP client", /* Just a text name for the task to aid debugging. */
usTaskStackSize, /* The stack size is defined in FreeRTOSIPConfig.h. */
NULL, /* The task parameter, not used in this case. */
uxTaskPriority, /* The priority assigned to the task is defined in FreeRTOSConfig.h. */
&xNTPTaskhandle ); /* The task handle. */
}
else
{
FreeRTOS_printf( ( "Creating socket failed\n" ) );
}
}
}
/*-----------------------------------------------------------*/
static void vDNS_callback( const char *pcName, void *pvSearchID, uint32_t ulIPAddress )
{
char pcBuf[16];
/* The DNS lookup has a result, or it has reached the time-out. */
FreeRTOS_inet_ntoa( ulIPAddress, pcBuf );
FreeRTOS_printf( ( "IP address of %s found: %s\n", pcName, pcBuf ) );
if( ulIPAddressFound == 0ul )
{
ulIPAddressFound = ulIPAddress;
}
/* For testing: in case DNS doen't respond, still try some NTP server
with a known IP-address. */
if( ulIPAddressFound == 0ul )
{
ulIPAddressFound = FreeRTOS_inet_addr_quick( 184, 105, 182, 7 );
/* ulIPAddressFound = FreeRTOS_inet_addr_quick( 103, 242, 70, 4 ); */
}
xStatus = EStatusAsking;
vSignalTask();
}
/*-----------------------------------------------------------*/
static void prvSwapFields( struct SNtpPacket *pxPacket)
{
/* NTP messages are big-endian */
pxPacket->rootDelay = FreeRTOS_htonl( pxPacket->rootDelay );
pxPacket->rootDispersion = FreeRTOS_htonl( pxPacket->rootDispersion );
pxPacket->referenceTimestamp.seconds = FreeRTOS_htonl( pxPacket->referenceTimestamp.seconds );
pxPacket->referenceTimestamp.fraction = FreeRTOS_htonl( pxPacket->referenceTimestamp.fraction );
pxPacket->originateTimestamp.seconds = FreeRTOS_htonl( pxPacket->originateTimestamp.seconds );
pxPacket->originateTimestamp.fraction = FreeRTOS_htonl( pxPacket->originateTimestamp.fraction );
pxPacket->receiveTimestamp.seconds = FreeRTOS_htonl( pxPacket->receiveTimestamp.seconds );
pxPacket->receiveTimestamp.fraction = FreeRTOS_htonl( pxPacket->receiveTimestamp.fraction );
pxPacket->transmitTimestamp.seconds = FreeRTOS_htonl( pxPacket->transmitTimestamp.seconds );
pxPacket->transmitTimestamp.fraction = FreeRTOS_htonl( pxPacket->transmitTimestamp.fraction );
}
/*-----------------------------------------------------------*/
static void prvNTPPacketInit( )
{
memset (&xNTPPacket, '\0', sizeof( xNTPPacket ) );
xNTPPacket.flags = 0xDB; /* value 0xDB : mode 3 (client), version 3, leap indicator unknown 3 */
xNTPPacket.poll = 10; /* 10 means 1 << 10 = 1024 seconds */
xNTPPacket.precision = 0xFA; /* = 250 = 0.015625 seconds */
xNTPPacket.rootDelay = 0x5D2E; /* 0x5D2E = 23854 or (23854/65535)= 0.3640 sec */
xNTPPacket.rootDispersion = 0x0008CAC8; /* 0x0008CAC8 = 8.7912 seconds */
/* use the recorded NTP time */
time_t uxSecs = FreeRTOS_time( NULL );/* apTime may be NULL, returns seconds */
xNTPPacket.referenceTimestamp.seconds = uxSecs; /* Current time */
xNTPPacket.transmitTimestamp.seconds = uxSecs + 3;
/* Transform the contents of the fields from native to big endian. */
prvSwapFields( &xNTPPacket );
}
/*-----------------------------------------------------------*/
static void prvReadTime( struct SNtpPacket * pxPacket )
{
FF_TimeStruct_t xTimeStruct;
time_t uxPreviousSeconds;
time_t uxPreviousMS;
time_t uxCurrentSeconds;
time_t uxCurrentMS;
const char *pcTimeUnit;
int32_t ilDiff;
TickType_t uxTravelTime;
uxTravelTime = xTaskGetTickCount() - uxSendTime;
/* Transform the contents of the fields from big to native endian. */
prvSwapFields( pxPacket );
uxCurrentSeconds = pxPacket->receiveTimestamp.seconds - TIME1970;
uxCurrentMS = pxPacket->receiveTimestamp.fraction / 4294967;
uxCurrentSeconds += uxCurrentMS / 1000;
uxCurrentMS = uxCurrentMS % 1000;
// Get the last time recorded
uxPreviousSeconds = FreeRTOS_get_secs_msec( &uxPreviousMS );
// Set the new time with precision in msec. */
FreeRTOS_set_secs_msec( &uxCurrentSeconds, &uxCurrentMS );
if( uxCurrentSeconds >= uxPreviousSeconds )
{
ilDiff = ( int32_t ) ( uxCurrentSeconds - uxPreviousSeconds );
}
else
{
ilDiff = 0 - ( int32_t ) ( uxPreviousSeconds - uxCurrentSeconds );
}
if( ( ilDiff < -5 ) || ( ilDiff > 5 ) )
{
/* More than 5 seconds difference. */
pcTimeUnit = "sec";
}
else
{
/* Less than or equal to 5 second difference. */
pcTimeUnit = "ms";
uint32_t ulLowest = ( uxCurrentSeconds <= uxPreviousSeconds ) ? uxCurrentSeconds : uxPreviousSeconds;
int32_t iCurMS = 1000 * ( uxCurrentSeconds - ulLowest ) + uxCurrentMS;
int32_t iPrevMS = 1000 * ( uxPreviousSeconds - ulLowest ) + uxPreviousMS;
ilDiff = iCurMS - iPrevMS;
}
uxCurrentSeconds -= iTimeZone;
FreeRTOS_gmtime_r( &uxCurrentSeconds, &xTimeStruct );
/*
378.067 [NTP client] NTP time: 9/11/2015 16:11:19.559 Diff -20 ms (289 ms)
379.441 [NTP client] NTP time: 9/11/2015 16:11:20.933 Diff 0 ms (263 ms)
*/
FreeRTOS_printf( ("NTP time: %d/%d/%02d %2d:%02d:%02d.%03u Diff %d %s (%lu ms)\n",
xTimeStruct.tm_mday,
xTimeStruct.tm_mon + 1,
xTimeStruct.tm_year + 1900,
xTimeStruct.tm_hour,
xTimeStruct.tm_min,
xTimeStruct.tm_sec,
( unsigned )uxCurrentMS,
( unsigned )ilDiff,
pcTimeUnit,
uxTravelTime ) );
/* Remove compiler warnings in case FreeRTOS_printf() is not used. */
( void ) pcTimeUnit;
( void ) uxTravelTime;
}
/*-----------------------------------------------------------*/
#if( ipconfigUSE_CALLBACKS != 0 )
static BaseType_t xOnUDPReceive( Socket_t xSocket, void * pvData, size_t xLength,
const struct freertos_sockaddr *pxFrom, const struct freertos_sockaddr *pxDest )
{
if( xLength >= sizeof( xNTPPacket ) )
{
prvReadTime( ( struct SNtpPacket *)pvData );
if( xStatus != EStatusPause )
{
xStatus = EStatusPause;
}
}
vSignalTask();
/* Tell the driver not to store the RX data */
return 1;
}
/*-----------------------------------------------------------*/
#endif /* ipconfigUSE_CALLBACKS != 0 */
static void prvNTPTask( void *pvParameters )
{
BaseType_t xServerIndex = 3;
struct freertos_sockaddr xAddress;
#if( ipconfigUSE_CALLBACKS != 0 )
F_TCP_UDP_Handler_t xHandler;
#endif /* ipconfigUSE_CALLBACKS != 0 */
xStatus = EStatusLookup;
#if( ipconfigSOCKET_HAS_USER_SEMAPHORE != 0 ) || ( ipconfigUSE_CALLBACKS != 0 )
{
xNTPWakeupSem = xSemaphoreCreateBinary();
}
#endif
#if( ipconfigUSE_CALLBACKS != 0 )
{
memset( &xHandler, '\0', sizeof( xHandler ) );
xHandler.pxOnUDPReceive = xOnUDPReceive;
FreeRTOS_setsockopt( xUDPSocket, 0, FREERTOS_SO_UDP_RECV_HANDLER, ( void * ) &xHandler, sizeof( xHandler ) );
}
#endif
#if( ipconfigSOCKET_HAS_USER_SEMAPHORE != 0 )
{
FreeRTOS_setsockopt( xUDPSocket, 0, FREERTOS_SO_SET_SEMAPHORE, ( void * ) &xNTPWakeupSem, sizeof( xNTPWakeupSem ) );
}
#endif
for( ; ; )
{
switch( xStatus )
{
case EStatusLookup:
if( ( ulIPAddressFound == 0ul ) || ( ulIPAddressFound == ~0ul ) )
{
if( ++xServerIndex == sizeof( pcTimeServers ) / sizeof( pcTimeServers[ 0 ] ) )
{
xServerIndex = 0;
}
FreeRTOS_printf( ( "Looking up server '%s'\n", pcTimeServers[ xServerIndex ] ) );
FreeRTOS_gethostbyname_a( pcTimeServers[ xServerIndex ], vDNS_callback, (void *)NULL, 1200 );
}
else
{
xStatus = EStatusAsking;
}
break;
case EStatusAsking:
{
char pcBuf[16];
prvNTPPacketInit( );
xAddress.sin_addr = ulIPAddressFound;
xAddress.sin_port = FreeRTOS_htons( NTP_PORT );
FreeRTOS_inet_ntoa( xAddress.sin_addr, pcBuf );
FreeRTOS_printf( ( "Sending UDP message to %s:%u\n",
pcBuf,
FreeRTOS_ntohs( xAddress.sin_port ) ) );
uxSendTime = xTaskGetTickCount( );
FreeRTOS_sendto( xUDPSocket, ( void * )&xNTPPacket, sizeof( xNTPPacket ), 0, &xAddress, sizeof( xAddress ) );
}
break;
case EStatusPause:
break;
case EStatusFailed:
break;
}
#if( ipconfigUSE_CALLBACKS != 0 )
{
xSemaphoreTake( xNTPWakeupSem, 5000 );
}
#else
{
uint32_t xAddressSize;
BaseType_t xReturned;
xAddressSize = sizeof( xAddress );
xReturned = FreeRTOS_recvfrom( xUDPSocket, ( void * ) cRecvBuffer, sizeof( cRecvBuffer ), 0, &xAddress, &xAddressSize );
switch( xReturned )
{
case 0:
case -pdFREERTOS_ERRNO_EAGAIN:
case -pdFREERTOS_ERRNO_EINTR:
break;
default:
if( xReturned < sizeof( xNTPPacket ) )
{
FreeRTOS_printf( ( "FreeRTOS_recvfrom: returns %ld\n", xReturned ) );
}
else
{
prvReadTime( ( struct SNtpPacket *)cRecvBuffer );
if( xStatus != EStatusPause )
{
xStatus = EStatusPause;
}
}
break;
}
}
#endif
}
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=https://www.freertos.org/coresntp/index.html
IDList=

View File

@ -0,0 +1,5 @@
FreeRTOS 2020107.00 adds a new SNTPv4 client library, [FreeRTOS/coreSNTP](https://github.com/FreeRTOS/coreSNTP),
and an [accompanying demo](..\..\..\coreSNTP_Windows_Simulator) to showcase the setup of an SNTP client and system
wall-clock time using the library. Refer to
The protocols implemented in this directory are intended to be demo quality
examples only. They are not intended for inclusion in production devices.

View File

@ -0,0 +1,133 @@
/*
* FreeRTOS+TCP V2.0.1
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
#ifndef __FTPCMD_H__
#define __FTPCMD_H__
#define REPL_110 "110 Restart marker reply.\r\n"
#define REPL_120 "120 Try again in 2 minutes.\r\n"
#define REPL_125 "125 Data connection already open; transfer starting.\r\n"
#define REPL_150 "150 File status okay; about to open data connection.\r\n"
#define REPL_200 "200 NOOP command successful.\r\n"
#define REPL_200_PROGRESS "200 NOOP: data transfer in progress.\r\n"
#define REPL_202 "202 Command not implemented, superfluous at this site.\r\n"
#define REPL_211 "221 System status, or system help reply.\r\n"
#define REPL_211_STATUS "221-status of %s.\r\n"
#define REPL_211_END "221 End of status.\r\n"
#define REPL_212 "212 Directory status.\r\n"
#define REPL_213 "213 File status.\r\n"
#define REPL_214 "214 Help message.\r\n"
#define REPL_214_END "214 End Help message.\r\n"
#define REPL_215 "215 %s system type.\r\n"
#define REPL_220 "220 Service ready for new user.\r\n"
#define REPL_221 "221 Service closing control connection.\r\n"
#define REPL_225 "225 Data connection open; no transfer in progress.\r\n"
#define REPL_226 "226 Closing data connection.\r\n"
#define REPL_227 "227 Entering Passive Mode (%s,%s,%s,%s,%s,%s).\r\n"
#define REPL_227_D "227 Entering Passive Mode (%u,%u,%u,%u,%u,%u).\r\n"
#define REPL_230 "230 User logged in, proceed.\r\n"
#define REPL_250 "250 Requested file action okay, completed.\r\n"
#define REPL_257 "257 %s created.\r\n"
// #define REPL_257_PWD "257 \"%s\" is current working dir.\r\n"
#define REPL_257_PWD "257 \"%s\"\r\n"
#define REPL_331 "331 Only anonymous user is accepted.\r\n"
#define REPL_331_ANON "331 Anonymous login okay\r\n"
#define REPL_332 "332 Need account for login.\r\n"
#define REPL_350 "350 Requested file action pending further information.\r\n"
#define REPL_421 "421 Service not available, closing control connection.\r\n"
#define REPL_425 "425 Can't open data connection.\r\n"
#define REPL_426 "426 Connection closed; transfer aborted.\r\n"
#define REPL_450 "450 Requested file action not taken.\r\n"
#define REPL_451 "451 Requested action aborted. Local error in processing.\r\n"
#define REPL_452 "452 Requested action not taken.\r\n"
#define REPL_500 "500 Syntax error, command unrecognized.\r\n"
#define REPL_501 "501 Syntax error in parameters or arguments.\r\n"
#define REPL_502 "502 Command not implemented.\r\n"
#define REPL_503 "503 Bad sequence of commands.\r\n"
#define REPL_504 "504 Command not implemented for that parameter.\r\n"
#define REPL_530 "530 Not logged in.\r\n"
#define REPL_532 "532 Need account for storing files.\r\n"
#define REPL_550 "550 Requested action not taken.\r\n"
#define REPL_551 "551 Requested action aborted. Page type unknown.\r\n"
#define REPL_552 "552 Requested file action aborted.\r\n"
#define REPL_553 "553 Requested action not taken.\r\n"
#define REPL_553_READ_ONLY "553 Read-only file-system.\r\n"
enum EFTPCommand {
ECMD_USER,
ECMD_PASS,
ECMD_ACCT,
ECMD_CWD,
ECMD_CDUP,
ECMD_SMNT,
ECMD_QUIT,
ECMD_REIN,
ECMD_PORT,
ECMD_PASV,
ECMD_TYPE,
ECMD_STRU,
ECMD_MODE,
ECMD_RETR,
ECMD_STOR,
ECMD_STOU,
ECMD_APPE,
ECMD_ALLO,
ECMD_REST,
ECMD_RNFR,
ECMD_RNTO,
ECMD_ABOR,
ECMD_SIZE,
ECMD_MDTM,
ECMD_DELE,
ECMD_RMD,
ECMD_MKD,
ECMD_PWD,
ECMD_LIST,
ECMD_NLST,
ECMD_SITE,
ECMD_SYST,
ECMD_FEAT,
ECMD_STAT,
ECMD_HELP,
ECMD_NOOP,
ECMD_EMPTY,
ECMD_CLOSE,
ECMD_UNKNOWN,
};
typedef struct xFTP_COMMAND {
BaseType_t xCommandLength;
const char pcCommandName[7];
const unsigned char ucCommandType;
const unsigned char checkLogin;
const unsigned char checkNullArg;
} FTPCommand_t;
#define FTP_CMD_COUNT (ECMD_UNKNOWN+1)
extern const FTPCommand_t xFTPCommands[ FTP_CMD_COUNT ];
#endif // __FTPCMD_H__

View File

@ -0,0 +1,67 @@
/*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
#ifndef FREERTOS_HTTP_COMMANDS_H
#define FREERTOS_HTTP_COMMANDS_H
enum {
WEB_REPLY_OK = 200,
WEB_NO_CONTENT = 204,
WEB_BAD_REQUEST = 400,
WEB_UNAUTHORIZED = 401,
WEB_NOT_FOUND = 404,
WEB_GONE = 410,
WEB_PRECONDITION_FAILED = 412,
WEB_INTERNAL_SERVER_ERROR = 500,
};
enum EWebCommand {
ECMD_GET,
ECMD_HEAD,
ECMD_POST,
ECMD_PUT,
ECMD_DELETE,
ECMD_TRACE,
ECMD_OPTIONS,
ECMD_CONNECT,
ECMD_PATCH,
ECMD_UNK,
};
struct xWEB_COMMAND
{
BaseType_t xCommandLength;
const char *pcCommandName;
const unsigned char ucCommandType;
};
#define WEB_CMD_COUNT (ECMD_UNK+1)
extern const struct xWEB_COMMAND xWebCommands[WEB_CMD_COUNT];
extern const char *webCodename (int aCode);
#endif /* FREERTOS_HTTP_COMMANDS_H */

View File

@ -0,0 +1,125 @@
/*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/*
Some code which is common to TCP servers like HTTP en FTP
*/
#ifndef FREERTOS_TCP_SERVER_H
#define FREERTOS_TCP_SERVER_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef FTP_SERVER_USES_RELATIVE_DIRECTORY
#define FTP_SERVER_USES_RELATIVE_DIRECTORY 0
#endif
enum eSERVER_TYPE
{
eSERVER_NONE,
eSERVER_HTTP,
eSERVER_FTP,
};
struct xFTP_CLIENT;
#if( ipconfigFTP_HAS_RECEIVED_HOOK != 0 )
extern void vApplicationFTPReceivedHook( const char *pcFileName, uint32_t ulSize, struct xFTP_CLIENT *pxFTPClient );
extern void vFTPReplyMessage( struct xFTP_CLIENT *pxFTPClient, const char *pcMessage );
#endif /* ipconfigFTP_HAS_RECEIVED_HOOK != 0 */
#if( ipconfigFTP_HAS_USER_PASSWORD_HOOK != 0 )
/*
* Function is called when a user name has been submitted.
* The function may return a string such as: "331 Please enter your password"
* or return NULL to use the default reply.
*/
extern const char *pcApplicationFTPUserHook( const char *pcUserName );
#endif /* ipconfigFTP_HAS_USER_PASSWORD_HOOK */
#if( ipconfigFTP_HAS_USER_PASSWORD_HOOK != 0 )
/*
* Function is called when a password was received.
* Return positive value to allow the user
*/
extern BaseType_t xApplicationFTPPasswordHook( const char *pcUserName, const char *pcPassword );
#endif /* ipconfigFTP_HAS_USER_PASSWORD_HOOK */
#if( ipconfigFTP_HAS_USER_PROPERTIES_HOOK != 0 )
/*
* The FTP server is asking for user-specific properties
*/
typedef struct
{
uint16_t usPortNumber; /* For reference only. Host-endian. */
const char *pcRootDir;
BaseType_t xReadOnly;
}
FTPUserProperties_t;
extern void vApplicationFTPUserPropertiesHook( const char *pcUserName, FTPUserProperties_t *pxProperties );
#endif /* ipconfigFTP_HAS_USER_PASSWORD_HOOK */
#if( ipconfigHTTP_HAS_HANDLE_REQUEST_HOOK != 0 )
/*
* A GET request is received containing a special character,
* usually a question mark.
* const char *pcURLData; // A request, e.g. "/request?limit=75"
* char *pcBuffer; // Here the answer can be written
* size_t uxBufferLength; // Size of the buffer
*
*/
extern size_t uxApplicationHTTPHandleRequestHook( const char *pcURLData, char *pcBuffer, size_t uxBufferLength );
#endif /* ipconfigHTTP_HAS_HANDLE_REQUEST_HOOK */
struct xSERVER_CONFIG
{
enum eSERVER_TYPE eType; /* eSERVER_HTTP | eSERVER_FTP */
BaseType_t xPortNumber; /* e.g. 80, 8080, 21 */
BaseType_t xBackLog; /* e.g. 10, maximum number of connected TCP clients */
const char * const pcRootDir; /* Treat this directory as the root directory */
};
struct xTCP_SERVER;
typedef struct xTCP_SERVER TCPServer_t;
TCPServer_t *FreeRTOS_CreateTCPServer( const struct xSERVER_CONFIG *pxConfigs, BaseType_t xCount );
void FreeRTOS_TCPServerWork( TCPServer_t *pxServer, TickType_t xBlockingTime );
#if( ipconfigSUPPORT_SIGNALS != 0 )
/* FreeRTOS_TCPServerWork() calls select().
The two functions below provide a possibility to interrupt
the call to select(). After the interruption, resume
by calling FreeRTOS_TCPServerWork() again. */
BaseType_t FreeRTOS_TCPServerSignal( TCPServer_t *pxServer );
BaseType_t FreeRTOS_TCPServerSignalFromISR( TCPServer_t *pxServer, BaseType_t *pxHigherPriorityTaskWoken );
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* FREERTOS_TCP_SERVER_H */

View File

@ -0,0 +1,185 @@
/*
* FreeRTOS+TCP V2.0.3
* Copyright (C) 2017 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.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/*
Some code which is common to TCP servers like HTTP and FTP
*/
#ifndef FREERTOS_SERVER_PRIVATE_H
#define FREERTOS_SERVER_PRIVATE_H
#define FREERTOS_NO_SOCKET NULL
/* FreeRTOS+FAT */
#include "ff_stdio.h"
/* Each HTTP server has 1, at most 2 sockets */
#define HTTP_SOCKET_COUNT 2
/*
* ipconfigTCP_COMMAND_BUFFER_SIZE sets the size of:
* pcCommandBuffer': a buffer to receive and send TCP commands
*
* ipconfigTCP_FILE_BUFFER_SIZE sets the size of:
* pcFileBuffer' : a buffer to access the file system: read or write data.
*
* The buffers are both used for FTP as well as HTTP.
*/
#ifndef ipconfigTCP_COMMAND_BUFFER_SIZE
#define ipconfigTCP_COMMAND_BUFFER_SIZE ( 2048 )
#endif
#ifndef ipconfigTCP_FILE_BUFFER_SIZE
#define ipconfigTCP_FILE_BUFFER_SIZE ( 2048 )
#endif
struct xTCP_CLIENT;
typedef BaseType_t ( * FTCPWorkFunction ) ( struct xTCP_CLIENT * /* pxClient */ );
typedef void ( * FTCPDeleteFunction ) ( struct xTCP_CLIENT * /* pxClient */ );
#define TCP_CLIENT_FIELDS \
enum eSERVER_TYPE eType; \
struct xTCP_SERVER *pxParent; \
Socket_t xSocket; \
const char *pcRootDir; \
FTCPWorkFunction fWorkFunction; \
FTCPDeleteFunction fDeleteFunction; \
struct xTCP_CLIENT *pxNextClient
typedef struct xTCP_CLIENT
{
/* This define contains fields which must come first within each of the client structs */
TCP_CLIENT_FIELDS;
/* --- Keep at the top --- */
} TCPClient_t;
struct xHTTP_CLIENT
{
/* This define contains fields which must come first within each of the client structs */
TCP_CLIENT_FIELDS;
/* --- Keep at the top --- */
const char *pcUrlData;
const char *pcRestData;
char pcCurrentFilename[ ffconfigMAX_FILENAME ];
size_t uxBytesLeft;
FF_FILE *pxFileHandle;
union {
struct {
uint32_t
bReplySent : 1;
};
uint32_t ulFlags;
} bits;
};
typedef struct xHTTP_CLIENT HTTPClient_t;
struct xFTP_CLIENT
{
/* This define contains fields which must come first within each of the client structs */
TCP_CLIENT_FIELDS;
/* --- Keep at the top --- */
uint32_t ulRestartOffset;
uint32_t ulRecvBytes;
size_t uxBytesLeft; /* Bytes left to send */
uint32_t ulClientIP;
TickType_t xStartTime;
uint16_t usClientPort;
Socket_t xTransferSocket;
BaseType_t xTransType;
BaseType_t xDirCount;
FF_FindData_t xFindData;
FF_FILE *pxReadHandle;
FF_FILE *pxWriteHandle;
char pcCurrentDir[ ffconfigMAX_FILENAME ];
char pcFileName[ ffconfigMAX_FILENAME ];
char pcConnectionAck[ 128 ];
char pcClientAck[ 128 ];
union {
struct {
uint32_t
bHelloSent : 1,
bLoggedIn : 1,
bStatusUser : 1,
bInRename : 1,
bReadOnly : 1;
};
uint32_t ulFTPFlags;
} bits;
union {
struct {
uint32_t
bIsListen : 1, /* pdTRUE for passive data connections (using list()). */
bDirHasEntry : 1, /* pdTRUE if ff_findfirst() was successful. */
bClientConnected : 1, /* pdTRUE after connect() or accept() has succeeded. */
bEmptyFile : 1, /* pdTRUE if a connection-without-data was received. */
bHadError : 1; /* pdTRUE if a transfer got aborted because of an error. */
};
uint32_t ulConnFlags;
} bits1;
};
typedef struct xFTP_CLIENT FTPClient_t;
BaseType_t xHTTPClientWork( TCPClient_t *pxClient );
BaseType_t xFTPClientWork( TCPClient_t *pxClient );
void vHTTPClientDelete( TCPClient_t *pxClient );
void vFTPClientDelete( TCPClient_t *pxClient );
BaseType_t xMakeAbsolute( struct xFTP_CLIENT *pxClient, char *pcBuffer, BaseType_t xBufferLength, const char *pcFileName );
BaseType_t xMakeRelative( FTPClient_t *pxClient, char *pcBuffer, BaseType_t xBufferLength, const char *pcFileName );
struct xTCP_SERVER
{
SocketSet_t xSocketSet;
/* A buffer to receive and send TCP commands, either HTTP of FTP. */
char pcCommandBuffer[ ipconfigTCP_COMMAND_BUFFER_SIZE ];
/* A buffer to access the file system: read or write data. */
char pcFileBuffer[ ipconfigTCP_FILE_BUFFER_SIZE ];
#if( ipconfigUSE_FTP != 0 )
char pcNewDir[ ffconfigMAX_FILENAME ];
#endif
#if( ipconfigUSE_HTTP != 0 )
char pcContentsType[40]; /* Space for the msg: "text/javascript" */
char pcExtraContents[40]; /* Space for the msg: "Content-Length: 346500" */
#endif
BaseType_t xServerCount;
TCPClient_t *pxClients;
struct xSERVER
{
enum eSERVER_TYPE eType; /* eSERVER_HTTP | eSERVER_FTP */
const char *pcRootDir;
Socket_t xSocket;
} xServers[ 1 ];
};
#endif /* FREERTOS_SERVER_PRIVATE_H */

View File

@ -0,0 +1,71 @@
//
// ntpClient.h
//
#ifndef __NTPCLIENT_H__
#define __NTPCLIENT_H__
#define NTP_PORT 123
typedef uint32_t quint32;
typedef int32_t qint32;
typedef uint8_t quint8;
typedef int8_t qint8;
typedef union _SNtpFlags SNtpFlags;
/**
* 64-bit NTP timestamp.
*/
struct __attribute__ ((__packed__)) _SNtpTimestamp {
/** Number of seconds passed since Jan 1 1900, in big-endian format. */
quint32 seconds;
/** Fractional time part, in <tt>1/0xFFFFFFFF</tt>s of a second. */
quint32 fraction;
};
typedef struct _SNtpTimestamp SNtpTimestamp;
/**
* Mandatory part of an NTP packet
*/
struct SNtpPacket {
/** Flags. */
unsigned char flags; // value 0xDB : mode 3 (client), version 3, leap indicator unknown 3
/** Stratum of the clock. */
quint8 stratum; // value 0 : unspecified
/** Maximum interval between successive messages, in log2 seconds. Note that the value is signed. */
qint8 poll; // 10 means 1 << 10 = 1024 seconds
/** Precision of the clock, in log2 seconds. Note that the value is signed. */
qint8 precision; // 0xFA = 250 = 0.015625 seconds
/** Round trip time to the primary reference source, in NTP short format. */
qint32 rootDelay; // 0x5D2E = 23854 or (23854/65535)= 0.3640 sec
/** Nominal error relative to the primary reference source. */
qint32 rootDispersion; // 0x0008 CAC8 = 8.7912 seconds
/** Reference identifier (either a 4 character string or an IP address). */
qint8 referenceID[4]; // or just 0000
/** The time at which the clock was last set or corrected. */
SNtpTimestamp referenceTimestamp; // Current time
/** The time at which the request departed the client for the server. */
SNtpTimestamp originateTimestamp; // Keep 0
/** The time at which the request arrived at the server. */
SNtpTimestamp receiveTimestamp; // Keep 0
/** The time at which the reply departed the server for client. */
SNtpTimestamp transmitTimestamp;
};
/* Add this number to get secs since 1-1-1900 */
#define TIME1970 2208988800UL
#endif // __NTPCLIENT_H__

View File

@ -0,0 +1,11 @@
/*
* A simple demo for NTP using FreeRTOS+TCP
*/
#ifndef NTPDEMO_H
#define NTPDEMO_H
void vStartNTPTask( uint16_t usTaskStackSize, UBaseType_t uxTaskPriority );
#endif

View File

@ -0,0 +1,3 @@
The protocols implemented in the files and folders in this directory and its
subdirectories are intended to be demo quality examples only. They are not
intended for inclusion in production devices.

View File

@ -0,0 +1,530 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* FreeRTOS+CLI includes. */
#include "FreeRTOS_CLI.h"
/* File system includes. */
#include "fat_sl.h"
#include "api_mdriver_ram.h"
#ifdef _WINDOWS_
#define snprintf _snprintf
#endif
#define cliNEW_LINE "\r\n"
/*******************************************************************************
* See the URL in the comments within main.c for the location of the online
* documentation.
******************************************************************************/
/*
* Print out information on a single file.
*/
static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct );
/*
* Copies an existing file into a newly created file.
*/
static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength,
const char *pcDestinationFile,
char *pxWriteBuffer,
size_t xWriteBufferLen );
/*
* Implements the DIR command.
*/
static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the CD command.
*/
static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the DEL command.
*/
static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the TYPE command.
*/
static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the COPY command.
*/
static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the DIR command line command, which lists all the
files in the current directory. */
static const CLI_Command_Definition_t xDIR =
{
"dir", /* The command string to type. */
"\r\ndir:\r\n Lists the files in the current directory\r\n",
prvDIRCommand, /* The function to run. */
0 /* No parameters are expected. */
};
/* Structure that defines the CD command line command, which changes the
working directory. */
static const CLI_Command_Definition_t xCD =
{
"cd", /* The command string to type. */
"\r\ncd <dir name>:\r\n Changes the working directory\r\n",
prvCDCommand, /* The function to run. */
1 /* One parameter is expected. */
};
/* Structure that defines the TYPE command line command, which prints the
contents of a file to the console. */
static const CLI_Command_Definition_t xTYPE =
{
"type", /* The command string to type. */
"\r\ntype <filename>:\r\n Prints file contents to the terminal\r\n",
prvTYPECommand, /* The function to run. */
1 /* One parameter is expected. */
};
/* Structure that defines the DEL command line command, which deletes a file. */
static const CLI_Command_Definition_t xDEL =
{
"del", /* The command string to type. */
"\r\ndel <filename>:\r\n deletes a file or directory\r\n",
prvDELCommand, /* The function to run. */
1 /* One parameter is expected. */
};
/* Structure that defines the COPY command line command, which deletes a file. */
static const CLI_Command_Definition_t xCOPY =
{
"copy", /* The command string to type. */
"\r\ncopy <source file> <dest file>:\r\n Copies <source file> to <dest file>\r\n",
prvCOPYCommand, /* The function to run. */
2 /* Two parameters are expected. */
};
/*-----------------------------------------------------------*/
void vRegisterFileSystemCLICommands( void )
{
/* Register all the command line commands defined immediately above. */
FreeRTOS_CLIRegisterCommand( &xDIR );
FreeRTOS_CLIRegisterCommand( &xCD );
FreeRTOS_CLIRegisterCommand( &xTYPE );
FreeRTOS_CLIRegisterCommand( &xDEL );
FreeRTOS_CLIRegisterCommand( &xCOPY );
}
/*-----------------------------------------------------------*/
static BaseType_t prvTYPECommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength, xReturn = pdTRUE;
static F_FILE *pxFile = NULL;
int iChar;
size_t xByte;
size_t xColumns = 50U;
/* Ensure there is always a null terminator after each character written. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
/* Ensure the buffer leaves space for the \r\n. */
configASSERT( xWriteBufferLen > ( strlen( cliNEW_LINE ) * 2 ) );
xWriteBufferLen -= strlen( cliNEW_LINE );
if( xWriteBufferLen < xColumns )
{
/* Ensure the loop that uses xColumns as an end condition does not
write off the end of the buffer. */
xColumns = xWriteBufferLen;
}
if( pxFile == NULL )
{
/* The file has not been opened yet. Find the file name. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Attempt to open the requested file. */
pxFile = f_open( pcParameter, "r" );
}
if( pxFile != NULL )
{
/* Read the next chunk of data from the file. */
for( xByte = 0; xByte < xColumns; xByte++ )
{
iChar = f_getc( pxFile );
if( iChar == -1 )
{
/* No more characters to return. */
f_close( pxFile );
pxFile = NULL;
break;
}
else
{
pcWriteBuffer[ xByte ] = ( char ) iChar;
}
}
}
if( pxFile == NULL )
{
/* Either the file was not opened, or all the data from the file has
been returned and the file is now closed. */
xReturn = pdFALSE;
}
strcat( pcWriteBuffer, cliNEW_LINE );
return xReturn;
}
/*-----------------------------------------------------------*/
static BaseType_t prvCDCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength;
unsigned char ucReturned;
size_t xStringLength;
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Attempt to move to the requested directory. */
ucReturned = f_chdir( pcParameter );
if( ucReturned == F_NO_ERROR )
{
sprintf( pcWriteBuffer, "In: " );
xStringLength = strlen( pcWriteBuffer );
f_getcwd( &( pcWriteBuffer[ xStringLength ] ), ( unsigned char ) ( xWriteBufferLen - xStringLength ) );
}
else
{
sprintf( pcWriteBuffer, "Error" );
}
strcat( pcWriteBuffer, cliNEW_LINE );
return pdFALSE;
}
/*-----------------------------------------------------------*/
static BaseType_t prvDIRCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
static F_FIND *pxFindStruct = NULL;
unsigned char ucReturned;
BaseType_t xReturn = pdFALSE;
/* This assumes pcWriteBuffer is long enough. */
( void ) pcCommandString;
/* Ensure the buffer leaves space for the \r\n. */
configASSERT( xWriteBufferLen > ( strlen( cliNEW_LINE ) * 2 ) );
xWriteBufferLen -= strlen( cliNEW_LINE );
if( pxFindStruct == NULL )
{
/* This is the first time this function has been executed since the Dir
command was run. Create the find structure. */
pxFindStruct = ( F_FIND * ) pvPortMalloc( sizeof( F_FIND ) );
if( pxFindStruct != NULL )
{
ucReturned = f_findfirst( "*.*", pxFindStruct );
if( ucReturned == F_NO_ERROR )
{
prvCreateFileInfoString( pcWriteBuffer, pxFindStruct );
xReturn = pdPASS;
}
else
{
snprintf( pcWriteBuffer, xWriteBufferLen, "Error: f_findfirst() failed." );
}
}
else
{
snprintf( pcWriteBuffer, xWriteBufferLen, "Failed to allocate RAM (using heap_4.c will prevent fragmentation)." );
}
}
else
{
/* The find struct has already been created. Find the next file in
the directory. */
ucReturned = f_findnext( pxFindStruct );
if( ucReturned == F_NO_ERROR )
{
prvCreateFileInfoString( pcWriteBuffer, pxFindStruct );
xReturn = pdPASS;
}
else
{
/* There are no more files. Free the find structure. */
vPortFree( pxFindStruct );
pxFindStruct = NULL;
/* No string to return. */
pcWriteBuffer[ 0 ] = 0x00;
}
}
strcat( pcWriteBuffer, cliNEW_LINE );
return xReturn;
}
/*-----------------------------------------------------------*/
static BaseType_t prvDELCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength;
unsigned char ucReturned;
/* This function assumes xWriteBufferLen is large enough! */
( void ) xWriteBufferLen;
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Attempt to delete the file. */
ucReturned = f_delete( pcParameter );
if( ucReturned == F_NO_ERROR )
{
sprintf( pcWriteBuffer, "%s was deleted", pcParameter );
}
else
{
sprintf( pcWriteBuffer, "Error" );
}
strcat( pcWriteBuffer, cliNEW_LINE );
return pdFALSE;
}
/*-----------------------------------------------------------*/
static BaseType_t prvCOPYCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
char *pcSourceFile, *pcDestinationFile;
BaseType_t xParameterStringLength;
long lSourceLength, lDestinationLength = 0;
/* Obtain the name of the destination file. */
pcDestinationFile = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
2, /* Return the second parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcDestinationFile );
/* Obtain the name of the source file. */
pcSourceFile = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcSourceFile );
/* Terminate the string. */
pcSourceFile[ xParameterStringLength ] = 0x00;
/* See if the source file exists, obtain its length if it does. */
lSourceLength = f_filelength( pcSourceFile );
if( lSourceLength == 0 )
{
sprintf( pcWriteBuffer, "Source file does not exist" );
}
else
{
/* See if the destination file exists. */
lDestinationLength = f_filelength( pcDestinationFile );
if( lDestinationLength != 0 )
{
sprintf( pcWriteBuffer, "Error: Destination file already exists" );
}
}
/* Continue only if the source file exists and the destination file does
not exist. */
if( ( lSourceLength != 0 ) && ( lDestinationLength == 0 ) )
{
if( prvPerformCopy( pcSourceFile, lSourceLength, pcDestinationFile, pcWriteBuffer, xWriteBufferLen ) == pdPASS )
{
sprintf( pcWriteBuffer, "Copy made" );
}
else
{
sprintf( pcWriteBuffer, "Error during copy" );
}
}
strcat( pcWriteBuffer, cliNEW_LINE );
return pdFALSE;
}
/*-----------------------------------------------------------*/
static BaseType_t prvPerformCopy( const char *pcSourceFile,
int32_t lSourceFileLength,
const char *pcDestinationFile,
char *pxWriteBuffer,
size_t xWriteBufferLen )
{
int32_t lBytesRead = 0, lBytesToRead, lBytesRemaining;
F_FILE *pxFile;
BaseType_t xReturn = pdPASS;
/* NOTE: Error handling has been omitted for clarity. */
while( lBytesRead < lSourceFileLength )
{
/* How many bytes are left? */
lBytesRemaining = lSourceFileLength - lBytesRead;
/* How many bytes should be read this time around the loop. Can't
read more bytes than will fit into the buffer. */
if( lBytesRemaining > ( long ) xWriteBufferLen )
{
lBytesToRead = ( long ) xWriteBufferLen;
}
else
{
lBytesToRead = lBytesRemaining;
}
/* Open the source file, seek past the data that has already been
read from the file, read the next block of data, then close the
file again so the destination file can be opened. */
pxFile = f_open( pcSourceFile, "r" );
if( pxFile != NULL )
{
f_seek( pxFile, lBytesRead, F_SEEK_SET );
f_read( pxWriteBuffer, lBytesToRead, 1, pxFile );
f_close( pxFile );
}
else
{
xReturn = pdFAIL;
break;
}
/* Open the destination file and write the block of data to the end of
the file. */
pxFile = f_open( pcDestinationFile, "a" );
if( pxFile != NULL )
{
f_write( pxWriteBuffer, lBytesToRead, 1, pxFile );
f_close( pxFile );
}
else
{
xReturn = pdFAIL;
break;
}
lBytesRead += lBytesToRead;
}
return xReturn;
}
/*-----------------------------------------------------------*/
static void prvCreateFileInfoString( char *pcBuffer, F_FIND *pxFindStruct )
{
const char *pcWritableFile = "writable file", *pcReadOnlyFile = "read only file", *pcDirectory = "directory";
const char * pcAttrib;
/* Point pcAttrib to a string that describes the file. */
if( ( pxFindStruct->attr & F_ATTR_DIR ) != 0 )
{
pcAttrib = pcDirectory;
}
else if( pxFindStruct->attr & F_ATTR_READONLY )
{
pcAttrib = pcReadOnlyFile;
}
else
{
pcAttrib = pcWritableFile;
}
/* Create a string that includes the file name, the file size and the
attributes string. */
sprintf( pcBuffer, "%s [%s] [size=%d]", pxFindStruct->filename, pcAttrib, ( int ) pxFindStruct->filesize );
}

View File

@ -0,0 +1,480 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/******************************************************************************
*
* http://www.FreeRTOS.org/cli
*
******************************************************************************/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* FreeRTOS+CLI includes. */
#include "FreeRTOS_CLI.h"
#ifndef configINCLUDE_TRACE_RELATED_CLI_COMMANDS
#define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0
#endif
#ifndef configINCLUDE_QUERY_HEAP_COMMAND
#define configINCLUDE_QUERY_HEAP_COMMAND 0
#endif
/*
* The function that registers the commands that are defined within this file.
*/
void vRegisterSampleCLICommands( void );
/*
* Implements the task-stats command.
*/
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the run-time-stats command.
*/
#if( configGENERATE_RUN_TIME_STATS == 1 )
static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif /* configGENERATE_RUN_TIME_STATS */
/*
* Implements the echo-three-parameters command.
*/
static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the echo-parameters command.
*/
static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the "query heap" command.
*/
#if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )
static BaseType_t prvQueryHeapCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif
/*
* Implements the "trace start" and "trace stop" commands;
*/
#if( configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 )
static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif
/* Structure that defines the "task-stats" command line command. This generates
a table that gives information on each task in the system. */
static const CLI_Command_Definition_t xTaskStats =
{
"task-stats", /* The command string to type. */
"\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",
prvTaskStatsCommand, /* The function to run. */
0 /* No parameters are expected. */
};
/* Structure that defines the "echo_3_parameters" command line command. This
takes exactly three parameters that the command simply echos back one at a
time. */
static const CLI_Command_Definition_t xThreeParameterEcho =
{
"echo-3-parameters",
"\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",
prvThreeParameterEchoCommand, /* The function to run. */
3 /* Three parameters are expected, which can take any value. */
};
/* Structure that defines the "echo_parameters" command line command. This
takes a variable number of parameters that the command simply echos back one at
a time. */
static const CLI_Command_Definition_t xParameterEcho =
{
"echo-parameters",
"\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",
prvParameterEchoCommand, /* The function to run. */
-1 /* The user can enter any number of commands. */
};
#if( configGENERATE_RUN_TIME_STATS == 1 )
/* Structure that defines the "run-time-stats" command line command. This
generates a table that shows how much run time each task has */
static const CLI_Command_Definition_t xRunTimeStats =
{
"run-time-stats", /* The command string to type. */
"\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",
prvRunTimeStatsCommand, /* The function to run. */
0 /* No parameters are expected. */
};
#endif /* configGENERATE_RUN_TIME_STATS */
#if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )
/* Structure that defines the "query_heap" command line command. */
static const CLI_Command_Definition_t xQueryHeap =
{
"query-heap",
"\r\nquery-heap:\r\n Displays the free heap space, and minimum ever free heap space.\r\n",
prvQueryHeapCommand, /* The function to run. */
0 /* The user can enter any number of commands. */
};
#endif /* configQUERY_HEAP_COMMAND */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
/* Structure that defines the "trace" command line command. This takes a single
parameter, which can be either "start" or "stop". */
static const CLI_Command_Definition_t xStartStopTrace =
{
"trace",
"\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",
prvStartStopTraceCommand, /* The function to run. */
1 /* One parameter is expected. Valid values are "start" and "stop". */
};
#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
/*-----------------------------------------------------------*/
void vRegisterSampleCLICommands( void )
{
/* Register all the command line commands defined immediately above. */
FreeRTOS_CLIRegisterCommand( &xTaskStats );
FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );
FreeRTOS_CLIRegisterCommand( &xParameterEcho );
#if( configGENERATE_RUN_TIME_STATS == 1 )
{
FreeRTOS_CLIRegisterCommand( &xRunTimeStats );
}
#endif
#if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )
{
FreeRTOS_CLIRegisterCommand( &xQueryHeap );
}
#endif
#if( configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 )
{
FreeRTOS_CLIRegisterCommand( &xStartStopTrace );
}
#endif
}
/*-----------------------------------------------------------*/
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *const pcHeader = " State Priority Stack #\r\n************************************************\r\n";
BaseType_t xSpacePadding;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
strcpy( pcWriteBuffer, "Task" );
pcWriteBuffer += strlen( pcWriteBuffer );
/* Minus three for the null terminator and half the number of characters in
"Task" so the column lines up with the centre of the heading. */
configASSERT( configMAX_TASK_NAME_LEN > 3 );
for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
{
/* Add a space to align columns after the task's name. */
*pcWriteBuffer = ' ';
pcWriteBuffer++;
/* Ensure always terminated. */
*pcWriteBuffer = 0x00;
}
strcpy( pcWriteBuffer, pcHeader );
vTaskList( pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
/*-----------------------------------------------------------*/
#if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )
static BaseType_t prvQueryHeapCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
sprintf( pcWriteBuffer, "Current free heap %d bytes, minimum ever free heap %d bytes\r\n", ( int ) xPortGetFreeHeapSize(), ( int ) xPortGetMinimumEverFreeHeapSize() );
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
#endif /* configINCLUDE_QUERY_HEAP */
/*-----------------------------------------------------------*/
#if( configGENERATE_RUN_TIME_STATS == 1 )
static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char * const pcHeader = " Abs Time % Time\r\n****************************************\r\n";
BaseType_t xSpacePadding;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
strcpy( pcWriteBuffer, "Task" );
pcWriteBuffer += strlen( pcWriteBuffer );
/* Pad the string "task" with however many bytes necessary to make it the
length of a task name. Minus three for the null terminator and half the
number of characters in "Task" so the column lines up with the centre of
the heading. */
for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
{
/* Add a space to align columns after the task's name. */
*pcWriteBuffer = ' ';
pcWriteBuffer++;
/* Ensure always terminated. */
*pcWriteBuffer = 0x00;
}
strcpy( pcWriteBuffer, pcHeader );
vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
#endif /* configGENERATE_RUN_TIME_STATS */
/*-----------------------------------------------------------*/
static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength, xReturn;
static UBaseType_t uxParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
if( uxParameterNumber == 0 )
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
sprintf( pcWriteBuffer, "The three parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
uxParameterNumber = 1U;
/* There is more data to be returned as no parameters have been echoed
back yet. */
xReturn = pdPASS;
}
else
{
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
uxParameterNumber, /* Return the next parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", ( int ) uxParameterNumber );
strncat( pcWriteBuffer, pcParameter, ( size_t ) xParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
if( uxParameterNumber == 3U )
{
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
xReturn = pdFALSE;
uxParameterNumber = 0;
}
else
{
/* There are more parameters to return after this one. */
xReturn = pdTRUE;
uxParameterNumber++;
}
}
return xReturn;
}
/*-----------------------------------------------------------*/
static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength, xReturn;
static UBaseType_t uxParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
if( uxParameterNumber == 0 )
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
sprintf( pcWriteBuffer, "The parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
uxParameterNumber = 1U;
/* There is more data to be returned as no parameters have been echoed
back yet. */
xReturn = pdPASS;
}
else
{
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
uxParameterNumber, /* Return the next parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
if( pcParameter != NULL )
{
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", ( int ) uxParameterNumber );
strncat( pcWriteBuffer, ( char * ) pcParameter, ( size_t ) xParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* There might be more parameters to return after this one. */
xReturn = pdTRUE;
uxParameterNumber++;
}
else
{
/* No more parameters were found. Make sure the write buffer does
not contain a valid string. */
pcWriteBuffer[ 0 ] = 0x00;
/* No more data to return. */
xReturn = pdFALSE;
/* Start over the next time this command is executed. */
uxParameterNumber = 0;
}
}
return xReturn;
}
/*-----------------------------------------------------------*/
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* There are only two valid parameter values. */
if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )
{
/* Start or restart the trace. */
vTraceStop();
vTraceClear();
vTraceStart();
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
}
else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )
{
/* End the trace, if one is running. */
vTraceStop();
sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );
}
else
{
sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
}
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */

View File

@ -0,0 +1,226 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/*
* NOTE: This file uses a third party USB CDC driver.
*/
/* Standard includes. */
#include "string.h"
#include "stdio.h"
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* Example includes. */
#include "FreeRTOS_CLI.h"
/* Demo application includes. */
#include "serial.h"
/* Dimensions the buffer into which input characters are placed. */
#define cmdMAX_INPUT_SIZE 50
/* Dimentions a buffer to be used by the UART driver, if the UART driver uses a
buffer at all. */
#define cmdQUEUE_LENGTH 25
/* DEL acts as a backspace. */
#define cmdASCII_DEL ( 0x7F )
/* The maximum time to wait for the mutex that guards the UART to become
available. */
#define cmdMAX_MUTEX_WAIT pdMS_TO_TICKS( 300 )
#ifndef configCLI_BAUD_RATE
#define configCLI_BAUD_RATE 115200
#endif
/*-----------------------------------------------------------*/
/*
* The task that implements the command console processing.
*/
static void prvUARTCommandConsoleTask( void *pvParameters );
void vUARTCommandConsoleStart( uint16_t usStackSize, UBaseType_t uxPriority );
/*-----------------------------------------------------------*/
/* Const messages output by the command console. */
static const char * const pcWelcomeMessage = "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";
static const char * const pcEndOfOutputMessage = "\r\n[Press ENTER to execute the previous command again]\r\n>";
static const char * const pcNewLine = "\r\n";
/* Used to guard access to the UART in case messages are sent to the UART from
more than one task. */
static SemaphoreHandle_t xTxMutex = NULL;
/* The handle to the UART port, which is not used by all ports. */
static xComPortHandle xPort = 0;
/*-----------------------------------------------------------*/
void vUARTCommandConsoleStart( uint16_t usStackSize, UBaseType_t uxPriority )
{
/* Create the semaphore used to access the UART Tx. */
xTxMutex = xSemaphoreCreateMutex();
configASSERT( xTxMutex );
/* Create that task that handles the console itself. */
xTaskCreate( prvUARTCommandConsoleTask, /* The task that implements the command console. */
"CLI", /* Text name assigned to the task. This is just to assist debugging. The kernel does not use this name itself. */
usStackSize, /* The size of the stack allocated to the task. */
NULL, /* The parameter is not used, so NULL is passed. */
uxPriority, /* The priority allocated to the task. */
NULL ); /* A handle is not required, so just pass NULL. */
}
/*-----------------------------------------------------------*/
static void prvUARTCommandConsoleTask( void *pvParameters )
{
signed char cRxedChar;
uint8_t ucInputIndex = 0;
char *pcOutputString;
static char cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];
BaseType_t xReturned;
xComPortHandle xPort;
( void ) pvParameters;
/* Obtain the address of the output buffer. Note there is no mutual
exclusion on this buffer as it is assumed only one command console interface
will be used at any one time. */
pcOutputString = FreeRTOS_CLIGetOutputBuffer();
/* Initialise the UART. */
xPort = xSerialPortInitMinimal( configCLI_BAUD_RATE, cmdQUEUE_LENGTH );
/* Send the welcome message. */
vSerialPutString( xPort, ( signed char * ) pcWelcomeMessage, ( unsigned short ) strlen( pcWelcomeMessage ) );
for( ;; )
{
/* Wait for the next character. The while loop is used in case
INCLUDE_vTaskSuspend is not set to 1 - in which case portMAX_DELAY will
be a genuine block time rather than an infinite block time. */
while( xSerialGetChar( xPort, &cRxedChar, portMAX_DELAY ) != pdPASS );
/* Ensure exclusive access to the UART Tx. */
if( xSemaphoreTake( xTxMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )
{
/* Echo the character back. */
xSerialPutChar( xPort, cRxedChar, portMAX_DELAY );
/* Was it the end of the line? */
if( cRxedChar == '\n' || cRxedChar == '\r' )
{
/* Just to space the output from the input. */
vSerialPutString( xPort, ( signed char * ) pcNewLine, ( unsigned short ) strlen( pcNewLine ) );
/* See if the command is empty, indicating that the last command
is to be executed again. */
if( ucInputIndex == 0 )
{
/* Copy the last command back into the input string. */
strcpy( cInputString, cLastInputString );
}
/* Pass the received command to the command interpreter. The
command interpreter is called repeatedly until it returns
pdFALSE (indicating there is no more output) as it might
generate more than one string. */
do
{
/* Get the next output string from the command interpreter. */
xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );
/* Write the generated string to the UART. */
vSerialPutString( xPort, ( signed char * ) pcOutputString, ( unsigned short ) strlen( pcOutputString ) );
} while( xReturned != pdFALSE );
/* All the strings generated by the input command have been
sent. Clear the input string ready to receive the next command.
Remember the command that was just processed first in case it is
to be processed again. */
strcpy( cLastInputString, cInputString );
ucInputIndex = 0;
memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );
vSerialPutString( xPort, ( signed char * ) pcEndOfOutputMessage, ( unsigned short ) strlen( pcEndOfOutputMessage ) );
}
else
{
if( cRxedChar == '\r' )
{
/* Ignore the character. */
}
else if( ( cRxedChar == '\b' ) || ( cRxedChar == cmdASCII_DEL ) )
{
/* Backspace was pressed. Erase the last character in the
string - if any. */
if( ucInputIndex > 0 )
{
ucInputIndex--;
cInputString[ ucInputIndex ] = '\0';
}
}
else
{
/* A character was entered. Add it to the string entered so
far. When a \n is entered the complete string will be
passed to the command interpreter. */
if( ( cRxedChar >= ' ' ) && ( cRxedChar <= '~' ) )
{
if( ucInputIndex < cmdMAX_INPUT_SIZE )
{
cInputString[ ucInputIndex ] = cRxedChar;
ucInputIndex++;
}
}
}
}
/* Must ensure to give the mutex back. */
xSemaphoreGive( xTxMutex );
}
}
}
/*-----------------------------------------------------------*/
void vOutputString( const char * const pcMessage )
{
if( xSemaphoreTake( xTxMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )
{
vSerialPutString( xPort, ( signed char * ) pcMessage, ( unsigned short ) strlen( pcMessage ) );
xSemaphoreGive( xTxMutex );
}
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,313 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/******************************************************************************
*
* See the following URL for information on the commands defined in this file:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml
*
******************************************************************************/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
/* FreeRTOS+CLI includes. */
#include "FreeRTOS_CLI.h"
/* FreeRTOS+UDP includes, just to make the stats available to the CLI
commands. */
#include "FreeRTOS_UDP_IP.h"
#include "FreeRTOS_Sockets.h"
/*
* Defines a command that prints out IP address information.
*/
static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Defines a command that prints out the gathered demo debug stats.
*/
static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Defines a command that sends an ICMP ping request to an IP address.
*/
static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/* Structure that defines the "ip-config" command line command. */
static const CLI_Command_Definition_t xIPConfig =
{
"ip-config",
"ip-config:\r\n Displays IP address configuration\r\n\r\n",
prvDisplayIPConfig,
0
};
#if configINCLUDE_DEMO_DEBUG_STATS != 0
/* Structure that defines the "ip-debug-stats" command line command. */
static const CLI_Command_Definition_t xIPDebugStats =
{
"ip-debug-stats", /* The command string to type. */
"ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",
prvDisplayIPDebugStats, /* The function to run. */
0 /* No parameters are expected. */
};
#endif /* configINCLUDE_DEMO_DEBUG_STATS */
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
/* Structure that defines the "ping" command line command. This takes an IP
address or host name and (optionally) the number of bytes to ping as
parameters. */
static const CLI_Command_Definition_t xPing =
{
"ping",
"ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",
prvPingCommand, /* The function to run. */
-1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */
};
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
/*-----------------------------------------------------------*/
void vRegisterUDPCLICommands( void )
{
/* Register all the command line commands defined immediately above. */
FreeRTOS_CLIRegisterCommand( &xIPConfig );
#if configINCLUDE_DEMO_DEBUG_STATS == 1
{
FreeRTOS_CLIRegisterCommand( &xIPDebugStats );
}
#endif /* configINCLUDE_DEMO_DEBUG_STATS */
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
{
FreeRTOS_CLIRegisterCommand( &xPing );
}
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
}
/*-----------------------------------------------------------*/
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
char * pcParameter;
BaseType_t lParameterStringLength, xReturn;
uint32_t ulIPAddress, ulBytesToPing;
const uint32_t ulDefaultBytesToPing = 8UL;
char cBuffer[ 16 ];
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Start with an empty string. */
pcWriteBuffer[ 0 ] = 0x00;
/* Obtain the number of bytes to ping. */
pcParameter = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
2, /* Return the second parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
if( pcParameter == NULL )
{
/* The number of bytes was not specified, so default it. */
ulBytesToPing = ulDefaultBytesToPing;
}
else
{
ulBytesToPing = atol( pcParameter );
}
/* Obtain the IP address string. */
pcParameter = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Attempt to obtain the IP address. If the first character is not a
digit, assume the host name has been passed in. */
if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )
{
ulIPAddress = FreeRTOS_inet_addr( pcParameter );
}
else
{
/* Terminate the host name. */
pcParameter[ lParameterStringLength ] = 0x00;
/* Attempt to resolve host. */
ulIPAddress = FreeRTOS_gethostbyname( pcParameter );
}
/* Convert IP address, which may have come from a DNS lookup, to string. */
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
if( ulIPAddress != 0 )
{
xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );
}
else
{
xReturn = pdFALSE;
}
if( xReturn == pdFALSE )
{
sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );
}
else
{
sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, ( int ) xReturn );
}
return pdFALSE;
}
/*-----------------------------------------------------------*/
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
#if configINCLUDE_DEMO_DEBUG_STATS != 0
static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
static BaseType_t xIndex = -1;
extern xExampleDebugStatEntry_t xIPTraceValues[];
BaseType_t xReturn;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
xIndex++;
if( xIndex < xExampleDebugStatEntries() )
{
sprintf( pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );
xReturn = pdPASS;
}
else
{
/* Reset the index for the next time it is called. */
xIndex = -1;
/* Ensure nothing remains in the write buffer. */
pcWriteBuffer[ 0 ] = 0x00;
xReturn = pdFALSE;
}
return xReturn;
}
/*-----------------------------------------------------------*/
#endif /* configINCLUDE_DEMO_DEBUG_STATS */
static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
static BaseType_t xIndex = 0;
BaseType_t xReturn;
uint32_t ulAddress;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
switch( xIndex )
{
case 0 :
FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
sprintf( pcWriteBuffer, "\r\nIP address " );
xReturn = pdTRUE;
xIndex++;
break;
case 1 :
FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
sprintf( pcWriteBuffer, "\r\nNet mask " );
xReturn = pdTRUE;
xIndex++;
break;
case 2 :
FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
sprintf( pcWriteBuffer, "\r\nGateway address " );
xReturn = pdTRUE;
xIndex++;
break;
case 3 :
FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
sprintf( pcWriteBuffer, "\r\nDNS server address " );
xReturn = pdTRUE;
xIndex++;
break;
default :
ulAddress = 0;
sprintf( pcWriteBuffer, "\r\n\r\n" );
xReturn = pdFALSE;
xIndex = 0;
break;
}
if( ulAddress != 0 )
{
FreeRTOS_inet_ntoa( ulAddress, ( &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) ) );
}
return xReturn;
}
/*-----------------------------------------------------------*/

View File

@ -0,0 +1,321 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/*******************************************************************************
* See the URL in the comments within main.c for the location of the online
* documentation.
******************************************************************************/
/* Standard includes. */
#include <stdio.h>
#include <string.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
/* File system includes. */
#include "fat_sl.h"
#include "api_mdriver_ram.h"
/* 8.3 format, plus null terminator. */
#define fsMAX_FILE_NAME_LEN 13
/* The number of bytes read/written to the example files at a time. */
#define fsRAM_BUFFER_SIZE 200
/* The number of bytes written to the file that uses f_putc() and f_getc(). */
#define fsPUTC_FILE_SIZE 100
/*-----------------------------------------------------------*/
/*
* Creates and verifies different files on the volume, demonstrating the use of
* various different API functions.
*/
void vCreateAndVerifySampleFiles( void );
/*
* Create a set of example files in the root directory of the volume using
* f_write().
*/
static void prvCreateDemoFilesUsing_f_write( void );
/*
* Use f_read() to read back and verify the files that were created by
* prvCreateDemoFilesUsing_f_write().
*/
static void prvVerifyDemoFileUsing_f_read( void );
/*
* Create an example file in a sub-directory using f_putc().
*/
static void prvCreateDemoFileUsing_f_putc( void );
/*
* Use f_getc() to read back and verify the file that was created by
* prvCreateDemoFileUsing_f_putc().
*/
static void prvVerifyDemoFileUsing_f_getc( void );
/*-----------------------------------------------------------*/
/* A buffer used to both create content to write to disk, and read content back
from a disk. Note there is no mutual exclusion on this buffer. */
static char cRAMBuffer[ fsRAM_BUFFER_SIZE ];
/* Names of directories that are created. */
static const char *pcRoot = "/", *pcDirectory1 = "SUB1", *pcDirectory2 = "SUB2", *pcFullPath = "/SUB1/SUB2";
/*-----------------------------------------------------------*/
void vCreateAndVerifySampleFiles( void )
{
unsigned char ucStatus;
/* First create the volume. */
ucStatus = f_initvolume( ram_initfunc );
/* It is expected that the volume is not formatted. */
if( ucStatus == F_ERR_NOTFORMATTED )
{
/* Format the created volume. */
ucStatus = f_format( F_FAT12_MEDIA );
}
if( ucStatus == F_NO_ERROR )
{
/* Create a set of files using f_write(). */
prvCreateDemoFilesUsing_f_write();
/* Read back and verify the files that were created using f_write(). */
prvVerifyDemoFileUsing_f_read();
/* Create sub directories two deep then create a file using putc. */
prvCreateDemoFileUsing_f_putc();
/* Read back and verify the file created by
prvCreateDemoFileUsing_f_putc(). */
prvVerifyDemoFileUsing_f_getc();
}
}
/*-----------------------------------------------------------*/
static void prvCreateDemoFilesUsing_f_write( void )
{
BaseType_t xFileNumber, xWriteNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ];
const BaseType_t xMaxFiles = 5;
long lItemsWritten;
F_FILE *pxFile;
/* Create xMaxFiles files. Each created file will be
( xFileNumber * fsRAM_BUFFER_SIZE ) bytes in length, and filled
with a different repeating character. */
for( xFileNumber = 1; xFileNumber <= xMaxFiles; xFileNumber++ )
{
/* Generate a file name. */
sprintf( cFileName, "root%03d.txt", ( int ) xFileNumber );
/* Obtain the current working directory and print out the file name and
the directory into which the file is being written. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
/* Open the file, creating the file if it does not already exist. */
pxFile = f_open( cFileName, "w" );
configASSERT( pxFile );
/* Fill the RAM buffer with data that will be written to the file. This
is just a repeating ascii character that indicates the file number. */
memset( cRAMBuffer, ( int ) ( '0' + xFileNumber ), fsRAM_BUFFER_SIZE );
/* Write the RAM buffer to the opened file a number of times. The
number of times the RAM buffer is written to the file depends on the
file number, so the length of each created file will be different. */
for( xWriteNumber = 0; xWriteNumber < xFileNumber; xWriteNumber++ )
{
lItemsWritten = f_write( cRAMBuffer, fsRAM_BUFFER_SIZE, 1, pxFile );
configASSERT( lItemsWritten == 1 );
}
/* Close the file so another file can be created. */
f_close( pxFile );
}
}
/*-----------------------------------------------------------*/
static void prvVerifyDemoFileUsing_f_read( void )
{
BaseType_t xFileNumber, xReadNumber;
char cFileName[ fsMAX_FILE_NAME_LEN ];
const BaseType_t xMaxFiles = 5;
long lItemsRead, lChar;
F_FILE *pxFile;
/* Read back the files that were created by
prvCreateDemoFilesUsing_f_write(). */
for( xFileNumber = 1; xFileNumber <= xMaxFiles; xFileNumber++ )
{
/* Generate the file name. */
sprintf( cFileName, "root%03d.txt", ( int ) xFileNumber );
/* Obtain the current working directory and print out the file name and
the directory from which the file is being read. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
/* Open the file for reading. */
pxFile = f_open( cFileName, "r" );
configASSERT( pxFile );
/* Read the file into the RAM buffer, checking the file contents are as
expected. The size of the file depends on the file number. */
for( xReadNumber = 0; xReadNumber < xFileNumber; xReadNumber++ )
{
/* Start with the RAM buffer clear. */
memset( cRAMBuffer, 0x00, fsRAM_BUFFER_SIZE );
lItemsRead = f_read( cRAMBuffer, fsRAM_BUFFER_SIZE, 1, pxFile );
configASSERT( lItemsRead == 1 );
/* Check the RAM buffer is filled with the expected data. Each
file contains a different repeating ascii character that indicates
the number of the file. */
for( lChar = 0; lChar < fsRAM_BUFFER_SIZE; lChar++ )
{
configASSERT( cRAMBuffer[ lChar ] == ( '0' + ( char ) xFileNumber ) );
}
}
/* Close the file. */
f_close( pxFile );
}
}
/*-----------------------------------------------------------*/
static void prvCreateDemoFileUsing_f_putc( void )
{
unsigned char ucReturn;
int iByte, iReturned;
F_FILE *pxFile;
char cFileName[ fsMAX_FILE_NAME_LEN ];
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
/* Create a sub directory. */
ucReturn = f_mkdir( pcDirectory1 );
configASSERT( ucReturn == F_NO_ERROR );
/* Move into the created sub-directory. */
ucReturn = f_chdir( pcDirectory1 );
configASSERT( ucReturn == F_NO_ERROR );
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
/* Create a subdirectory in the new directory. */
ucReturn = f_mkdir( pcDirectory2 );
configASSERT( ucReturn == F_NO_ERROR );
/* Move into the directory just created - now two directories down from
the root. */
ucReturn = f_chdir( pcDirectory2 );
configASSERT( ucReturn == F_NO_ERROR );
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );
/* Generate the file name. */
sprintf( cFileName, "%s.txt", pcDirectory2 );
/* Print out the file name and the directory into which the file is being
written. */
pxFile = f_open( cFileName, "w" );
/* Create a file 1 byte at a time. The file is filled with incrementing
ascii characters starting from '0'. */
for( iByte = 0; iByte < fsPUTC_FILE_SIZE; iByte++ )
{
iReturned = f_putc( ( ( int ) '0' + iByte ), pxFile );
configASSERT( iReturned == ( ( int ) '0' + iByte ) );
}
/* Finished so close the file. */
f_close( pxFile );
/* Move back to the root directory. */
ucReturn = f_chdir( "../.." );
configASSERT( ucReturn == F_NO_ERROR );
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
configASSERT( strcmp( cRAMBuffer, pcRoot ) == 0 );
}
/*-----------------------------------------------------------*/
static void prvVerifyDemoFileUsing_f_getc( void )
{
unsigned char ucReturn;
int iByte, iReturned;
F_FILE *pxFile;
char cFileName[ fsMAX_FILE_NAME_LEN ];
/* Move into the directory in which the file was created. */
ucReturn = f_chdir( pcFullPath );
configASSERT( ucReturn == F_NO_ERROR );
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
configASSERT( strcmp( cRAMBuffer, pcFullPath ) == 0 );
/* Generate the file name. */
sprintf( cFileName, "%s.txt", pcDirectory2 );
/* This time the file is opened for reading. */
pxFile = f_open( cFileName, "r" );
/* Read the file 1 byte at a time. */
for( iByte = 0; iByte < fsPUTC_FILE_SIZE; iByte++ )
{
iReturned = f_getc( pxFile );
configASSERT( iReturned == ( ( int ) '0' + iByte ) );
}
/* Finished so close the file. */
f_close( pxFile );
/* Move back to the root directory. */
ucReturn = f_chdir( "../.." );
configASSERT( ucReturn == F_NO_ERROR );
/* Obtain and print out the working directory. */
f_getcwd( cRAMBuffer, fsRAM_BUFFER_SIZE );
}

View File

@ -0,0 +1,664 @@
/*
* FreeRTOS V202111.00
* Copyright (C) 2017 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
/******************************************************************************
*
* See the following URL for information on the commands defined in this file:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml
*
******************************************************************************/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Standard includes. */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
/* FreeRTOS+CLI includes. */
#include "FreeRTOS_CLI.h"
/* FreeRTOS+UDP includes, just to make the stats available to the CLI
commands. */
#include "FreeRTOS_UDP_IP.h"
#include "FreeRTOS_Sockets.h"
#ifndef configINCLUDE_TRACE_RELATED_CLI_COMMANDS
#define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0
#endif
/*
* Implements the run-time-stats command.
*/
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the task-stats command.
*/
static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the echo-three-parameters command.
*/
static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the echo-parameters command.
*/
static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Defines a command that prints out IP address information.
*/
static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Defines a command that prints out the gathered demo debug stats.
*/
static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Defines a command that sends an ICMP ping request to an IP address.
*/
static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
/*
* Implements the "trace start" and "trace stop" commands;
*/
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
#endif
/* Structure that defines the "ip-config" command line command. */
static const CLI_Command_Definition_t xIPConfig =
{
"ip-config",
"ip-config:\r\n Displays IP address configuration\r\n\r\n",
prvDisplayIPConfig,
0
};
#if configINCLUDE_DEMO_DEBUG_STATS != 0
/* Structure that defines the "ip-debug-stats" command line command. */
static const CLI_Command_Definition_t xIPDebugStats =
{
"ip-debug-stats", /* The command string to type. */
"ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",
prvDisplayIPDebugStats, /* The function to run. */
0 /* No parameters are expected. */
};
#endif /* configINCLUDE_DEMO_DEBUG_STATS */
/* Structure that defines the "run-time-stats" command line command. This
generates a table that shows how much run time each task has */
static const CLI_Command_Definition_t xRunTimeStats =
{
"run-time-stats", /* The command string to type. */
"run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",
prvRunTimeStatsCommand, /* The function to run. */
0 /* No parameters are expected. */
};
/* Structure that defines the "task-stats" command line command. This generates
a table that gives information on each task in the system. */
static const CLI_Command_Definition_t xTaskStats =
{
"task-stats", /* The command string to type. */
"task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",
prvTaskStatsCommand, /* The function to run. */
0 /* No parameters are expected. */
};
/* Structure that defines the "echo_3_parameters" command line command. This
takes exactly three parameters that the command simply echos back one at a
time. */
static const CLI_Command_Definition_t xThreeParameterEcho =
{
"echo-3-parameters",
"echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",
prvThreeParameterEchoCommand, /* The function to run. */
3 /* Three parameters are expected, which can take any value. */
};
/* Structure that defines the "echo_parameters" command line command. This
takes a variable number of parameters that the command simply echos back one at
a time. */
static const CLI_Command_Definition_t xParameterEcho =
{
"echo-parameters",
"echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",
prvParameterEchoCommand, /* The function to run. */
-1 /* The user can enter any number of commands. */
};
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
/* Structure that defines the "ping" command line command. This takes an IP
address or host name and (optionally) the number of bytes to ping as
parameters. */
static const CLI_Command_Definition_t xPing =
{
"ping",
"ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",
prvPingCommand, /* The function to run. */
-1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */
};
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
/* Structure that defines the "trace" command line command. This takes a single
parameter, which can be either "start" or "stop". */
static const CLI_Command_Definition_t xStartStopTrace =
{
"trace",
"trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",
prvStartStopTraceCommand, /* The function to run. */
1 /* One parameter is expected. Valid values are "start" and "stop". */
};
#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
/*-----------------------------------------------------------*/
void vRegisterCLICommands( void )
{
/* Register all the command line commands defined immediately above. */
FreeRTOS_CLIRegisterCommand( &xTaskStats );
FreeRTOS_CLIRegisterCommand( &xRunTimeStats );
FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );
FreeRTOS_CLIRegisterCommand( &xParameterEcho );
FreeRTOS_CLIRegisterCommand( &xIPDebugStats );
FreeRTOS_CLIRegisterCommand( &xIPConfig );
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
{
FreeRTOS_CLIRegisterCommand( &xPing );
}
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
FreeRTOS_CLIRegisterCommand( & xStartStopTrace );
#endif
}
/*-----------------------------------------------------------*/
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *const pcHeader = " State\tPriority\tStack\t#\r\n************************************************\r\n";
BaseType_t xSpacePadding;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
strcpy( pcWriteBuffer, "Task" );
pcWriteBuffer += strlen( pcWriteBuffer );
/* Pad the string "task" with however many bytes necessary to make it the
length of a task name. Minus three for the null terminator and half the
number of characters in "Task" so the column lines up with the centre of
the heading. */
for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
{
/* Add a space to align columns after the task's name. */
*pcWriteBuffer = ' ';
pcWriteBuffer++;
/* Ensure always terminated. */
*pcWriteBuffer = 0x00;
}
strcpy( pcWriteBuffer, pcHeader );
vTaskList( pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
/*-----------------------------------------------------------*/
static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char * const pcHeader = " Abs Time % Time\r\n****************************************\r\n";
BaseType_t xSpacePadding;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Generate a table of task stats. */
strcpy( pcWriteBuffer, "Task" );
pcWriteBuffer += strlen( pcWriteBuffer );
/* Pad the string "task" with however many bytes necessary to make it the
length of a task name. Minus three for the null terminator and half the
number of characters in "Task" so the column lines up with the centre of
the heading. */
for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
{
/* Add a space to align columns after the task's name. */
*pcWriteBuffer = ' ';
pcWriteBuffer++;
/* Ensure always terminated. */
*pcWriteBuffer = 0x00;
}
strcpy( pcWriteBuffer, pcHeader );
vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
/*-----------------------------------------------------------*/
static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength, xReturn;
static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
if( lParameterNumber == 0 )
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
sprintf( pcWriteBuffer, "The three parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
lParameterNumber = 1L;
/* There is more data to be returned as no parameters have been echoed
back yet. */
xReturn = pdPASS;
}
else
{
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
lParameterNumber, /* Return the next parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
if( lParameterNumber == 3L )
{
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
xReturn = pdFALSE;
lParameterNumber = 0L;
}
else
{
/* There are more parameters to return after this one. */
xReturn = pdTRUE;
lParameterNumber++;
}
}
return xReturn;
}
/*-----------------------------------------------------------*/
static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t xParameterStringLength, xReturn;
static BaseType_t lParameterNumber = 0;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
if( lParameterNumber == 0 )
{
/* The first time the function is called after the command has been
entered just a header string is returned. */
sprintf( pcWriteBuffer, "The parameters were:\r\n" );
/* Next time the function is called the first parameter will be echoed
back. */
lParameterNumber = 1L;
/* There is more data to be returned as no parameters have been echoed
back yet. */
xReturn = pdPASS;
}
else
{
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
lParameterNumber, /* Return the next parameter. */
&xParameterStringLength /* Store the parameter string length. */
);
if( pcParameter != NULL )
{
/* Return the parameter string. */
memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
/* There might be more parameters to return after this one. */
xReturn = pdTRUE;
lParameterNumber++;
}
else
{
/* No more parameters were found. Make sure the write buffer does
not contain a valid string. */
pcWriteBuffer[ 0 ] = 0x00;
/* No more data to return. */
xReturn = pdFALSE;
/* Start over the next time this command is executed. */
lParameterNumber = 0;
}
}
return xReturn;
}
/*-----------------------------------------------------------*/
#if ipconfigSUPPORT_OUTGOING_PINGS == 1
static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
char * pcParameter;
BaseType_t lParameterStringLength, xReturn;
uint32_t ulIPAddress, ulBytesToPing;
const uint32_t ulDefaultBytesToPing = 8UL;
char cBuffer[ 16 ];
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Start with an empty string. */
pcWriteBuffer[ 0 ] = 0x00;
/* Obtain the number of bytes to ping. */
pcParameter = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
2, /* Return the second parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
if( pcParameter == NULL )
{
/* The number of bytes was not specified, so default it. */
ulBytesToPing = ulDefaultBytesToPing;
}
else
{
ulBytesToPing = atol( pcParameter );
}
/* Obtain the IP address string. */
pcParameter = ( char * ) FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* Attempt to obtain the IP address. If the first character is not a
digit, assume the host name has been passed in. */
if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )
{
ulIPAddress = FreeRTOS_inet_addr( pcParameter );
}
else
{
/* Terminate the host name. */
pcParameter[ lParameterStringLength ] = 0x00;
/* Attempt to resolve host. */
ulIPAddress = FreeRTOS_gethostbyname( pcParameter );
}
/* Convert IP address, which may have come from a DNS lookup, to string. */
FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
if( ulIPAddress != 0 )
{
xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );
}
else
{
xReturn = pdFALSE;
}
if( xReturn == pdFALSE )
{
sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );
}
else
{
sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );
}
return pdFALSE;
}
/*-----------------------------------------------------------*/
#endif /* ipconfigSUPPORT_OUTGOING_PINGS */
#if configINCLUDE_DEMO_DEBUG_STATS != 0
static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
static BaseType_t xIndex = -1;
extern xExampleDebugStatEntry_t xIPTraceValues[];
BaseType_t xReturn;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
xIndex++;
if( xIndex < xExampleDebugStatEntries() )
{
sprintf( pcWriteBuffer, "%s %d\r\n", xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );
xReturn = pdPASS;
}
else
{
/* Reset the index for the next time it is called. */
xIndex = -1;
/* Ensure nothing remains in the write buffer. */
pcWriteBuffer[ 0 ] = 0x00;
xReturn = pdFALSE;
}
return xReturn;
}
/*-----------------------------------------------------------*/
#endif /* configINCLUDE_DEMO_DEBUG_STATS */
static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
static BaseType_t xIndex = 0;
BaseType_t xReturn;
uint32_t ulAddress;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
switch( xIndex )
{
case 0 :
FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
sprintf( pcWriteBuffer, "\r\nIP address " );
xReturn = pdTRUE;
xIndex++;
break;
case 1 :
FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
sprintf( pcWriteBuffer, "\r\nNet mask " );
xReturn = pdTRUE;
xIndex++;
break;
case 2 :
FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
sprintf( pcWriteBuffer, "\r\nGateway address " );
xReturn = pdTRUE;
xIndex++;
break;
case 3 :
FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
sprintf( pcWriteBuffer, "\r\nDNS server address " );
xReturn = pdTRUE;
xIndex++;
break;
default :
ulAddress = 0;
sprintf( pcWriteBuffer, "\r\n\r\n" );
xReturn = pdFALSE;
xIndex = 0;
break;
}
if( ulAddress != 0 )
{
FreeRTOS_inet_ntoa( ulAddress, &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) );
}
return xReturn;
}
/*-----------------------------------------------------------*/
#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *pcParameter;
BaseType_t lParameterStringLength;
/* Remove compile time warnings about unused parameters, and check the
write buffer is not NULL. NOTE - for simplicity, this example assumes the
write buffer length is adequate, so does not check for buffer overflows. */
( void ) pcCommandString;
( void ) xWriteBufferLen;
configASSERT( pcWriteBuffer );
/* Obtain the parameter string. */
pcParameter = FreeRTOS_CLIGetParameter
(
pcCommandString, /* The command string itself. */
1, /* Return the first parameter. */
&lParameterStringLength /* Store the parameter string length. */
);
/* Sanity check something was returned. */
configASSERT( pcParameter );
/* There are only two valid parameter values. */
if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )
{
/* Start or restart the trace. */
vTraceStop();
vTraceClear();
vTraceStart();
sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
}
else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )
{
/* End the trace, if one is running. */
vTraceStop();
sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );
}
else
{
sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
}
/* There is no more data to return after this single string, so return
pdFALSE. */
return pdFALSE;
}
#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */

Some files were not shown because too many files have changed in this diff Show More