summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c')
-rw-r--r--FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c
index 6ffc1fe6c..f70f18be1 100644
--- a/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c
+++ b/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/DemoTasks/MultitaskMQTTExample.c
@@ -28,6 +28,13 @@
* This demo shows how to use coreMQTT in a multithreaded environment - it does not
* yet go as far as encapsulating the MQTT library within its own agent (or daemon)
* task - although the prvCommandLoop() function demonstrates how that might be done.
+ * Also see https://www.freertos.org/mqtt/mqtt-agent-demo.html? for an
+ * example that does use an agent task. Executing the MQTT protocol in an agent
+ * task removes the need for the application writer to explicitly manage any MQTT
+ * state or call the MQTT_ProcessLoop() API function. Using an agent task
+ * also enables multiple application tasks to more easily share a single
+ * MQTT connection.
+ *
* In this task prvCommandLoop() is only executed from a single thread and is the
* only function that is allowed to use the coreMQTT API directly. Anything else
* needing to interact with the coreMQTT API does so by posting commands to
@@ -375,8 +382,8 @@ typedef struct publishElement
/*-----------------------------------------------------------*/
-/**
- * @brief Each compilation unit that consumes the NetworkContext must define it.
+/**
+ * @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 *.
*
@@ -2098,6 +2105,13 @@ static void prvCleanExistingPersistentSession( void )
/*-----------------------------------------------------------*/
+ /* Also see https://www.freertos.org/mqtt/mqtt-agent-demo.html? for an
+ * alternative run time model whereby coreMQTT runs in an autonomous
+ * background agent task. Executing the MQTT protocol in an agent task
+ * removes the need for the application writer to explicitly manage any MQTT
+ * state or call the MQTT_ProcessLoop() API function. Using an agent task
+ * also enables multiple application tasks to more easily share a single
+ * MQTT connection. */
static void prvMQTTDemoTask( void * pvParameters )
{
BaseType_t xNetworkStatus = pdFAIL;