Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
FreeRTOS website now available in Simplified Chinese
New FreeRTOS Long Term Support version now available.
FreeRTOS Extended Maintenance Program (EMP) registration now open.
FreeRTOS-Plus-TCP v3.0.0 released:
Featured FreeRTOS IoT Integrations:

FreeRTOS_CLIGetOutputBuffer()

FreeRTOS_CLI.h

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.


Parameters:

None.

Returns:

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.