]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / Common / FreeRTOS_Plus_CLI_Demos / Sample-CLI-commands.c
1 /*\r
2     FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \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
12 \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
19 \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
24 \r
25     ***************************************************************************\r
26      *                                                                       *\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
31      *                                                                       *\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
36      *                                                                       *\r
37     ***************************************************************************\r
38 \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
42 \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
46 \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
51 \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
55 \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
58 \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
62 \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
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70 \r
71  /******************************************************************************\r
72  *\r
73  * See the following URL for information on the commands defined in this file:\r
74  * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml\r
75  *\r
76  ******************************************************************************/\r
77 \r
78 \r
79 /* FreeRTOS includes. */\r
80 #include "FreeRTOS.h"\r
81 #include "task.h"\r
82 \r
83 /* Standard includes. */\r
84 #include <stdint.h>\r
85 #include <stdio.h>\r
86 #include <stdlib.h>\r
87 #include <string.h>\r
88 \r
89 /* FreeRTOS+CLI includes. */\r
90 #include "FreeRTOS_CLI.h"\r
91 \r
92 #ifndef  configINCLUDE_TRACE_RELATED_CLI_COMMANDS\r
93         #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0\r
94 #endif\r
95 \r
96 #ifndef configINCLUDE_QUERY_HEAP_COMMAND\r
97         #define configINCLUDE_QUERY_HEAP_COMMAND 0\r
98 #endif\r
99 \r
100 /*\r
101  * The function that registers the commands that are defined within this file.\r
102  */\r
103 void vRegisterSampleCLICommands( void );\r
104 \r
105 /*\r
106  * Implements the task-stats command.\r
107  */\r
108 #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
109         static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
110 #endif\r
111 \r
112 /*\r
113  * Implements the run-time-stats command.\r
114  */\r
115 #if( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
116         static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
117 #endif\r
118 \r
119 /*\r
120  * Implements the echo-three-parameters command.\r
121  */\r
122 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
123 \r
124 /*\r
125  * Implements the echo-parameters command.\r
126  */\r
127 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
128 \r
129 /*\r
130  * Implements the "query heap" command.\r
131  */\r
132 #if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )\r
133         static BaseType_t prvQueryHeapCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
134 #endif\r
135 \r
136 /*\r
137  * Implements the "trace start" and "trace stop" commands;\r
138  */\r
139 #if( configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 )\r
140         static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString );\r
141 #endif\r
142 \r
143 /* Structure that defines the "run-time-stats" command line command.   This\r
144 generates a table that shows how much run time each task has */\r
145 #if( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
146         static const CLI_Command_Definition_t xRunTimeStats =\r
147         {\r
148                 "run-time-stats", /* The command string to type. */\r
149                 "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n",\r
150                 prvRunTimeStatsCommand, /* The function to run. */\r
151                 0 /* No parameters are expected. */\r
152         };\r
153 #endif\r
154 \r
155 /* Structure that defines the "task-stats" command line command.  This generates\r
156 a table that gives information on each task in the system. */\r
157 #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
158         static const CLI_Command_Definition_t xTaskStats =\r
159         {\r
160                 "task-stats", /* The command string to type. */\r
161                 "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n",\r
162                 prvTaskStatsCommand, /* The function to run. */\r
163                 0 /* No parameters are expected. */\r
164         };\r
165 #endif\r
166 \r
167 /* Structure that defines the "echo_3_parameters" command line command.  This\r
168 takes exactly three parameters that the command simply echos back one at a\r
169 time. */\r
170 static const CLI_Command_Definition_t xThreeParameterEcho =\r
171 {\r
172         "echo-3-parameters",\r
173         "\r\necho-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n",\r
174         prvThreeParameterEchoCommand, /* The function to run. */\r
175         3 /* Three parameters are expected, which can take any value. */\r
176 };\r
177 \r
178 /* Structure that defines the "echo_parameters" command line command.  This\r
179 takes a variable number of parameters that the command simply echos back one at\r
180 a time. */\r
181 static const CLI_Command_Definition_t xParameterEcho =\r
182 {\r
183         "echo-parameters",\r
184         "\r\necho-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n",\r
185         prvParameterEchoCommand, /* The function to run. */\r
186         -1 /* The user can enter any number of commands. */\r
187 };\r
188 \r
189 #if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )\r
190         /* Structure that defines the "query_heap" command line command. */\r
191         static const CLI_Command_Definition_t xQueryHeap =\r
192         {\r
193                 "query-heap",\r
194                 "\r\nquery-heap:\r\n Displays the free heap space, and minimum ever free heap space.\r\n",\r
195                 prvQueryHeapCommand, /* The function to run. */\r
196                 0 /* The user can enter any number of commands. */\r
197         };\r
198 #endif /* configQUERY_HEAP_COMMAND */\r
199 \r
200 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
201         /* Structure that defines the "trace" command line command.  This takes a single\r
202         parameter, which can be either "start" or "stop". */\r
203         static const CLI_Command_Definition_t xStartStopTrace =\r
204         {\r
205                 "trace",\r
206                 "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n",\r
207                 prvStartStopTraceCommand, /* The function to run. */\r
208                 1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
209         };\r
210 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r
211 \r
212 /*-----------------------------------------------------------*/\r
213 \r
214 void vRegisterSampleCLICommands( void )\r
215 {\r
216         /* Register all the command line commands defined immediately above. */\r
217         FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );\r
218         FreeRTOS_CLIRegisterCommand( &xParameterEcho );\r
219 \r
220         #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
221         {\r
222                 FreeRTOS_CLIRegisterCommand( &xTaskStats );\r
223         }\r
224         #endif\r
225 \r
226         #if( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
227         {\r
228                 FreeRTOS_CLIRegisterCommand( &xRunTimeStats );\r
229         }\r
230         #endif\r
231 \r
232         #if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )\r
233         {\r
234                 FreeRTOS_CLIRegisterCommand( &xQueryHeap );\r
235         }\r
236         #endif\r
237 \r
238         #if( configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 )\r
239         {\r
240                 FreeRTOS_CLIRegisterCommand( &xStartStopTrace );\r
241         }\r
242         #endif\r
243 }\r
244 /*-----------------------------------------------------------*/\r
245 \r
246 #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
247 \r
248         static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
249         {\r
250         const char *const pcHeader = " State\tPriority\tStack\t#\r\n************************************************\r\n";\r
251         BaseType_t xSpacePadding;\r
252 \r
253                 /* Remove compile time warnings about unused parameters, and check the\r
254                 write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
255                 write buffer length is adequate, so does not check for buffer overflows. */\r
256                 ( void ) pcCommandString;\r
257                 ( void ) xWriteBufferLen;\r
258                 configASSERT( pcWriteBuffer );\r
259 \r
260                 /* Generate a table of task stats. */\r
261                 strcpy( pcWriteBuffer, "Task" );\r
262                 pcWriteBuffer += strlen( pcWriteBuffer );\r
263 \r
264                 /* Minus three for the null terminator and half the number of characters in\r
265                 "Task" so the column lines up with the centre of the heading. */\r
266                 configASSERT( configMAX_TASK_NAME_LEN > 3 );\r
267                 for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )\r
268                 {\r
269                         /* Add a space to align columns after the task's name. */\r
270                         *pcWriteBuffer = ' ';\r
271                         pcWriteBuffer++;\r
272 \r
273                         /* Ensure always terminated. */\r
274                         *pcWriteBuffer = 0x00;\r
275                 }\r
276                 strcpy( pcWriteBuffer, pcHeader );\r
277                 vTaskList( pcWriteBuffer + strlen( pcHeader ) );\r
278 \r
279                 /* There is no more data to return after this single string, so return\r
280                 pdFALSE. */\r
281                 return pdFALSE;\r
282         }\r
283 \r
284 #endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */\r
285 /*-----------------------------------------------------------*/\r
286 \r
287 #if( configINCLUDE_QUERY_HEAP_COMMAND == 1 )\r
288 \r
289         static BaseType_t prvQueryHeapCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
290         {\r
291                 /* Remove compile time warnings about unused parameters, and check the\r
292                 write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
293                 write buffer length is adequate, so does not check for buffer overflows. */\r
294                 ( void ) pcCommandString;\r
295                 ( void ) xWriteBufferLen;\r
296                 configASSERT( pcWriteBuffer );\r
297 \r
298                 sprintf( pcWriteBuffer, "Current free heap %d bytes, minimum ever free heap %d bytes\r\n", ( int ) xPortGetFreeHeapSize(), ( int ) xPortGetMinimumEverFreeHeapSize() );\r
299 \r
300                 /* There is no more data to return after this single string, so return\r
301                 pdFALSE. */\r
302                 return pdFALSE;\r
303         }\r
304 \r
305 #endif /* configINCLUDE_QUERY_HEAP */\r
306 /*-----------------------------------------------------------*/\r
307 \r
308 #if( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )\r
309 \r
310         static BaseType_t prvRunTimeStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
311         {\r
312         const char * const pcHeader = "Task            Abs Time      % Time\r\n****************************************\r\n";\r
313 \r
314                 /* Remove compile time warnings about unused parameters, and check the\r
315                 write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
316                 write buffer length is adequate, so does not check for buffer overflows. */\r
317                 ( void ) pcCommandString;\r
318                 ( void ) xWriteBufferLen;\r
319                 configASSERT( pcWriteBuffer );\r
320 \r
321                 /* Generate a table of task stats. */\r
322                 strcpy( pcWriteBuffer, pcHeader );\r
323                 vTaskGetRunTimeStats( pcWriteBuffer + strlen( pcHeader ) );\r
324 \r
325                 /* There is no more data to return after this single string, so return\r
326                 pdFALSE. */\r
327                 return pdFALSE;\r
328         }\r
329 \r
330 #endif /* configGENERATE_RUN_TIME_STATS */\r
331 /*-----------------------------------------------------------*/\r
332 \r
333 static BaseType_t prvThreeParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
334 {\r
335 const char *pcParameter;\r
336 BaseType_t xParameterStringLength, xReturn;\r
337 static BaseType_t lParameterNumber = 0;\r
338 \r
339         /* Remove compile time warnings about unused parameters, and check the\r
340         write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
341         write buffer length is adequate, so does not check for buffer overflows. */\r
342         ( void ) pcCommandString;\r
343         ( void ) xWriteBufferLen;\r
344         configASSERT( pcWriteBuffer );\r
345 \r
346         if( lParameterNumber == 0 )\r
347         {\r
348                 /* The first time the function is called after the command has been\r
349                 entered just a header string is returned. */\r
350                 sprintf( pcWriteBuffer, "The three parameters were:\r\n" );\r
351 \r
352                 /* Next time the function is called the first parameter will be echoed\r
353                 back. */\r
354                 lParameterNumber = 1L;\r
355 \r
356                 /* There is more data to be returned as no parameters have been echoed\r
357                 back yet. */\r
358                 xReturn = pdPASS;\r
359         }\r
360         else\r
361         {\r
362                 /* Obtain the parameter string. */\r
363                 pcParameter = FreeRTOS_CLIGetParameter\r
364                                                 (\r
365                                                         pcCommandString,                /* The command string itself. */\r
366                                                         lParameterNumber,               /* Return the next parameter. */\r
367                                                         &xParameterStringLength /* Store the parameter string length. */\r
368                                                 );\r
369 \r
370                 /* Sanity check something was returned. */\r
371                 configASSERT( pcParameter );\r
372 \r
373                 /* Return the parameter string. */\r
374                 memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
375                 sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
376                 strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
377                 strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
378 \r
379                 /* If this is the last of the three parameters then there are no more\r
380                 strings to return after this one. */\r
381                 if( lParameterNumber == 3L )\r
382                 {\r
383                         /* If this is the last of the three parameters then there are no more\r
384                         strings to return after this one. */\r
385                         xReturn = pdFALSE;\r
386                         lParameterNumber = 0L;\r
387                 }\r
388                 else\r
389                 {\r
390                         /* There are more parameters to return after this one. */\r
391                         xReturn = pdTRUE;\r
392                         lParameterNumber++;\r
393                 }\r
394         }\r
395 \r
396         return xReturn;\r
397 }\r
398 /*-----------------------------------------------------------*/\r
399 \r
400 static BaseType_t prvParameterEchoCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
401 {\r
402 const char *pcParameter;\r
403 BaseType_t xParameterStringLength, xReturn;\r
404 static BaseType_t lParameterNumber = 0;\r
405 \r
406         /* Remove compile time warnings about unused parameters, and check the\r
407         write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
408         write buffer length is adequate, so does not check for buffer overflows. */\r
409         ( void ) pcCommandString;\r
410         ( void ) xWriteBufferLen;\r
411         configASSERT( pcWriteBuffer );\r
412 \r
413         if( lParameterNumber == 0 )\r
414         {\r
415                 /* The first time the function is called after the command has been\r
416                 entered just a header string is returned. */\r
417                 sprintf( pcWriteBuffer, "The parameters were:\r\n" );\r
418 \r
419                 /* Next time the function is called the first parameter will be echoed\r
420                 back. */\r
421                 lParameterNumber = 1L;\r
422 \r
423                 /* There is more data to be returned as no parameters have been echoed\r
424                 back yet. */\r
425                 xReturn = pdPASS;\r
426         }\r
427         else\r
428         {\r
429                 /* Obtain the parameter string. */\r
430                 pcParameter = FreeRTOS_CLIGetParameter\r
431                                                 (\r
432                                                         pcCommandString,                /* The command string itself. */\r
433                                                         lParameterNumber,               /* Return the next parameter. */\r
434                                                         &xParameterStringLength /* Store the parameter string length. */\r
435                                                 );\r
436 \r
437                 if( pcParameter != NULL )\r
438                 {\r
439                         /* Return the parameter string. */\r
440                         memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
441                         sprintf( pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
442                         strncat( pcWriteBuffer, pcParameter, xParameterStringLength );\r
443                         strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
444 \r
445                         /* There might be more parameters to return after this one. */\r
446                         xReturn = pdTRUE;\r
447                         lParameterNumber++;\r
448                 }\r
449                 else\r
450                 {\r
451                         /* No more parameters were found.  Make sure the write buffer does\r
452                         not contain a valid string. */\r
453                         pcWriteBuffer[ 0 ] = 0x00;\r
454 \r
455                         /* No more data to return. */\r
456                         xReturn = pdFALSE;\r
457 \r
458                         /* Start over the next time this command is executed. */\r
459                         lParameterNumber = 0;\r
460                 }\r
461         }\r
462 \r
463         return xReturn;\r
464 }\r
465 /*-----------------------------------------------------------*/\r
466 \r
467 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
468 \r
469         static BaseType_t prvStartStopTraceCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )\r
470         {\r
471         const char *pcParameter;\r
472         BaseType_t lParameterStringLength;\r
473 \r
474                 /* Remove compile time warnings about unused parameters, and check the\r
475                 write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
476                 write buffer length is adequate, so does not check for buffer overflows. */\r
477                 ( void ) pcCommandString;\r
478                 ( void ) xWriteBufferLen;\r
479                 configASSERT( pcWriteBuffer );\r
480 \r
481                 /* Obtain the parameter string. */\r
482                 pcParameter = FreeRTOS_CLIGetParameter\r
483                                                 (\r
484                                                         pcCommandString,                /* The command string itself. */\r
485                                                         1,                                              /* Return the first parameter. */\r
486                                                         &lParameterStringLength /* Store the parameter string length. */\r
487                                                 );\r
488 \r
489                 /* Sanity check something was returned. */\r
490                 configASSERT( pcParameter );\r
491 \r
492                 /* There are only two valid parameter values. */\r
493                 if( strncmp( pcParameter, "start", strlen( "start" ) ) == 0 )\r
494                 {\r
495                         /* Start or restart the trace. */\r
496                         vTraceStop();\r
497                         vTraceClear();\r
498                         vTraceStart();\r
499 \r
500                         sprintf( pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
501                 }\r
502                 else if( strncmp( pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
503                 {\r
504                         /* End the trace, if one is running. */\r
505                         vTraceStop();\r
506                         sprintf( pcWriteBuffer, "Stopping trace recording.\r\n" );\r
507                 }\r
508                 else\r
509                 {\r
510                         sprintf( pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
511                 }\r
512 \r
513                 /* There is no more data to return after this single string, so return\r
514                 pdFALSE. */\r
515                 return pdFALSE;\r
516         }\r
517 \r
518 #endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r