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.



const char *FreeRTOS_CLIGetParameter( const char *pcCommandString, 
                                         UBaseType_t uxWantedParameter, 
                                         BaseType_t *pxParameterStringLength )		

FreeRTOS-Plus-CLI is an extensible framework that allows the application writer to define and register their own command line input commands. Functions that implement the behaviour of a user defined command have to use a particular interface, which is described on a separate page.

Some commands take parameters. For example, a file system "copy" command needs the name of the source file and the name of the destination file. This page describes a helper function called FreeRTOS_CLIGetParameter() that is provided by FreeRTOS-Plus-CLI to make input parameter parsing easy.

FreeRTOS_CLIGetParameter() takes the full command string and the position of the requested parameter as inputs, and produces a pointer to the start of the requested parameter and the length of the parameter string in bytes as outputs.


pcCommandString   A pointer to the entire command string, as entered by the user.
ucWantedParameter   The position of the parameter being requested within the command string. For example, if the input command was "copy [source_file] [destination_file]", set ucWantedParameter to 1 to request the name and length of the source_file parameter. Set ucWantedParameter to 2 to request the name and length of the destination_file parameter.
pucParameterStringLength   The string length of the parameter being requested is returned in *pucParameterStringLength. For example, if the parameter text was "filename.txt", then *pucParameterStringLength will be set to 12, as there are 12 characters in the string.


A pointer to the start of the parameter being requested is returned. For example, if the full command string is "copy file1.txt file2.txt", and ucWantedParameter is 2, FreeRTOS_CLIGetParameter() will return a pointer to the 'f' of "file2.txt".


An example is provided on the Implementing A Command page.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.