From: richardbarry Date: Sat, 16 Nov 2013 19:19:18 +0000 (+0000) Subject: Add UDP related commands to SAM4E demo. X-Git-Tag: V7.6.0~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dee59db0f90c7963b17d45dfe7c5caf9c5b71aa3;p=freertos Add UDP related commands to SAM4E demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2098 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj index e25100f39..3bb685b49 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj @@ -461,14 +461,18 @@ True - + compile - src\File-Releated-CLI-commands.c + src\File-Related-CLI-commands.c compile src\Sample-CLI-commands.c + + compile + src\UDP-Related-CLI-commands.c + compile src\File-system-demo.c diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSIPConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSIPConfig.h index 0ec023489..ffaf4ecf1 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSIPConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSIPConfig.h @@ -217,7 +217,7 @@ generate replies to incoming ICMP echo (ping) requests. */ /* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the FreeRTOS_SendPingRequest() API function is available. */ -#define ipconfigSUPPORT_OUTGOING_PINGS 0 +#define ipconfigSUPPORT_OUTGOING_PINGS 1 /* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select() (and associated) API function is available. */ diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c index b03439c0f..22376afca 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c @@ -154,6 +154,11 @@ extern void vRegisterSampleCLICommands( void ); */ extern void vRegisterFileSystemCLICommands( void ); +/* + * Register the UDP related commands that can be used with FreeRTOS+CLI. + */ +extern void vRegisterUDPCLICommands( void ); + /*-----------------------------------------------------------*/ /* The default IP and MAC address used by the demo. The address configuration @@ -191,12 +196,11 @@ xTimerHandle xTimer = NULL; } #endif - /* Register generic commands with the FreeRTOS+CLI command interpreter. */ + /* Register example generic, file system related and UDP related CLI + commands respectively. */ vRegisterSampleCLICommands(); - - /* Register file system related commands with the FreeRTOS+CLI command - interpreter. */ vRegisterFileSystemCLICommands(); + vRegisterUDPCLICommands(); /* Initialise the network interface. Tasks that use the network are created in the network event hook when the network is connected and ready @@ -376,6 +380,31 @@ void vFullDemoTickHook( void ) /* Call the queue set ISR test function. */ vQueueSetAccessQueueSetFromISR(); } +/*-----------------------------------------------------------*/ + +/* Called automatically when a reply to an outgoing ping is received. */ +void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier ) +{ + /* This demo has nowhere to output any information so does nothing. */ + ( void ) usIdentifier; + + switch( eStatus ) + { + case eSuccess : + break; + + case eInvalidChecksum : + break; + + case eInvalidData : + break; + + default : + /* It is not possible to get here as all enums have their own + case. */ + break; + } +}