]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/main.c
Update trace recorder code.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_TCP_Minimal_Windows_Simulator / main.c
index 7be6b5e91f7c33c8151a1f29d126dca2f7b2c9fb..bd9b45bc528b15f24dca93e6068a98540e47cedc 100644 (file)
@@ -44,6 +44,7 @@
 #include "FreeRTOS_IP.h"\r
 #include "FreeRTOS_Sockets.h"\r
 #include "SimpleUDPClientAndServer.h"\r
+#include "SimpleTCPEchoServer.h"\r
 #include "TCPEchoClient_SingleTasks.h"\r
 #include "demo_logging.h"\r
 \r
 #define mainECHO_CLIENT_TASK_STACK_SIZE                                ( configMINIMAL_STACK_SIZE * 2 )        /* Not used in the Windows port. */\r
 #define mainECHO_CLIENT_TASK_PRIORITY                                  ( tskIDLE_PRIORITY + 1 )\r
 \r
+/* Echo server task parameters. */\r
+#define mainECHO_SERVER_TASK_STACK_SIZE                                        ( configMINIMAL_STACK_SIZE * 2 )        /* Not used in the Windows port. */\r
+#define mainECHO_SERVER_TASK_PRIORITY                                  ( tskIDLE_PRIORITY + 1 )\r
+\r
 /* Define a name that will be used for LLMNR and NBNS searches. */\r
 #define mainHOST_NAME                          "RTOSDemo"\r
 #define mainDEVICE_NICK_NAME           "windows_demo"\r
@@ -77,10 +82,14 @@ verify the echo reply, from within the same task (Tx and Rx are performed in the
 same RTOS task).  The IP address of the echo server must be configured using the\r
 configECHO_SERVER_ADDR0 to configECHO_SERVER_ADDR3 constants in\r
 FreeRTOSConfig.h.\r
+\r
+mainCREATE_TCP_ECHO_SERVER_TASK:  When set to 1 a task is created that accepts\r
+connections on the standard echo port (port 7), then echos back any data\r
+received on that connection.\r
 */\r
 #define mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS      1\r
 #define mainCREATE_TCP_ECHO_TASKS_SINGLE                       1\r
-\r
+#define mainCREATE_TCP_ECHO_SERVER_TASK                                0\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -231,6 +240,12 @@ static BaseType_t xTasksAlreadyCreated = pdFALSE;
                        }\r
                        #endif /* mainCREATE_TCP_ECHO_TASKS_SINGLE */\r
 \r
+                       #if( mainCREATE_TCP_ECHO_SERVER_TASK == 1 )\r
+                       {\r
+                               vStartSimpleTCPServerTasks( mainECHO_SERVER_TASK_STACK_SIZE, mainECHO_SERVER_TASK_PRIORITY );\r
+                       }\r
+                       #endif\r
+\r
                        xTasksAlreadyCreated = pdTRUE;\r
                }\r
 \r