mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-28 14:08:32 -04:00
Remove the simple UDP client/server tasks from the MQTT demo as the demo's network connection can be tested more easily just by pinging it.
Tidy up the iot_config.h header files a little.
This commit is contained in:
parent
95f60318d5
commit
53842d4cac
7 changed files with 68 additions and 622 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue