Download FreeRTOS

Quality RTOS & Embedded Software

New FreeRTOS Long Term Support version released
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.



char *FreeRTOS_CLIGetOutputBuffer( void );
FreeRTOS-Plus-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-Plus-CLI, and how to integrate FreeRTOS-Plus-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-Plus-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-Plus-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-Plus-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-Plus-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.

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.