EmberCommandEntry Struct Reference
Command entry for a command table.
#include <
command-interpreter2.h
>
Data Fields |
|
PGM_P | name |
CommandAction | action |
PGM_P | argumentTypes |
PGM_P | description |
PGM_P const * | argumentDescriptions |
Command entry for a command table.
Field Documentation
CommandAction EmberCommandEntry::action |
A reference to a function in the application that implements the command. If this entry refers to a nested command, then action field has to be set to NULL.
PGM_P const* EmberCommandEntry::argumentDescriptions |
An array of strings, with a NULL terminator, indicating what each argument is.
PGM_P EmberCommandEntry::argumentTypes |
In case of normal (non-nested) commands, argumentTypes is a string that specifies the number and types of arguments the command accepts. The argument specifiers are:
- u: one-byte unsigned integer.
- v: two-byte unsigned integer
- w: four-byte unsigned integer
- s: one-byte signed integer
- r: two-byte signed integer
- q: four-byte signed integer
- b: string. The argument can be entered in ascii by using quotes, for example: "foo". Or it may be entered in hex by using curly braces, for example: { 08 A1 f2 }. There must be an even number of hex digits, and spaces are ignored.
- *: zero or more of the previous type. If used, this must be the last specifier.
- ?: Unknown number of arguments. If used this must be the only character. This means, that command interpreter will not perform any validation of arguments, and will call the action directly, trusting it that it will handle with whatever arguments are passed in. Integer arguments can be either decimal or hexidecimal. A 0x prefix indicates a hexidecimal integer. Example: 0x3ed.
In case of a nested command (action is NULL), then this field contains a pointer to the nested EmberCommandEntry array.
PGM_P EmberCommandEntry::description |
A description of the command.
PGM_P EmberCommandEntry::name |
Use letters, digits, and underscores, '_', for the command name. Command names are case-sensitive.
The documentation for this struct was generated from the following file:
-
command-interpreter2.h