EmberCommandEntry Struct Reference

Command entry for a command table.

#include <command-interpreter2.h>

Data Fields

union {
   PGM_P   name
 
   uint16_t   id
 
identifier
 
CommandAction action
 
PGM_P argumentTypes
 
PGM_P description

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 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 hexadecimal. A 0x prefix indicates a hexadecimal integer. Example: 0x3ed.

In case of a nested command (action is NULL), then argumentTypes will contain a pointer to the nested commands.

PGM_P EmberCommandEntry::description

A description of the command.

uint16_t EmberCommandEntry::id

A two-byte identifier for serial communication

union { ... } EmberCommandEntry::identifier
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