]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/UDPCommandServer.c
Update FreeRTOS+ more demos that use FreeRTOS+CLI to remove casting to int8_t * from...
[freertos] / FreeRTOS-Plus / Demo / Common / FreeRTOS_Plus_UDP_Demos / CLICommands / UDPCommandServer.c
index 819d13bfb4f5fbd614af5819b63e0994a4a62fea..3677908a38a3a0d9a7940aeaf55674e92a800cef 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -108,7 +108,7 @@ void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, uns
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-/* \r
+/*\r
  * Task that provides the input and output for the FreeRTOS+CLI command\r
  * interpreter.  In this case a UDP port is used.  See the URL in the comments\r
  * within main.c for the location of the online documentation.\r
@@ -117,7 +117,7 @@ void vUDPCommandInterpreterTask( void *pvParameters )
 {\r
 long lBytes, lByte;\r
 signed char cInChar, cInputIndex = 0;\r
-static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
+static char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
 portBASE_TYPE xMoreDataToFollow;\r
 struct freertos_sockaddr xClient;\r
 socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */\r
@@ -152,25 +152,25 @@ xSocket_t xSocket;
                                        string. */\r
                                        if( cInChar == '\n' )\r
                                        {\r
-                                               /* Process the input string received prior to the \r
+                                               /* Process the input string received prior to the\r
                                                newline. */\r
                                                do\r
                                                {\r
                                                        /* Pass the string to FreeRTOS+CLI. */\r
                                                        xMoreDataToFollow = FreeRTOS_CLIProcessCommand( cInputString, cOutputString, cmdMAX_OUTPUT_SIZE );\r
-                                                       \r
+\r
                                                        /* Send the output generated by the command's\r
                                                        implementation. */\r
-                                                       FreeRTOS_sendto( xSocket, cOutputString,  strlen( ( const char * ) cOutputString ), 0, &xClient, xClientAddressLength );\r
+                                                       FreeRTOS_sendto( xSocket, cOutputString,  strlen( cOutputString ), 0, &xClient, xClientAddressLength );\r
 \r
                                                } while( xMoreDataToFollow != pdFALSE ); /* Until the command does not generate any more output. */\r
 \r
-                                               /* All the strings generated by the command processing \r
-                                               have been sent.  Clear the input string ready to receive \r
+                                               /* All the strings generated by the command processing\r
+                                               have been sent.  Clear the input string ready to receive\r
                                                the next command. */\r
                                                cInputIndex = 0;\r
                                                memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
-                                               \r
+\r
                                                /* Transmit a spacer, just to make the command console\r
                                                easier to read. */\r
                                                FreeRTOS_sendto( xSocket, "\r\n",  strlen( "\r\n" ), 0, &xClient, xClientAddressLength );\r
@@ -179,12 +179,12 @@ xSocket_t xSocket;
                                        {\r
                                                if( cInChar == '\r' )\r
                                                {\r
-                                                       /* Ignore the character.  Newlines are used to \r
+                                                       /* Ignore the character.  Newlines are used to\r
                                                        detect the end of the input string. */\r
                                                }\r
                                                else if( cInChar == '\b' )\r
                                                {\r
-                                                       /* Backspace was pressed.  Erase the last character \r
+                                                       /* Backspace was pressed.  Erase the last character\r
                                                        in the string - if any. */\r
                                                        if( cInputIndex > 0 )\r
                                                        {\r
@@ -206,7 +206,7 @@ xSocket_t xSocket;
                                        }\r
                                }\r
                        }\r
-               } \r
+               }\r
        }\r
        else\r
        {\r
@@ -232,7 +232,7 @@ xSocket_t xSocket = FREERTOS_INVALID_SOCKET;
 \r
                /* Bind the address to the socket. */\r
                if( FreeRTOS_bind( xSocket, &xServer, sizeof( xServer ) ) == -1 )\r
-               {                       \r
+               {\r
                        FreeRTOS_closesocket( xSocket );\r
                        xSocket = FREERTOS_INVALID_SOCKET;\r
                }\r