[Tinyos Core WG] Tep 115
Kevin Klues
klueska at gmail.com
Sun Feb 11 22:44:10 PST 2007
My personal inclination is to follow an approach similar to the one taken by
the XE1205. It keeps the device driver implementation simple, while
providing enough useful information to its clients in the rare case that
they mistakenly call start or stop at inappropriate times.
Specifically, I'm leaning towards the following solution:
If the device is currently off......
- Calling start() returns SUCCESS if it was capable of starting the process
of initializing the device, it returns FAIL if it could not, and it returns
EBUSY if there is a pending stop() in progress. Any redundant calls to
start either while it is in the process of starting (i.e. before its
startDone gets signaled) or calls made after the device has been started
also return FAIL. In this way, SUCCESS always signifies that the processing
of starting a device was successful, EBUSY signifies that the request could
not be processed because the device is in the process of powering down (but
will be available for powerup shortly), and FAIL means that start simply
should never have been called in the first place.
- Calling stop() always returns FAIL
If the device is currently on, then the reverse is true, and all calls to
start() will always FAIL.
In terms of the table.....
+-----------+-----------+------------+----------+----------+
| Call | Device On | Device Off | Starting | Stopping |
+===========+===========+============+==========+==========+
| start() | FAIL | SUCCESS | FAIL | EBUSY |
| | | FAIL | | |
+-----------+-----------+------------+----------+----------+
| stop() | SUCCESS | FAIL | EBUSY | FAIL |
| | FAIL | | | |
+-----------+-----------+------------+----------+----------+
| operation | depends | EOFF | FAIL | FAIL |
+-----------+-----------+------------+----------+----------+
Operations called on the device while it is off will return EOFF in order to
inform its user that the device needs to be turned on. Calls made while
switching state will simply return FAIL.
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-2.0wg/attachments/20070212/dac68b1c/attachment.htm
More information about the Tinyos-2.0wg
mailing list