Interface: moteiv.tos.lib.resource.Arbiter
interface Arbiter
Please refer to TEP 108 for more information about this interface and its
intended use.
The Arbiter interface allows a component to query the current
status of an arbiter. It must be provided by ALL arbiter implementations,
and can be used for a variety of different purposes. Normally it will be
used in conjunction with the Resource interface for performing run time
checks on access rights to a particular shared resource.
Loosely based on the proposal from TEP 108 and TOS2 with some minor
modifications, namely:
ArbiterInfo (TEP 108) and Arbiter are synonomous
requested() and idle() are part of the Arbiter interface instead of
ResourceController.
userId in TEP 108 is called user in the Arbiter interface.
- Author:
-
Cory Sharp, Moteiv Corporation <info@moteiv.com>
-
Kevin Klues (klueska@cs.wustl.edu)
Commands
command bool inUse()
command uint8_t user()
Events
event void idle()
event void requested()
Commands - Details
inUse
command bool inUse()
- Returns:
-
TRUE If the resource being arbitrated is currently allocated
to any of its users
FALSE Otherwise.
user
command uint8_t user()
- Returns:
-
Id of the current owner of the resource
RESOURCE_NONE if no one currently owns the resource
Events - Details
idle
event void idle()
requested
event void requested()