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:
@ -89,7 +89,7 @@ SocketSet_t xSocketSet;
|
||||
xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_STREAM, FREERTOS_IPPROTO_TCP );
|
||||
FreeRTOS_printf( ( "TCP socket on port %d\n", ( int )xPortNumber ) );
|
||||
|
||||
if( xSocket != FREERTOS_NO_SOCKET )
|
||||
if( xSocket != FREERTOS_INVALID_SOCKET )
|
||||
{
|
||||
xAddress.sin_addr = FreeRTOS_GetIPAddress(); // Single NIC, currently not used
|
||||
xAddress.sin_port = FreeRTOS_htons( xPortNumber );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -61,7 +61,18 @@
|
||||
*/
|
||||
#define IOT_TASKPOOL_ENABLE_ASSERTS 1
|
||||
|
||||
/**
|
||||
/*
|
||||
* The full IoT Task Pool Library has many use cases, including Linux
|
||||
* development. <20>Typical FreeRTOS use cases do not require the full
|
||||
* functionality so an optimised implementation is provided specifically for use
|
||||
* with FreeRTOS. The optimised version has a fixed number of tasks in the
|
||||
* pool, each of which uses statically allocated memory to ensure creation of
|
||||
* the pool is guaranteed (it does not run out of heap space).
|
||||
* IOT_TASKPOOL_NUMBER_OF_WORKERS sets the number of tasks in the pool.
|
||||
*/
|
||||
#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3
|
||||
|
||||
/*
|
||||
* @brief Set the log level of the task pool library.
|
||||
*
|
||||
* Log messages from the task pool library at or below this setting will be
|
||||
@ -73,13 +84,6 @@
|
||||
*/
|
||||
#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_INFO
|
||||
|
||||
/**
|
||||
* @brief The number of worker tasks in the task pool.
|
||||
*
|
||||
* The minimal version of the of task pool library only supports one task pool
|
||||
* and the number of the worker tasks is fixed at the compile time.
|
||||
*/
|
||||
#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3
|
||||
|
||||
/**
|
||||
* @brief The stack size (in bytes) for each worker task in the task pool.
|
||||
@ -98,7 +102,7 @@
|
||||
/**
|
||||
* @brief Enable/Disable anonymous metrics collection when using AWS IoT.
|
||||
*
|
||||
* This demo does not support TLS and so does not work with AWS IoT. Therefore,
|
||||
* This demo does not use TLS and so does not work with AWS IoT. Therefore,
|
||||
* the metric collection must be disabled.
|
||||
*/
|
||||
#define AWS_IOT_MQTT_ENABLE_METRICS 0
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,17 @@
|
||||
*/
|
||||
#define IOT_TASKPOOL_ENABLE_ASSERTS 1
|
||||
|
||||
/*
|
||||
* The full IoT Task Pool Library has many use cases, including Linux
|
||||
* development. Typical FreeRTOS use cases do not require the full
|
||||
* functionality so an optimised implementation is provided specifically for use
|
||||
* with FreeRTOS. The optimised version has a fixed number of tasks in the
|
||||
* pool, each of which uses statically allocated memory to ensure creation of
|
||||
* the pool is guaranteed (it does not run out of heap space).
|
||||
* IOT_TASKPOOL_NUMBER_OF_WORKERS sets the number of tasks in the pool.
|
||||
*/
|
||||
#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3
|
||||
|
||||
/*
|
||||
* Set the log level of the task pool library.
|
||||
*
|
||||
@ -71,15 +82,14 @@
|
||||
*/
|
||||
#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_INFO
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* @brief The stack size (in bytes) for each worker task in the task pool.
|
||||
*
|
||||
* The minimal version of the of task pool library only supports one task pool
|
||||
* and the configuration of each worker task fixed at the compile time.
|
||||
*/
|
||||
#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES 2048
|
||||
#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES 2048
|
||||
|
||||
/* Include the common configuration file for FreeRTOS. */
|
||||
#include "iot_config_common.h"
|
||||
|
Reference in New Issue
Block a user