]> git.sur5r.net Git - freertos/commitdiff
Add UDP related commands to SAM4E demo.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 16 Nov 2013 19:19:18 +0000 (19:19 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 16 Nov 2013 19:19:18 +0000 (19:19 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2098 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.cproj
FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSIPConfig.h
FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c

index e25100f396e048116ef0048722a9b5bed4b7fe04..3bb685b49a239cea457da8488b631fcc515ff69a 100644 (file)
     <GenerateEepFile>True</GenerateEepFile>\r
   </PropertyGroup>\r
   <ItemGroup>\r
-    <Compile Include="..\..\..\FreeRTOS-Plus\Demo\Common\FreeRTOS_Plus_CLI_Demos\File-Releated-CLI-commands.c">\r
+    <Compile Include="..\..\..\FreeRTOS-Plus\Demo\Common\FreeRTOS_Plus_CLI_Demos\File-Related-CLI-commands.c">\r
       <SubType>compile</SubType>\r
-      <Link>src\File-Releated-CLI-commands.c</Link>\r
+      <Link>src\File-Related-CLI-commands.c</Link>\r
     </Compile>\r
     <Compile Include="..\..\..\FreeRTOS-Plus\Demo\Common\FreeRTOS_Plus_CLI_Demos\Sample-CLI-commands.c">\r
       <SubType>compile</SubType>\r
       <Link>src\Sample-CLI-commands.c</Link>\r
     </Compile>\r
+    <Compile Include="..\..\..\FreeRTOS-Plus\Demo\Common\FreeRTOS_Plus_CLI_Demos\UDP-Related-CLI-commands.c">\r
+      <SubType>compile</SubType>\r
+      <Link>src\UDP-Related-CLI-commands.c</Link>\r
+    </Compile>\r
     <Compile Include="..\..\..\FreeRTOS-Plus\Demo\Common\FreeRTOS_Plus_FAT_SL_Demos\CreateExampleFiles\File-system-demo.c">\r
       <SubType>compile</SubType>\r
       <Link>src\File-system-demo.c</Link>\r
index 0ec02348926cdc3d8021d75d7f3be6ebfe890dff..ffaf4ecf1a48f69ee22434ad1225acca087f569b 100644 (file)
@@ -217,7 +217,7 @@ generate replies to incoming ICMP echo (ping) requests. */
 \r
 /* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the\r
 FreeRTOS_SendPingRequest() API function is available. */\r
-#define ipconfigSUPPORT_OUTGOING_PINGS                         0\r
+#define ipconfigSUPPORT_OUTGOING_PINGS                         1\r
 \r
 /* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()\r
 (and associated) API function is available. */\r
index b03439c0f2f102741052c66f04d13cc70b9e87ab..22376afca1d8e4a6bffa905aa4155d80a0ff823d 100644 (file)
@@ -154,6 +154,11 @@ extern void vRegisterSampleCLICommands( void );
  */\r
 extern void vRegisterFileSystemCLICommands( void );\r
 \r
+/*\r
+ * Register the UDP related commands that can be used with FreeRTOS+CLI.\r
+ */\r
+extern void vRegisterUDPCLICommands( void );\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /* The default IP and MAC address used by the demo.  The address configuration\r
@@ -191,12 +196,11 @@ xTimerHandle xTimer = NULL;
        }\r
        #endif\r
 \r
-       /* Register generic commands with the FreeRTOS+CLI command interpreter. */\r
+       /* Register example generic, file system related and UDP related CLI \r
+       commands respectively. */\r
        vRegisterSampleCLICommands();\r
-\r
-       /* Register file system related commands with the FreeRTOS+CLI command\r
-       interpreter. */\r
        vRegisterFileSystemCLICommands();\r
+       vRegisterUDPCLICommands();\r
 \r
        /* Initialise the network interface.  Tasks that use the network are\r
        created in the network event hook when the network is connected and ready\r
@@ -376,6 +380,31 @@ void vFullDemoTickHook( void )
        /* Call the queue set ISR test function. */\r
        vQueueSetAccessQueueSetFromISR();\r
 }\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called automatically when a reply to an outgoing ping is received. */\r
+void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier )\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
+}\r
 \r
 \r
 \r