BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Data Fields
sBSP430cliCommand Struct Reference

#include <bsp430/utility/cli.h>

Data Structures

union  uParam
 

Data Fields

const char * key
 
const char * help
 
const sBSP430cliCompletionHelpercompletion_helper
 
const struct sBSP430cliCommand *const child
 
const struct sBSP430cliCommand *const next
 
iBSP430cliHandlerFunction const handler
 
union sBSP430cliCommand::uParam param
 

Detailed Description

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.

Examples:
periph/timer/alarm/main.c, rf/cc3000/cli/main.c, and utility/cli/main.c.

Field Documentation

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.

Dependency:
configBSP430_CLI_COMMAND_COMPLETION_HELPER
iBSP430cliHandlerFunction const sBSP430cliCommand::handler

The handler that implements this command. Under normal circumstances this must not be null.

Examples:
rf/cc3000/cli/main.c, and utility/cli/main.c.
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.

Examples:
periph/timer/alarm/main.c, rf/cc3000/cli/main.c, and utility/cli/main.c.
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.

Examples:
utility/cli/main.c.
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.


The documentation for this struct was generated from the following file: