Apps Components Interfaces All Files Source Tree | source: tos.interfaces.CommandUse.nc |
Interface for using Commands. Commands provide a generic mechanism for registering and executing named commands via AM messages or a local interface.
See lib/Commands/... for examples of components that register commands.
See interfaces/Command.h for the data structures used in this interface
Implemented by lib/Command.td
Author: | Wei Hong (wei.hong@intel-research.net) |
Commands |
Events |
Commands - Details |
Parameters: |
idx - The (0-based) index of the command of interest |
Returns: | A pointer to the command descriptor, or NULL if no such command exists. |
Parameters: |
commandName - The command to invoke. resultBuf - The buffer to write results into (must be at least sizeOf(CommandDesc.retType) bytes long) errorNo - (on return) The result code (may signal a split-phase invocation, for which a commandDone event will be fired later) See SchemaType.h for a list of possible result codes params - The parameters to this funtion. |
Parameters: |
msg - The command message. The format of this message is a packed array representing the name of the command, followed by a packed list of parameters. See java/net/tinyos/tinydb/CommandMsgs.java for an example of a Java program that invokes a command. resultBuf - The result buffer to write results into errorNo - (on return)The result code |
Events - Details |
Parameters: |
commandName - The command that was completed resultBuf - The buffer where the results were written errorNo - The return code from the invocation. |