int8_t *FreeRTOS_CLIGetOutputBuffer( void );
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 register user defined commands with FreeRTOS+CLI,
and how to integrate FreeRTOS+CLI into a FreeRTOS task.
This page describes the optional FreeRTOS_CLIGetOutputBuffer() function.
Command interpreter implementations require an output buffer that is used to hold any output generated by running a command.
If FreeRTOS+CLI is used to implement a single command interpreter interface, the output buffer can be defined locally to the task or file that that executes the FreeRTOS_CLIProcessCommand() API function.
If FreeRTOS+CLI is used to implement a command interpreter on multiple interfaces, a UART and a TCP/IP socket for example, then both interfaces could provide their own output buffers in the same manner. However, if only one of the interfaces is going to be used at a time, then RAM can be saved by having both interfaces share a single output buffer. FreeRTOS_CLIGetOutputBuffer() is provided to make this easier.
FreeRTOS_CLIGetOutputBuffer() does nothing more than return the address of an output buffer that is declared within the FreeRTOS+CLI code – removing the need for command interface implementations to declare their own.
The size of the buffer is defined by the configCOMMAND_INT_MAX_OUTPUT_SIZE constant, which should be defined in FreeRTOSConfig.h whenever FreeRTOS+CLI is used.
configCOMMAND_INT_MAX_OUTPUT_SIZE should be set to 1 to minimise RAM usage if all command interpreter interfaces use their own locally defined buffers, and the FreeRTOS_CLIGetOutputBuffer() API function is not used.