[Tinyos-devel] LPL API for protocols
Omprakash Gnawali
gnawali at usc.edu
Sat May 17 11:18:46 PDT 2008
I wanted to get a consensus on coding convention that *most* protocol
developers should expect to follow if they want to use LPL. The timing
for this discussion is right because we think the LPL API is more or
less standardized and net2 is preparing to make all its protocol
LPL-enabled.
It seems there are two ways to LPL-enable a protocol - call rxinterval
on a per packet basis for each send call or use some kind of configure
interface that David mentioned a while ago. The problem with the first
approach is it keeps the LPL parameters hidden deep in the protocol
code which makes it harder for users to tweak the parameters. The
problem with the second approach as of now is it has not been
standardized yet, or at least that is my understanding. We used the
first approach to LPL-enable CTP for our preliminary exploration but
we found this approach has parameter visibility problem - you have to
hunt down the rxinterval calls whenever you want to know what it is or
to set it.
Because it is important to provide the visibility of the parameters to
the users of the protocol and also enable the users to set the
parameters without having to change the protocol source code, it seems
the best approach might be to have something like LPLConfig interface
which the user can call to set the LPL parameters. The protocol sits
on top of a thin layer that exports AMSend interface and does a
pass-through of all the calls and events except for setting the LPL
parameters on a per packet basis with the states set by the LPLConfig
interface. This is similar to the configure idea that David had - but
not the same.
I don't think we are considering using Makefile variables to set the
LPL parameters.
Looking forward to hearing your ideas, suggestions, and experiences on
this topic.
- om_p
More information about the Tinyos-devel
mailing list