Interface: moteiv.tos.interfaces.PowerControl

interface PowerControl

Interface for starting and stopping components that are under automatic shutdown for power management purposes. Using PowerControl can wake the component out of its shutdown state. If the system is already running and start() is called, a startDone() event will be signalled immediately. The same semantic is true for stop() and stopDone().

Author:
Joe Polastre, Moteiv Corporation <info@moteiv.com>
Cory Sharp, Moteiv Corporation <cory@moteiv.com>

Commands
command result_t start() Start the subsystem.
command result_t stop() Request the subsystem to stop.

Events
event void started() The subsystem is now started.
event void stopped() The subsystem is now stopped.

Commands - Details

start

command result_t start()

Start the subsystem. A started event will occur later.

Returns:
SUCCESS if the system is now starting or is already running, FAIL if the subsystem will not start.

stop

command result_t stop()

Request the subsystem to stop. This is only a request, PowerKeepAlive.shutdown is signaled, and the subsystem remains awake if a component calls PowerKeepAlive.keepAlive.

Returns:
SUCCESS if the subsystem is going to shutdown, FAIL if the subsystem is going to stay awake.

Events - Details

started

event void started()

The subsystem is now started. This event is signalled any time the system is started from a stop state.

stopped

event void stopped()

The subsystem is now stopped. This event is signalled any time the system is stopped from a start state.