Interface: moteiv.tos.interfaces.PowerKeepAlive

interface PowerKeepAlive

Interface for components that implement an automatic shutdown power management policy. Services are signalled with the shutdown event before entering a low power state. If a service immediately calls the keepAlive command, the component will remain awake.

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

Commands
command bool isAlive() Query the subsystem to determine if it is alive.
command result_t keepAlive() Instruct the subsystem to remain awake through the keep alive event.

Events
event void shutdown() Notification that the subsystem is about to be shutdown.

Commands - Details

isAlive

command bool isAlive()

Query the subsystem to determine if it is alive.

Returns:
TRUE if the system is alive, FALSE otherwise.

keepAlive

command result_t keepAlive()

Instruct the subsystem to remain awake through the keep alive event.

Returns:
SUCCESS if the system has remained awake or if the system will start due to the keep alive command. FAIL if the system has already shut down or if the request cannot be satisfied at this time.

Events - Details

shutdown

event void shutdown()

Notification that the subsystem is about to be shutdown. When receiving a shutdown event, the subsystem may be kept alive through the keepalive command. This command must be called within the shutdown() event.