\r
/* FreeRTOS+UDP includes. */\r
#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
\r
-/* Demo application includes. */\r
+/* UDP demo includes. */\r
#include "UDPCommandInterpreter.h"\r
+#include "TwoEchoClients.h"\r
+\r
+/* Standard demo includes. */\r
#include "partest.h"\r
#include "blocktim.h"\r
#include "flash_timer.h"\r
#define mainDISCONNECTED_IP_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
\r
/* UDP command server task parameters. */\r
-#define mainUDP_CLI_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
-#define mainUDP_CLI_PORT_NUMBER ( 5001UL )\r
-#define mainUDP_CLI_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2U )\r
+#define mainUDP_CLI_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
+#define mainUDP_CLI_PORT_NUMBER ( 5001UL )\r
+#define mainUDP_CLI_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2U )\r
+\r
+/* Set to 1 to include the UDP echo client tasks. */\r
+#define mainINCLUDE_ECHO_CLIENT_TASKS 1\r
\r
/*-----------------------------------------------------------*/\r
\r
*/\r
extern void vRegisterUDPCLICommands( void );\r
\r
+/*\r
+ * Initialise the LCD and output a bitmap.\r
+ */\r
+extern void vInitialiseLCD( void );\r
+\r
/*-----------------------------------------------------------*/\r
\r
/* The default IP and MAC address used by the demo. The address configuration\r
{\r
xTimerHandle xTimer = NULL;\r
\r
+ /* Initialise the LCD and output the bitmap. */\r
+ vInitialiseLCD();\r
+\r
/* If the file system is only going to be accessed from one task then\r
F_FS_THREAD_AWARE can be set to 0 and the set of example files are created\r
before the RTOS scheduler is started. If the file system is going to be\r
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )\r
{\r
static long lTasksAlreadyCreated = pdFALSE;\r
+const unsigned long ulXCoord = 3, ulYCoord = 3, ulIPAddressOffset = 45;\r
+unsigned long ulIPAddress;\r
+char cIPAddress[ 20 ];\r
\r
/* Note: If the application is started without the network cable plugged in\r
then ipconfigUDP_TASK_PRIORITY should be set to 0 in FreeRTOSIPConfig.h to\r
passed into the network event hook is eNetworkUp). */\r
if( eNetworkEvent == eNetworkUp )\r
{\r
- vTaskPrioritySet( NULL, mainCONNECTED_IP_TASK_PRIORITY );\r
-\r
if( lTasksAlreadyCreated == pdFALSE )\r
{ \r
/* Create the task that handles the CLI on a UDP port. The port number\r
is set using the configUDP_CLI_PORT_NUMBER setting in FreeRTOSConfig.h. */\r
vStartUDPCommandInterpreterTask( mainUDP_CLI_TASK_STACK_SIZE, mainUDP_CLI_PORT_NUMBER, mainUDP_CLI_TASK_PRIORITY );\r
+ \r
+ #if( mainINCLUDE_ECHO_CLIENT_TASKS == 1 )\r
+ {\r
+ vStartEchoClientTasks( configMINIMAL_STACK_SIZE, tskIDLE_PRIORITY );\r
+ }\r
+ #endif\r
}\r
+ \r
+ /* Obtain the IP address, convert it to a string, then display. */\r
+ FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );\r
+ FreeRTOS_inet_ntoa( ulIPAddress, cIPAddress );\r
+ ili93xx_draw_string( ulXCoord, ulYCoord, ( uint8_t * ) "IP: " );\r
+ ili93xx_draw_string( ulXCoord + ulIPAddressOffset, ulYCoord, ( uint8_t * ) cIPAddress );\r
+ \r
+ /* Set the IP task up to the desired priority now it has connected. */\r
+ vTaskPrioritySet( NULL, mainCONNECTED_IP_TASK_PRIORITY );\r
}\r
\r
if( eNetworkEvent == eNetworkDown )\r
{\r
/* This demo has nowhere to output any information so does nothing. */\r
( void ) usIdentifier;\r
- \r
- switch( eStatus )\r
- {\r
- case eSuccess :\r
- break;\r
-\r
- case eInvalidChecksum :\r
- break;\r
-\r
- case eInvalidData :\r
- break;\r
-\r
- default :\r
- /* It is not possible to get here as all enums have their own\r
- case. */\r
- break;\r
- }\r
+ ( void ) eStatus;\r
}\r
-\r
-\r
-\r
+/*-----------------------------------------------------------*/\r
\r