Component: SimpleCmdM
SimpleCmdM is a tiny OS application module.
This module demonstrates a simple command interpreter for the TinyOS
tutorial. The module receives a command message from the radio, which
is passed to the ProcessCmd interface for processing. A task is posted
to process the command. The command packet contains a one-byte
'action' field specifying which action to take; as a simple version,
this module can only interpret the follwoing commands:
Led_on (action = 1), Led_off (2), radio_quieter (3), and radio_louder (4).
This module also implements the ProcessCmd interface.
Author:
| Robert Szewczyk
|
|
Su Ping
|
- TOS_MsgPtr msg
- int8_t pending
- TOS_Msg buf
-
task void
cmdInterpret
(void)
-
command result_t
StdControl.init
(void)
-
command result_t
StdControl.start
(void)
-
command result_t
StdControl.stop
(void)
-
command result_t
ProcessCmd.execute
(TOS_MsgPtr pmsg)
-
event TOS_MsgPtr
ReceiveCmdMsg.receive
(TOS_MsgPtr pmsg)
-
event result_t
ProcessCmd.done
(TOS_MsgPtr pmsg, result_t status)
cmdInterpret
task void cmdInterpret(void)
StdControl.init
command result_t StdControl.init
(void)
ProcessCmd.execute
command result_t ProcessCmd.execute
(TOS_MsgPtr pmsg)
ReceiveCmdMsg.receive
event TOS_MsgPtr ReceiveCmdMsg.receive
(TOS_MsgPtr pmsg)
ProcessCmd.done
event result_t ProcessCmd.done
(TOS_MsgPtr pmsg, result_t status)