Interface: tos.interfaces.SplitControl

interface SplitControl

Please refer to TEP 115 for more information about this interface and its intended use.

This is the split-phase counterpart to the StdContol interface. It should be used for switching between the on and off power states of the component providing it. For each start() or stop() command, if the command returns SUCCESS, then a corresponding startDone() or stopDone() event must be signalled.

Author:
Joe Polastre
Kevin Klues (klueska@cs.wustl.edu)

Commands
command error_t start() Start this component and all of its subcomponents.
command error_t stop() Start this component and all of its subcomponents.

Events
event void startDone(error_t error) Notify caller that the component has been started and is ready to receive other commands.
event void stopDone(error_t error) Notify caller that the component has been stopped.

Commands - Details

start

command error_t start()

Start this component and all of its subcomponents. Return values of SUCCESS will always result in a startDone() event being signalled.

Returns:
SUCCESS if the device is already in the process of starting or the device was off and the device is now ready to turn on. After receiving this return value, you should expect a startDone event in the near future.
EBUSY if the component is in the middle of powering down i.e. a stop() command has been called, and a stopDone() event is pending
EALREADY if the device is already on
FAIL Otherwise

stop

command error_t stop()

Start this component and all of its subcomponents. Return values of SUCCESS will always result in a startDone() event being signalled.

Returns:
SUCCESS if the device is already in the process of stopping or the device was on and the device is now ready to turn off. After receiving this return value, you should expect a stopDone event in the near future.
EBUSY if the component is in the middle of powering up i.e. a start() command has been called, and a startDone() event is pending
EALREADY if the device is already off
FAIL Otherwise

Events - Details

startDone

event void startDone(error_t error)

Notify caller that the component has been started and is ready to receive other commands.

Parameters:
error -- SUCCESS if the component was successfully turned on, FAIL otherwise

stopDone

event void stopDone(error_t error)

Notify caller that the component has been stopped.

Parameters:
error -- SUCCESS if the component was successfully turned off, FAIL otherwise