diff options
author | Archit Aggarwal <architag@amazon.com> | 2020-12-09 19:02:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 19:02:51 -0800 |
commit | c0d4c7c67c2ba2ebc2c2737aabd2572ee1a0084b (patch) | |
tree | 1749838c8a61768761e13d1a5bbbeef009a3b796 | |
parent | 9d937aa0abc9b905460c575e4cec3d26d1b8f60c (diff) | |
download | freertos-git-c0d4c7c67c2ba2ebc2c2737aabd2572ee1a0084b.tar.gz |
Update MQTT config for Keep Alive demo that uses dummy timer (#457)
The MQTT library has been updated with the MQTT_RECV_POLLING_TIMEOUT_MS and MQTT_SEND_RETRY_TIMEOUT_MS configurations which should be set to zero when using a dummy timer function to avoid possibility of infinite loop when retrying failed transport send/receive calls. As the MQTT Keep Alive demo uses a dummy timer function, this PR updates the demo configuration to set these timeouts to zero.
-rw-r--r-- | FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/core_mqtt_config.h | 44 | ||||
m--------- | FreeRTOS-Plus/Source/Application-Protocols/coreMQTT | 0 |
2 files changed, 39 insertions, 5 deletions
diff --git a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/core_mqtt_config.h b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/core_mqtt_config.h index 1dc0b0a81..8e003f837 100644 --- a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/core_mqtt_config.h +++ b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Keep_Alive/core_mqtt_config.h @@ -1,5 +1,5 @@ /* - * FreeRTOS Kernel V10.3.0 + * FreeRTOS V202011.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 @@ -19,10 +19,9 @@ * 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 + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS * - * 1 tab == 4 spaces! */ #ifndef CORE_MQTT_CONFIG_H #define CORE_MQTT_CONFIG_H @@ -75,6 +74,41 @@ extern void vLoggingPrintf( const char * pcFormatString, * macro sets the limit on how many simultaneous PUBLISH states an MQTT * context maintains. */ -#define MQTT_STATE_ARRAY_MAX_COUNT 10U +#define MQTT_STATE_ARRAY_MAX_COUNT 10U + +/** + * @brief The maximum duration between non-empty network reads while + * receiving an MQTT packet via the #MQTT_ProcessLoop or #MQTT_ReceiveLoop + * API functions. + * + * When an incoming MQTT packet is detected, the transport receive function + * may be called multiple times until all of the expected number of bytes of the + * packet are received. This timeout represents the maximum polling duration that + * is allowed without any data reception from the network for the incoming packet. + * + * @note For this demo, the timeout value is configured to zero as the demo uses a + * dummy timer function (of #MQTTGetCurrentTimeFunc_t) that always returns zero. + * It is REQUIRED to set the the timeout to zero when using a dummy timer function + * that always returns zero. + */ +#define MQTT_RECV_POLLING_TIMEOUT_MS 0U + +/** + * @brief The maximum duration between non-empty network transmissions while + * sending an MQTT packet via the #MQTT_ProcessLoop or #MQTT_ReceiveLoop + * API functions. + * + * When sending an MQTT packet, the transport send function may be called multiple + * times until the required number of bytes are sent. + * This timeout represents the maximum time wait for any data + * transmission over the network through the transport send function. + * + * @note For this demo, the timeout value is configured to zero as the demo uses a + * dummy timer function (of #MQTTGetCurrentTimeFunc_t) that always returns zero. + * It is REQUIRED to set the the timeout to zero when using a dummy timer function + * that always returns zero. + * + */ +#define MQTT_SEND_RETRY_TIMEOUT_MS 0U #endif /* ifndef CORE_MQTT_CONFIG_H */ diff --git a/FreeRTOS-Plus/Source/Application-Protocols/coreMQTT b/FreeRTOS-Plus/Source/Application-Protocols/coreMQTT -Subproject 93c15bdab832f0a0aa3b6deb06dd19b0d522713 +Subproject 510a3f6ecac041859114b41462c1829a29f026c |