2 FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.
\r
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
7 This file is part of the FreeRTOS distribution.
\r
9 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
10 the terms of the GNU General Public License (version 2) as published by the
\r
11 Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
\r
13 ***************************************************************************
\r
14 >>! NOTE: The modification to the GPL is included to allow you to !<<
\r
15 >>! distribute a combined work that includes FreeRTOS without being !<<
\r
16 >>! obliged to provide the source code for proprietary components !<<
\r
17 >>! outside of the FreeRTOS kernel. !<<
\r
18 ***************************************************************************
\r
20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
\r
23 link: http://www.freertos.org/a00114.html
\r
25 ***************************************************************************
\r
27 * FreeRTOS provides completely free yet professionally developed, *
\r
28 * robust, strictly quality controlled, supported, and cross *
\r
29 * platform software that is more than just the market leader, it *
\r
30 * is the industry's de facto standard. *
\r
32 * Help yourself get started quickly while simultaneously helping *
\r
33 * to support the FreeRTOS project by purchasing a FreeRTOS *
\r
34 * tutorial book, reference manual, or both: *
\r
35 * http://www.FreeRTOS.org/Documentation *
\r
37 ***************************************************************************
\r
39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
\r
40 the FAQ page "My application does not run, what could be wrong?". Have you
\r
41 defined configASSERT()?
\r
43 http://www.FreeRTOS.org/support - In return for receiving this top quality
\r
44 embedded software for free we request you assist our global community by
\r
45 participating in the support forum.
\r
47 http://www.FreeRTOS.org/training - Investing in training allows your team to
\r
48 be as productive as possible as early as possible. Now you can receive
\r
49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
\r
50 Ltd, and the world's leading authority on the world's leading RTOS.
\r
52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
\r
57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
\r
59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
\r
60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
61 licenses offer ticketed support, indemnification and commercial middleware.
\r
63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
64 engineered and independently SIL3 certified version for use in safety and
\r
65 mission critical applications that require provable dependability.
\r
70 /******************************************************************************
\r
72 * See the following URL for information on the commands defined in this file:
\r
73 * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml
\r
75 ******************************************************************************/
\r
78 /* FreeRTOS includes. */
\r
79 #include "FreeRTOS.h"
\r
82 /* Standard includes. */
\r
87 /* FreeRTOS+CLI includes. */
\r
88 #include "FreeRTOS_CLI.h"
\r
90 /* FreeRTOS+UDP includes, just to make the stats available to the CLI
\r
92 #include "FreeRTOS_UDP_IP.h"
\r
93 #include "FreeRTOS_Sockets.h"
\r
95 #ifndef configINCLUDE_TRACE_RELATED_CLI_COMMANDS
\r
96 #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0
\r
101 * Implements the run-time-stats command.
\r
103 static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
106 * Implements the task-stats command.
\r
108 static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
111 * Implements the echo-three-parameters command.
\r
113 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
116 * Implements the echo-parameters command.
\r
118 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
121 * Defines a command that prints out IP address information.
\r
123 static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
126 * Defines a command that prints out the gathered demo debug stats.
\r
128 static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
131 * Defines a command that sends an ICMP ping request to an IP address.
\r
133 static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
136 * Implements the "trace start" and "trace stop" commands;
\r
138 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
139 static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );
\r
142 /* Structure that defines the "ip-config" command line command. */
\r
143 static const CLI_Command_Definition_t xIPConfig =
\r
146 "ip-config:\r\n Displays IP address configuration\r\n\r\n",
\r
147 prvDisplayIPConfig,
\r
151 #if configINCLUDE_DEMO_DEBUG_STATS != 0
\r
152 /* Structure that defines the "ip-debug-stats" command line command. */
\r
153 static const CLI_Command_Definition_t xIPDebugStats =
\r
155 "ip-debug-stats", /* The command string to type. */
\r
156 "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",
\r
157 prvDisplayIPDebugStats, /* The function to run. */
\r
158 0 /* No parameters are expected. */
\r
160 #endif /* configINCLUDE_DEMO_DEBUG_STATS */
\r
162 /* Structure that defines the "run-time-stats" command line command. This
\r
163 generates a table that shows how much run time each task has */
\r
164 static const CLI_Command_Definition_t xRunTimeStats =
\r
166 "run-time-stats", /* The command string to type. */
\r
167 "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",
\r
168 prvRunTimeStatsCommand, /* The function to run. */
\r
169 0 /* No parameters are expected. */
\r
172 /* Structure that defines the "task-stats" command line command. This generates
\r
173 a table that gives information on each task in the system. */
\r
174 static const CLI_Command_Definition_t xTaskStats =
\r
176 "task-stats", /* The command string to type. */
\r
177 "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",
\r
178 prvTaskStatsCommand, /* The function to run. */
\r
179 0 /* No parameters are expected. */
\r
182 /* Structure that defines the "echo_3_parameters" command line command. This
\r
183 takes exactly three parameters that the command simply echos back one at a
\r
185 static const CLI_Command_Definition_t xThreeParameterEcho =
\r
187 "echo-3-parameters",
\r
188 "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",
\r
189 prvThreeParameterEchoCommand, /* The function to run. */
\r
190 3 /* Three parameters are expected, which can take any value. */
\r
193 /* Structure that defines the "echo_parameters" command line command. This
\r
194 takes a variable number of parameters that the command simply echos back one at
\r
196 static const CLI_Command_Definition_t xParameterEcho =
\r
199 "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",
\r
200 prvParameterEchoCommand, /* The function to run. */
\r
201 -1 /* The user can enter any number of commands. */
\r
204 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
206 /* Structure that defines the "ping" command line command. This takes an IP
\r
207 address or host name and (optionally) the number of bytes to ping as
\r
209 static const CLI_Command_Definition_t xPing =
\r
212 "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
213 prvPingCommand, /* The function to run. */
\r
214 -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */
\r
217 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
219 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
220 /* Structure that defines the "trace" command line command. This takes a single
\r
221 parameter, which can be either "start" or "stop". */
\r
222 static const CLI_Command_Definition_t xStartStopTrace =
\r
225 "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",
\r
226 prvStartStopTraceCommand, /* The function to run. */
\r
227 1 /* One parameter is expected. Valid values are "start" and "stop". */
\r
229 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
\r
231 /*-----------------------------------------------------------*/
\r
233 void vRegisterCLICommands( void )
\r
235 /* Register all the command line commands defined immediately above. */
\r
236 FreeRTOS_CLIRegisterCommand( &xTaskStats );
\r
237 FreeRTOS_CLIRegisterCommand( &xRunTimeStats );
\r
238 FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );
\r
239 FreeRTOS_CLIRegisterCommand( &xParameterEcho );
\r
240 FreeRTOS_CLIRegisterCommand( &xIPDebugStats );
\r
241 FreeRTOS_CLIRegisterCommand( &xIPConfig );
\r
243 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
245 FreeRTOS_CLIRegisterCommand( &xPing );
\r
247 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
249 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
250 FreeRTOS_CLIRegisterCommand( & xStartStopTrace );
\r
253 /*-----------------------------------------------------------*/
\r
255 static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
257 const char *const pcHeader = "Task State Priority Stack #\r\n************************************************\r\n";
\r
259 /* Remove compile time warnings about unused parameters, and check the
\r
260 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
261 write buffer length is adequate, so does not check for buffer overflows. */
\r
262 ( void ) pcCommandString;
\r
263 ( void ) xWriteBufferLen;
\r
264 configASSERT( pcWriteBuffer );
\r
266 /* Generate a table of task stats. */
\r
267 strcpy( pcWriteBuffer, pcHeader );
\r
268 vTaskList( pcWriteBuffer + strlen( pcHeader ) );
\r
270 /* There is no more data to return after this single string, so return
\r
274 /*-----------------------------------------------------------*/
\r
276 static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
278 const char * const pcHeader = "Task Abs Time % Time\r\n****************************************\r\n";
\r
280 /* Remove compile time warnings about unused parameters, and check the
\r
281 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
282 write buffer length is adequate, so does not check for buffer overflows. */
\r
283 ( void ) pcCommandString;
\r
284 ( void ) xWriteBufferLen;
\r
285 configASSERT( pcWriteBuffer );
\r
287 /* Generate a table of task stats. */
\r
288 strcpy( pcWriteBuffer, pcHeader );
\r
289 vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );
\r
291 /* There is no more data to return after this single string, so return
\r
295 /*-----------------------------------------------------------*/
\r
297 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
299 const char *pcParameter;
\r
300 BaseType_t xParameterStringLength, xReturn;
\r
301 static BaseType_t lParameterNumber = 0;
\r
303 /* Remove compile time warnings about unused parameters, and check the
\r
304 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
305 write buffer length is adequate, so does not check for buffer overflows. */
\r
306 ( void ) pcCommandString;
\r
307 ( void ) xWriteBufferLen;
\r
308 configASSERT( pcWriteBuffer );
\r
310 if( lParameterNumber == 0 )
\r
312 /* The first time the function is called after the command has been
\r
313 entered just a header string is returned. */
\r
314 sprintf( pcWriteBuffer, "The three parameters were:\r\n" );
\r
316 /* Next time the function is called the first parameter will be echoed
\r
318 lParameterNumber = 1L;
\r
320 /* There is more data to be returned as no parameters have been echoed
\r
326 /* Obtain the parameter string. */
\r
327 pcParameter = FreeRTOS_CLIGetParameter
\r
329 pcCommandString, /* The command string itself. */
\r
330 lParameterNumber, /* Return the next parameter. */
\r
331 &xParameterStringLength /* Store the parameter string length. */
\r
334 /* Sanity check something was returned. */
\r
335 configASSERT( pcParameter );
\r
337 /* Return the parameter string. */
\r
338 memset( pcWriteBuffer, 0x00, xWriteBufferLen );
\r
339 sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
\r
340 strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
\r
341 strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
\r
343 /* If this is the last of the three parameters then there are no more
\r
344 strings to return after this one. */
\r
345 if( lParameterNumber == 3L )
\r
347 /* If this is the last of the three parameters then there are no more
\r
348 strings to return after this one. */
\r
350 lParameterNumber = 0L;
\r
354 /* There are more parameters to return after this one. */
\r
356 lParameterNumber++;
\r
362 /*-----------------------------------------------------------*/
\r
364 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
366 const char *pcParameter;
\r
367 BaseType_t xParameterStringLength, xReturn;
\r
368 static BaseType_t lParameterNumber = 0;
\r
370 /* Remove compile time warnings about unused parameters, and check the
\r
371 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
372 write buffer length is adequate, so does not check for buffer overflows. */
\r
373 ( void ) pcCommandString;
\r
374 ( void ) xWriteBufferLen;
\r
375 configASSERT( pcWriteBuffer );
\r
377 if( lParameterNumber == 0 )
\r
379 /* The first time the function is called after the command has been
\r
380 entered just a header string is returned. */
\r
381 sprintf( pcWriteBuffer, "The parameters were:\r\n" );
\r
383 /* Next time the function is called the first parameter will be echoed
\r
385 lParameterNumber = 1L;
\r
387 /* There is more data to be returned as no parameters have been echoed
\r
393 /* Obtain the parameter string. */
\r
394 pcParameter = FreeRTOS_CLIGetParameter
\r
396 pcCommandString, /* The command string itself. */
\r
397 lParameterNumber, /* Return the next parameter. */
\r
398 &xParameterStringLength /* Store the parameter string length. */
\r
401 if( pcParameter != NULL )
\r
403 /* Return the parameter string. */
\r
404 memset( pcWriteBuffer, 0x00, xWriteBufferLen );
\r
405 sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );
\r
406 strncat( pcWriteBuffer, pcParameter, xParameterStringLength );
\r
407 strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );
\r
409 /* There might be more parameters to return after this one. */
\r
411 lParameterNumber++;
\r
415 /* No more parameters were found. Make sure the write buffer does
\r
416 not contain a valid string. */
\r
417 pcWriteBuffer[ 0 ] = 0x00;
\r
419 /* No more data to return. */
\r
422 /* Start over the next time this command is executed. */
\r
423 lParameterNumber = 0;
\r
429 /*-----------------------------------------------------------*/
\r
431 #if ipconfigSUPPORT_OUTGOING_PINGS == 1
\r
433 static BaseType_t prvPingCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
435 char * pcParameter;
\r
436 BaseType_t lParameterStringLength, xReturn;
\r
437 uint32_t ulIPAddress, ulBytesToPing;
\r
438 const uint32_t ulDefaultBytesToPing = 8UL;
\r
439 char cBuffer[ 16 ];
\r
441 /* Remove compile time warnings about unused parameters, and check the
\r
442 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
443 write buffer length is adequate, so does not check for buffer overflows. */
\r
444 ( void ) pcCommandString;
\r
445 ( void ) xWriteBufferLen;
\r
446 configASSERT( pcWriteBuffer );
\r
448 /* Start with an empty string. */
\r
449 pcWriteBuffer[ 0 ] = 0x00;
\r
451 /* Obtain the number of bytes to ping. */
\r
452 pcParameter = ( char * ) FreeRTOS_CLIGetParameter
\r
454 pcCommandString, /* The command string itself. */
\r
455 2, /* Return the second parameter. */
\r
456 &lParameterStringLength /* Store the parameter string length. */
\r
459 if( pcParameter == NULL )
\r
461 /* The number of bytes was not specified, so default it. */
\r
462 ulBytesToPing = ulDefaultBytesToPing;
\r
466 ulBytesToPing = atol( pcParameter );
\r
469 /* Obtain the IP address string. */
\r
470 pcParameter = ( char * ) FreeRTOS_CLIGetParameter
\r
472 pcCommandString, /* The command string itself. */
\r
473 1, /* Return the first parameter. */
\r
474 &lParameterStringLength /* Store the parameter string length. */
\r
477 /* Sanity check something was returned. */
\r
478 configASSERT( pcParameter );
\r
480 /* Attempt to obtain the IP address. If the first character is not a
\r
481 digit, assume the host name has been passed in. */
\r
482 if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )
\r
484 ulIPAddress = FreeRTOS_inet_addr( pcParameter );
\r
488 /* Terminate the host name. */
\r
489 pcParameter[ lParameterStringLength ] = 0x00;
\r
491 /* Attempt to resolve host. */
\r
492 ulIPAddress = FreeRTOS_gethostbyname( pcParameter );
\r
495 /* Convert IP address, which may have come from a DNS lookup, to string. */
\r
496 FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );
\r
498 if( ulIPAddress != 0 )
\r
500 xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );
\r
507 if( xReturn == pdFALSE )
\r
509 sprintf( pcWriteBuffer, "%s", "Could not send ping request\r\n" );
\r
513 sprintf( pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );
\r
518 /*-----------------------------------------------------------*/
\r
520 #endif /* ipconfigSUPPORT_OUTGOING_PINGS */
\r
522 #if configINCLUDE_DEMO_DEBUG_STATS != 0
\r
524 static BaseType_t prvDisplayIPDebugStats( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
526 static BaseType_t xIndex = -1;
\r
527 extern xExampleDebugStatEntry_t xIPTraceValues[];
\r
528 BaseType_t xReturn;
\r
530 /* Remove compile time warnings about unused parameters, and check the
\r
531 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
532 write buffer length is adequate, so does not check for buffer overflows. */
\r
533 ( void ) pcCommandString;
\r
534 ( void ) xWriteBufferLen;
\r
535 configASSERT( pcWriteBuffer );
\r
539 if( xIndex < xExampleDebugStatEntries() )
\r
541 sprintf( pcWriteBuffer, "%s %d\r\n", xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );
\r
546 /* Reset the index for the next time it is called. */
\r
549 /* Ensure nothing remains in the write buffer. */
\r
550 pcWriteBuffer[ 0 ] = 0x00;
\r
556 /*-----------------------------------------------------------*/
\r
558 #endif /* configINCLUDE_DEMO_DEBUG_STATS */
\r
560 static BaseType_t prvDisplayIPConfig( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
562 static BaseType_t xIndex = 0;
\r
563 BaseType_t xReturn;
\r
564 uint32_t ulAddress;
\r
566 /* Remove compile time warnings about unused parameters, and check the
\r
567 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
568 write buffer length is adequate, so does not check for buffer overflows. */
\r
569 ( void ) pcCommandString;
\r
570 ( void ) xWriteBufferLen;
\r
571 configASSERT( pcWriteBuffer );
\r
576 FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );
\r
577 sprintf( pcWriteBuffer, "\r\nIP address " );
\r
583 FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );
\r
584 sprintf( pcWriteBuffer, "\r\nNet mask " );
\r
590 FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );
\r
591 sprintf( pcWriteBuffer, "\r\nGateway address " );
\r
597 FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );
\r
598 sprintf( pcWriteBuffer, "\r\nDNS server address " );
\r
605 sprintf( pcWriteBuffer, "\r\n\r\n" );
\r
611 if( ulAddress != 0 )
\r
613 FreeRTOS_inet_ntoa( ulAddress, &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) );
\r
618 /*-----------------------------------------------------------*/
\r
620 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1
\r
622 static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
\r
624 const char *pcParameter;
\r
625 BaseType_t lParameterStringLength;
\r
627 /* Remove compile time warnings about unused parameters, and check the
\r
628 write buffer is not NULL. NOTE - for simplicity, this example assumes the
\r
629 write buffer length is adequate, so does not check for buffer overflows. */
\r
630 ( void ) pcCommandString;
\r
631 ( void ) xWriteBufferLen;
\r
632 configASSERT( pcWriteBuffer );
\r
634 /* Obtain the parameter string. */
\r
635 pcParameter = FreeRTOS_CLIGetParameter
\r
637 pcCommandString, /* The command string itself. */
\r
638 1, /* Return the first parameter. */
\r
639 &lParameterStringLength /* Store the parameter string length. */
\r
642 /* Sanity check something was returned. */
\r
643 configASSERT( pcParameter );
\r
645 /* There are only two valid parameter values. */
\r
646 if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )
\r
648 /* Start or restart the trace. */
\r
653 sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );
\r
655 else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )
\r
657 /* End the trace, if one is running. */
\r
659 sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );
\r
663 sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );
\r
666 /* There is no more data to return after this single string, so return
\r
671 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */
\r