[Tinyos Core WG] button and TEP 112
Philip Levis
pal at cs.stanford.edu
Sun Dec 3 17:06:28 PST 2006
How does this sound:
Following Gil's observations, the simple interface to a button uses
SIDs. Notify for state change (with a bool for the state) and Get for
state querying. So there's something like
component TelosUserButtonC {
provides interface Notify<bool>;
provides interface Get<bool>;
}
One difference here is that there is no enable/disable. This would
assume either the abstraction is dedicated or using generic
components (with a masking scheme for inactive clients). I'm not sure
which would be a better approach. In theory, you can always build the
latter on top of the former.
The ButtonAdvanced is a little tricker. Its exact semantics aren't
that clear from the source code, but that could be fixed later.
Again, I think Gil is right that it's for a particular sensor
processing scheme, in that it allows certain operations and not
others. It would also be tricker to make into a service (or at least
more expensive), due to the need for per-instance timers. But that is
unlikely to be an issue. I could certainly imagine other higher-level
interfaces, such as one that reports single clock events with the
duration the button was depressed.
Concrete proposal:
discard Button, use SIDs
bring up ButtonAdvanced at next meeting to discuss whether it should
1) Exist as is without any changes
2) Exist as is but be renamed
3) Be changed but keep the same name
4) Be changed and be renamed
I personally lean towards 2 or 4; we should either keep it as and
name it ButtonMulti or perhaps make it a bit more general and name it
Button.
I hope to get the recommended edits into TEP 112 (and take a look at
the atm128 timer system wrt McuPowerOverride) early this week so we
can move forward on it. Apologies for the delay: the past few weeks
have been spent trying to finish up the last rough edges on the
release and traveling like mad.
Phil
More information about the Tinyos-2.0wg
mailing list