BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
#include <bsp430/utility/cli.h>
Data Structures | |
union | uParam |
Data Fields | |
const char * | key |
const char * | help |
const sBSP430cliCompletionHelper * | completion_helper |
const struct sBSP430cliCommand *const | child |
const struct sBSP430cliCommand *const | next |
iBSP430cliHandlerFunction const | handler |
union sBSP430cliCommand::uParam | param |
The definition of a command, including the token that identifies it, optional help, subordinate and sibling command structures, and the handler that implements the operation given user input.
const struct sBSP430cliCommand* const sBSP430cliCommand::child |
Subordinate command structures.
This is an entrypoint to subordinate commands, e.g. further keywords that must be matched against argstr. When a command with a non-null child field is recognized and the remainder of the command string has a non-empty token, processing automatically continues with an attempt to identify a child that can process the remainder.
const sBSP430cliCompletionHelper* sBSP430cliCommand::completion_helper |
Optional pointer to material supporting customized completion.
iBSP430cliHandlerFunction const sBSP430cliCommand::handler |
The handler that implements this command. Under normal circumstances this must not be null.
const char* sBSP430cliCommand::help |
A description of the command.
The expected format of this string is an abstract representation of whatever would follow it; e.g. for a "set" command something like "[variable] [value]" would be appropriate.
To save space where diagnostics and interactive help are unnecessary, this may be a null pointer.
const char* sBSP430cliCommand::key |
The token used to match this command.
No key may be a prefix of the key of any sibling command. An incomplete command may thus be executed if it is a prefix of exactly one key in the sibling commands acceptable at that point in the parsed command string.
const struct sBSP430cliCommand* const sBSP430cliCommand::next |
The next command at this level.
When looking for a match, if key does not match processing continues with the next command in this chain.
sBSP430cliCommand::param |
A parameter providing additional information required for the command through sBSP430cliCommand::uParam. The value is generally used by sBSP430cliCommand::handler in this or a parent command structure. For example, iBSP430cliHandlerStoreUI() extracts the address of the variable into which the value should be stored from uParam::ptr.