2 * FreeRTOS Kernel V10.3.0
\r
3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 * http://www.FreeRTOS.org
\r
23 * http://aws.amazon.com/freertos
\r
25 * 1 tab == 4 spaces!
\r
28 /******************************************************************************
\r
30 * See the following URL for information on the commands defined in this file:
\r
31 * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml
\r
33 ******************************************************************************/
\r
36 /* FreeRTOS includes. */
\r
37 #include "FreeRTOS.h"
\r
40 /* Standard includes. */
\r
45 /* FreeRTOS+CLI includes. */
\r
46 #include "FreeRTOS_CLI.h"
\r
48 /* FreeRTOS+UDP includes, just to make the stats available to the CLI
\r
50 #include "FreeRTOS_UDP_IP.h"
\r
51 #include "FreeRTOS_Sockets.h"
\r
53 #ifndef configINCLUDE_TRACE_RELATED_CLI_COMMANDS
\r
54 #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0
\r
59 * Implements the run-time-stats command.
\r
61 static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
64 * Implements the task-stats command.
\r
66 static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
69 * Implements the echo-three-parameters command.
\r
71 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
74 * Implements the echo-parameters command.
\r
76 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
79 * Defines a command that prints out IP address information.
\r
81 static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
84 * Defines a command that prints out the gathered demo debug stats.
\r
86 static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
89 * Defines a command that sends an ICMP ping request to an IP address.
\r
91 static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
94 * Implements the "trace start" and "trace stop" commands;
\r
96 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
97 static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
100 /* Structure that defines the "ip-config" command line command. */
\r
101 static const CLI_Command_Definition_t xIPConfig =
\r
104 "ip-config:\r\n Displays IP address configuration\r\n\r\n",
\r
105 prvDisplayIPConfig,
\r
109 #if configINCLUDE_DEMO_DEBUG_STATS != 0
\r
110 /* Structure that defines the "ip-debug-stats" command line command. */
\r
111 static const CLI_Command_Definition_t xIPDebugStats =
\r
113 "ip-debug-stats", /* The command string to type. */
\r
114 "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",
\r
115 prvDisplayIPDebugStats, /* The function to run. */
\r
116 0 /* No parameters are expected. */
\r
118 #endif /* configINCLUDE_DEMO_DEBUG_STATS */
\r
120 /* Structure that defines the "run-time-stats" command line command. This
\r
121 generates a table that shows how much run time each task has */
\r
122 static const CLI_Command_Definition_t xRunTimeStats =
\r
124 "run-time-stats", /* The command string to type. */
\r
125 "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",
\r
126 prvRunTimeStatsCommand, /* The function to run. */
\r
127 0 /* No parameters are expected. */
\r
130 /* Structure that defines the "task-stats" command line command. This generates
\r
131 a table that gives information on each task in the system. */
\r
132 static const CLI_Command_Definition_t xTaskStats =
\r
134 "task-stats", /* The command string to type. */
\r
135 "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",
\r
136 prvTaskStatsCommand, /* The function to run. */
\r
137 0 /* No parameters are expected. */
\r
140 /* Structure that defines the "echo_3_parameters" command line command. This
\r
141 takes exactly three parameters that the command simply echos back one at a
\r
143 static const CLI_Command_Definition_t xThreeParameterEcho =
\r
145 "echo-3-parameters",
\r
146 "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",
\r
147 prvThreeParameterEchoCommand, /* The function to run. */
\r
148 3 /* Three parameters are expected, which can take any value. */
\r
151 /* Structure that defines the "echo_parameters" command line command. This
\r
152 takes a variable number of parameters that the command simply echos back one at
\r
154 static const CLI_Command_Definition_t xParameterEcho =
\r
157 "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",
\r
158 prvParameterEchoCommand, /* The function to run. */
\r
159 -1 /* The user can enter any number of commands. */
\r
162 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
164 /* Structure that defines the "ping" command line command. This takes an IP
\r
165 address or host name and (optionally) the number of bytes to ping as
\r
167 static const CLI_Command_Definition_t xPing =
\r
170 "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",
\r
171 prvPingCommand, /* The function to run. */
\r
172 -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */
\r
175 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
177 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
178 /* Structure that defines the "trace" command line command. This takes a single
\r
179 parameter, which can be either "start" or "stop". */
\r
180 static const CLI_Command_Definition_t xStartStopTrace =
\r
183 "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",
\r
184 prvStartStopTraceCommand, /* The function to run. */
\r
185 1 /* One parameter is expected. Valid values are "start" and "stop". */
\r
187 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
\r
189 /*-----------------------------------------------------------*/
\r
191 void vRegisterCLICommands( void )
\r
193 /* Register all the command line commands defined immediately above. */
\r
194 FreeRTOS_CLIRegisterCommand( &xTaskStats );
\r
195 FreeRTOS_CLIRegisterCommand( &xRunTimeStats );
\r
196 FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );
\r
197 FreeRTOS_CLIRegisterCommand( &xParameterEcho );
\r
198 FreeRTOS_CLIRegisterCommand( &xIPDebugStats );
\r
199 FreeRTOS_CLIRegisterCommand( &xIPConfig );
\r
201 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
203 FreeRTOS_CLIRegisterCommand( &xPing );
\r
205 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
207 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
208 FreeRTOS_CLIRegisterCommand( & xStartStopTrace );
\r
211 /*-----------------------------------------------------------*/
\r
213 static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
215 const char *const pcHeader = " State\tPriority\tStack\t#\r\n************************************************\r\n";
\r
216 BaseType_t xSpacePadding;
\r
218 /* Remove compile time warnings about unused parameters, and check the
\r
219 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
220 write buffer length is adequate, so does not check for buffer overflows. */
\r
221 ( void ) pcCommandString;
\r
222 ( void ) xWriteBufferLen;
\r
223 configASSERT( pcWriteBuffer );
\r
225 /* Generate a table of task stats. */
\r
226 strcpy( pcWriteBuffer, "Task" );
\r
227 pcWriteBuffer += strlen( pcWriteBuffer );
\r
229 /* Pad the string "task" with however many bytes necessary to make it the
\r
230 length of a task name. Minus three for the null terminator and half the
\r
231 number of characters in "Task" so the column lines up with the centre of
\r
233 for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
\r
235 /* Add a space to align columns after the task's name. */
\r
236 *pcWriteBuffer = ' ';
\r
239 /* Ensure always terminated. */
\r
240 *pcWriteBuffer = 0x00;
\r
242 strcpy( pcWriteBuffer, pcHeader );
\r
243 vTaskList( pcWriteBuffer + strlen( pcHeader ) );
\r
245 /* There is no more data to return after this single string, so return
\r
249 /*-----------------------------------------------------------*/
\r
251 static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
253 const char * const pcHeader = " Abs Time % Time\r\n****************************************\r\n";
\r
254 BaseType_t xSpacePadding;
\r
256 /* Remove compile time warnings about unused parameters, and check the
\r
257 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
258 write buffer length is adequate, so does not check for buffer overflows. */
\r
259 ( void ) pcCommandString;
\r
260 ( void ) xWriteBufferLen;
\r
261 configASSERT( pcWriteBuffer );
\r
263 /* Generate a table of task stats. */
\r
264 strcpy( pcWriteBuffer, "Task" );
\r
265 pcWriteBuffer += strlen( pcWriteBuffer );
\r
267 /* Pad the string "task" with however many bytes necessary to make it the
\r
268 length of a task name. Minus three for the null terminator and half the
\r
269 number of characters in "Task" so the column lines up with the centre of
\r
271 for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
\r
273 /* Add a space to align columns after the task's name. */
\r
274 *pcWriteBuffer = ' ';
\r
277 /* Ensure always terminated. */
\r
278 *pcWriteBuffer = 0x00;
\r
281 strcpy( pcWriteBuffer, pcHeader );
\r
282 vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );
\r
284 /* There is no more data to return after this single string, so return
\r
288 /*-----------------------------------------------------------*/
\r
290 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
292 const char *pcParameter;
\r
293 BaseType_t xParameterStringLength, xReturn;
\r
294 static BaseType_t lParameterNumber = 0;
\r
296 /* Remove compile time warnings about unused parameters, and check the
\r
297 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
298 write buffer length is adequate, so does not check for buffer overflows. */
\r
299 ( void ) pcCommandString;
\r
300 ( void ) xWriteBufferLen;
\r
301 configASSERT( pcWriteBuffer );
\r
303 if( lParameterNumber == 0 )
\r
305 /* The first time the function is called after the command has been
\r
306 entered just a header string is returned. */
\r
307 sprintf( pcWriteBuffer, "The three parameters were:\r\n" );
\r
309 /* Next time the function is called the first parameter will be echoed
\r
311 lParameterNumber = 1L;
\r
313 /* There is more data to be returned as no parameters have been echoed
\r
319 /* Obtain the parameter string. */
\r
320 pcParameter = FreeRTOS_CLIGetParameter
\r
322 pcCommandString, /* The command string itself. */
\r
323 lParameterNumber, /* Return the next parameter. */
\r
324 &xParameterStringLength /* Store the parameter string length. */
\r
327 /* Sanity check something was returned. */
\r
328 configASSERT( pcParameter );
\r
330 /* Return the parameter string. */
\r
331 memset( pcWriteBuffer, 0x00, xWriteBufferLen );
\r
332 sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
\r
333 strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
\r
334 strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
\r
336 /* If this is the last of the three parameters then there are no more
\r
337 strings to return after this one. */
\r
338 if( lParameterNumber == 3L )
\r
340 /* If this is the last of the three parameters then there are no more
\r
341 strings to return after this one. */
\r
343 lParameterNumber = 0L;
\r
347 /* There are more parameters to return after this one. */
\r
349 lParameterNumber++;
\r
355 /*-----------------------------------------------------------*/
\r
357 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
359 const char *pcParameter;
\r
360 BaseType_t xParameterStringLength, xReturn;
\r
361 static BaseType_t lParameterNumber = 0;
\r
363 /* Remove compile time warnings about unused parameters, and check the
\r
364 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
365 write buffer length is adequate, so does not check for buffer overflows. */
\r
366 ( void ) pcCommandString;
\r
367 ( void ) xWriteBufferLen;
\r
368 configASSERT( pcWriteBuffer );
\r
370 if( lParameterNumber == 0 )
\r
372 /* The first time the function is called after the command has been
\r
373 entered just a header string is returned. */
\r
374 sprintf( pcWriteBuffer, "The parameters were:\r\n" );
\r
376 /* Next time the function is called the first parameter will be echoed
\r
378 lParameterNumber = 1L;
\r
380 /* There is more data to be returned as no parameters have been echoed
\r
386 /* Obtain the parameter string. */
\r
387 pcParameter = FreeRTOS_CLIGetParameter
\r
389 pcCommandString, /* The command string itself. */
\r
390 lParameterNumber, /* Return the next parameter. */
\r
391 &xParameterStringLength /* Store the parameter string length. */
\r
394 if( pcParameter != NULL )
\r
396 /* Return the parameter string. */
\r
397 memset( pcWriteBuffer, 0x00, xWriteBufferLen );
\r
398 sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
\r
399 strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
\r
400 strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
\r
402 /* There might be more parameters to return after this one. */
\r
404 lParameterNumber++;
\r
408 /* No more parameters were found. Make sure the write buffer does
\r
409 not contain a valid string. */
\r
410 pcWriteBuffer[ 0 ] = 0x00;
\r
412 /* No more data to return. */
\r
415 /* Start over the next time this command is executed. */
\r
416 lParameterNumber = 0;
\r
422 /*-----------------------------------------------------------*/
\r
424 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
426 static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
428 char * pcParameter;
\r
429 BaseType_t lParameterStringLength, xReturn;
\r
430 uint32_t ulIPAddress, ulBytesToPing;
\r
431 const uint32_t ulDefaultBytesToPing = 8UL;
\r
432 char cBuffer[ 16 ];
\r
434 /* Remove compile time warnings about unused parameters, and check the
\r
435 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
436 write buffer length is adequate, so does not check for buffer overflows. */
\r
437 ( void ) pcCommandString;
\r
438 ( void ) xWriteBufferLen;
\r
439 configASSERT( pcWriteBuffer );
\r
441 /* Start with an empty string. */
\r
442 pcWriteBuffer[ 0 ] = 0x00;
\r
444 /* Obtain the number of bytes to ping. */
\r
445 pcParameter = ( char * ) FreeRTOS_CLIGetParameter
\r
447 pcCommandString, /* The command string itself. */
\r
448 2, /* Return the second parameter. */
\r
449 &lParameterStringLength /* Store the parameter string length. */
\r
452 if( pcParameter == NULL )
\r
454 /* The number of bytes was not specified, so default it. */
\r
455 ulBytesToPing = ulDefaultBytesToPing;
\r
459 ulBytesToPing = atol( pcParameter );
\r
462 /* Obtain the IP address string. */
\r
463 pcParameter = ( char * ) FreeRTOS_CLIGetParameter
\r
465 pcCommandString, /* The command string itself. */
\r
466 1, /* Return the first parameter. */
\r
467 &lParameterStringLength /* Store the parameter string length. */
\r
470 /* Sanity check something was returned. */
\r
471 configASSERT( pcParameter );
\r
473 /* Attempt to obtain the IP address. If the first character is not a
\r
474 digit, assume the host name has been passed in. */
\r
475 if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )
\r
477 ulIPAddress = FreeRTOS_inet_addr( pcParameter );
\r
481 /* Terminate the host name. */
\r
482 pcParameter[ lParameterStringLength ] = 0x00;
\r
484 /* Attempt to resolve host. */
\r
485 ulIPAddress = FreeRTOS_gethostbyname( pcParameter );
\r
488 /* Convert IP address, which may have come from a DNS lookup, to string. */
\r
489 FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
\r
491 if( ulIPAddress != 0 )
\r
493 xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );
\r
500 if( xReturn == pdFALSE )
\r
502 sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );
\r
506 sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );
\r
511 /*-----------------------------------------------------------*/
\r
513 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
515 #if configINCLUDE_DEMO_DEBUG_STATS != 0
\r
517 static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
519 static BaseType_t xIndex = -1;
\r
520 extern xExampleDebugStatEntry_t xIPTraceValues[];
\r
521 BaseType_t xReturn;
\r
523 /* Remove compile time warnings about unused parameters, and check the
\r
524 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
525 write buffer length is adequate, so does not check for buffer overflows. */
\r
526 ( void ) pcCommandString;
\r
527 ( void ) xWriteBufferLen;
\r
528 configASSERT( pcWriteBuffer );
\r
532 if( xIndex < xExampleDebugStatEntries() )
\r
534 sprintf( pcWriteBuffer, "%s %d\r\n", xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );
\r
539 /* Reset the index for the next time it is called. */
\r
542 /* Ensure nothing remains in the write buffer. */
\r
543 pcWriteBuffer[ 0 ] = 0x00;
\r
549 /*-----------------------------------------------------------*/
\r
551 #endif /* configINCLUDE_DEMO_DEBUG_STATS */
\r
553 static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
555 static BaseType_t xIndex = 0;
\r
556 BaseType_t xReturn;
\r
557 uint32_t ulAddress;
\r
559 /* Remove compile time warnings about unused parameters, and check the
\r
560 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
561 write buffer length is adequate, so does not check for buffer overflows. */
\r
562 ( void ) pcCommandString;
\r
563 ( void ) xWriteBufferLen;
\r
564 configASSERT( pcWriteBuffer );
\r
569 FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
\r
570 sprintf( pcWriteBuffer, "\r\nIP address " );
\r
576 FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
\r
577 sprintf( pcWriteBuffer, "\r\nNet mask " );
\r
583 FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
\r
584 sprintf( pcWriteBuffer, "\r\nGateway address " );
\r
590 FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
\r
591 sprintf( pcWriteBuffer, "\r\nDNS server address " );
\r
598 sprintf( pcWriteBuffer, "\r\n\r\n" );
\r
604 if( ulAddress != 0 )
\r
606 FreeRTOS_inet_ntoa( ulAddress, &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) );
\r
611 /*-----------------------------------------------------------*/
\r
613 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
615 static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
617 const char *pcParameter;
\r
618 BaseType_t lParameterStringLength;
\r
620 /* Remove compile time warnings about unused parameters, and check the
\r
621 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
622 write buffer length is adequate, so does not check for buffer overflows. */
\r
623 ( void ) pcCommandString;
\r
624 ( void ) xWriteBufferLen;
\r
625 configASSERT( pcWriteBuffer );
\r
627 /* Obtain the parameter string. */
\r
628 pcParameter = FreeRTOS_CLIGetParameter
\r
630 pcCommandString, /* The command string itself. */
\r
631 1, /* Return the first parameter. */
\r
632 &lParameterStringLength /* Store the parameter string length. */
\r
635 /* Sanity check something was returned. */
\r
636 configASSERT( pcParameter );
\r
638 /* There are only two valid parameter values. */
\r
639 if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )
\r
641 /* Start or restart the trace. */
\r
646 sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
\r
648 else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )
\r
650 /* End the trace, if one is running. */
\r
652 sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );
\r
656 sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
\r
659 /* There is no more data to return after this single string, so return
\r
664 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
\r