FreeRTOS_CLI.h
BaseType_t FreeRTOS_CLIProcessCommand( int8_t *pcCommandInput,
int8_t *pcWriteBuffer,
size_t xWriteBufferLen );
FreeRTOS+CLI is an extensible framework that allows the application writer to define and register their own command line input commands. Separate documentation pages are provided that describe how to write a function that implements the behaviour of a user defined command, how to registers user defined commands with FreeRTOS+CLI, and how to implement a FreeRTOS+CLI task.
This page describes the FreeRTOS_CLIProcessCommand() function. FreeRTOS_CLIProcessCommand() is the API function that takes the string entered by the user at the command prompt, and if the string matches a registered command, executes the function that implements the command behaviour.
Parameters:
| pcCommandInput | The complete input string, exactly as entered by the user at the command prompt (which might be a UART console, keyboard, telnet client, or other user input client). |
| pcWriteBuffer |
If pcCommandInput does not contain a correctly formatted
command, then FreeRTOS_CLIProcessCommand() will output
a null terminated error message into the pcWriteBuffer buffer.
If pcCommandInput does contain a correctly formatted command, then FreeRTOS_CLIProcessCommand() will execute the function that implements the command behaviour, which will place its generated output into the pcWriteBuffer buffer. |
| xWriteBufferLen | The the size of the buffer pointed to by the pcWriteBuffer parameter. Writing more than xWriteBufferLen characters into pcWriteBuffer will cause a buffer overflow. |
Returns:
FreeRTOS_CLIProcessCommand() executes a function that implements the behaviour of a command, and returns the value returned by the function it executed. These values are described on the Implementing a Command page.