Move MQTT Keep-Alive Demo from lts-development to master (#326)

This moves the MQTT Keep-Alive Demo under FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive.

The project files such as WIN32.vcxproj and WIN32.vcxproj.filters are updated to point to the sources and includes from the coreMQTT submodule.

No changes are made to the actual code. Only paths are updated.

Co-authored-by: SarenaAWS <6563840+sarenameas@users.noreply.github.com>
This commit is contained in:
Oscar Michael Abrina
2020-10-07 12:35:21 -07:00
committed by GitHub
co-authored by SarenaAWS
parent 2f51006020
commit 706d6888f9
9 changed files with 2135 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://www.freertos.org/mqtt_lts/
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,67 @@
/*
* FreeRTOS Kernel V10.3.0
* 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
*
* 1 tab == 4 spaces!
*/
#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_NONE
#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 */
@@ -0,0 +1,126 @@
/*
* FreeRTOS Kernel V10.3.0
* 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
*
* 1 tab == 4 spaces!
*/
#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 "MQTTDemo"
#endif
#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#endif
#include "logging_stack.h"
/************ End of logging configuration ****************/
/**
* @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 MQTT broker end point to connect to.
*
* @note For running this demo an MQTT broker, which can be run locally on
* the same host is recommended. Any MQTT broker, which can be run on a Windows
* host can be used for this demo. However, the instructions below are for
* setting up a local Mosquitto broker on a Windows host.
* 1. Download Mosquitto from https://mosquitto.org/download/
* 2. Install Mosquitto as a Windows service by running the installer.
* More details about installing as a Windows service can be found at
* https://github.com/eclipse/mosquitto/blob/master/readme-windows.txt and
* https://github.com/eclipse/mosquitto/blob/master/readme.md
* 3. Verify that Mosquitto server is running locally and listening on port
* 1883 by following the steps below.
* a. Open Power Shell.
* b. Type in command `netstat -a -p TCP | grep 1883` to check if there
* is an active connection listening on port 1883.
* c. Verify that there is an output as shown below
* `TCP 0.0.0.0:1883 <HOST-NAME>:0 LISTENING`
* d. If there is no output on step c,go through the Mosquitto documentation
* listed above to check if the installation was successful.
* 4. Make sure the Mosquitto broker is allowed to communicate through
* Windows Firewall. The instructions for allowing an application on Windows 10
* Defender Firewall can be found at the link below.
* https://support.microsoft.com/en-us/help/4558235/windows-10-allow-an-app-through-microsoft-defender-firewall
* After running this MQTT example, consider disabling the Mosquitto broker to
* communicate through Windows Firewall for avoiding unwanted network traffic
* to your machine.
* 5. After verifying that a Mosquitto broker is running successfully, update
* the config democonfigMQTT_BROKER_ENDPOINT to the local IP address of the
* Windows host machine. Please note that "localhost" or address "127.0.0.1"
* will not work as this example is running on a Windows Simulator and not on
* Windows host natively. Also note that, if the Windows host is using a
* Virtual Private Network(VPN), connection to the Mosquitto broker may not
* work.
*
* As an alternative option, a publicly hosted Mosquitto broker can also be
* used as an MQTT broker end point. This can be done by updating the config
* democonfigMQTT_BROKER_ENDPOINT to "test.mosquitto.org". However, this is not
* recommended due the possible downtimes of the broker as indicated by the
* documentation in https://test.mosquitto.org/.
*
* #define democonfigMQTT_BROKER_ENDPOINT "insert here."
*/
/**
* @brief The port to use for the demo.
*
* #define democonfigMQTT_BROKER_PORT ( insert here. )
*/
/**
* @brief Set the stack size of the main demo task.
*
* In the Windows port, this stack only holds a structure. The actual
* stack is created by an operating system thread.
*/
#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE
#endif /* DEMO_CONFIG_H */
@@ -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