summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c')
-rw-r--r--FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c47
1 files changed, 8 insertions, 39 deletions
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
index 5b6c054fb..cbec6796e 100644
--- a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
+++ b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/main.c
@@ -26,10 +26,7 @@
*/
/*
- * This project is a cut down version of the project described on the following
- * link. Only the simple UDP client and server and the TCP echo clients are
- * included in the build:
- * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/examples_FreeRTOS_simulator.html
+ * TBD
*/
/* Standard includes. */
@@ -51,32 +48,13 @@ should an assert get hit. */
/* Demo app includes. */
#include "demo_logging.h"
-/* Set the following constants to 1 or 0 to define which tasks to include and
-exclude:
-
-mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS: When set to 1 two UDP client tasks
-and two UDP server tasks are created. The clients talk to the servers. One set
-of tasks use the standard sockets interface, and the other the zero copy sockets
-interface. These tasks are self checking and will trigger a configASSERT() if
-they detect a difference in the data that is received from that which was sent.
-As these tasks use UDP, and can therefore loose packets, they will cause
-configASSERT() to be called when they are run in a less than perfect networking
-environment.
-
-mainCREATE_SIMPLE_MQTT_EXAMPLE_TASKS: TBD
-*/
-#define mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS 0
-#define mainCREATE_SIMPLE_MQTT_EXAMPLE_TASKS 1
-
-/* Simple UDP client and server task parameters. */
-#define mainSIMPLE_UDP_CLIENT_SERVER_TASK_PRIORITY ( tskIDLE_PRIORITY )
-#define mainSIMPLE_UDP_CLIENT_SERVER_PORT ( 5005UL )
-
/*
- * Prototypes for the demos that can be started from this project.
+ * Prototypes for the demos that can be started from this project. Note the
+ * MQTT demo is not actually started until the network is already, which is
+ * indicated by vApplicationIPNetworkEventHook() executing - hence
+ * prvStartSimpleMQTTDemo() is called from inside vApplicationIPNetworkEventHook().
*/
extern void vStartSimpleMQTTDemo( void );
-extern void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulsPort, UBaseType_t uxPriority );
/*
* Just seeds the simple pseudo random number generator.
@@ -197,18 +175,9 @@ static BaseType_t xTasksAlreadyCreated = pdFALSE;
created. */
if( xTasksAlreadyCreated == pdFALSE )
{
- #if( mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS == 1 )
- {
- vStartSimpleUDPClientServerTasks( configMINIMAL_STACK_SIZE, mainSIMPLE_UDP_CLIENT_SERVER_PORT, mainSIMPLE_UDP_CLIENT_SERVER_TASK_PRIORITY );
- }
- #endif
-
- #if( mainCREATE_SIMPLE_MQTT_EXAMPLE_TASKS == 1 )
- {
- vStartSimpleMQTTDemo();
- }
- #endif
-
+ /* Demos that use the nextwork are created after the nextwork is
+ up. */
+ vStartSimpleMQTTDemo();
xTasksAlreadyCreated = pdTRUE;
}