[Tinyos-devel] Patches to FTSP and CC2420 for 32kHz sync and LPL functionality

Razvan Musaloiu-E. razvanm at cs.jhu.edu
Thu Jun 25 18:46:47 PDT 2009


Hi!

On Thu, 25 Jun 2009, Philip Levis wrote:

>
> On Jun 19, 2009, at 3:13 PM, Razvan Musaloiu-E. wrote:
>
>> Hi!
>> 
>> On Thu, 18 Jun 2009, Philip Levis wrote:
>> 
>>> 
>>> On Jun 18, 2009, at 3:26 PM, Razvan Musaloiu-E. wrote:
>>> 
>>>> Hi!
>>>> On Thu, 18 Jun 2009, Philip Levis wrote:
>>>>> On Jun 17, 2009, at 5:41 PM, Razvan Musaloiu-E. wrote:
>>>>>> Actually, I implemented a default behavior for LPL some time ago:
>>>>>> 	http://hinrg.cs.jhu.edu/git/?p=razvanm/tinyos-2.x.git
>>>>> Can you point me at where in the tree it is?
>>>> The name of the branch is "default-lpl". Getting it by cloning the whole 
>>>> repository can be done using the following commands:
>>>> 	git clone git://hinrg.cs.jhu.edu/git/razvanm/tinyos-2.x.git
>>>> 	cd tinyos-2.x
>>>> 	git checkout -b default-lpl origin/default-lpl
>>>> In an already existing git tree the default-lpl can be imported using 
>>>> these commands:
>>>> 	git fetch git://hinrg.cs.jhu.edu/git/razvanm/tinyos-2.x.git 
>>>> default-lpl:refs/remotes/razvanm/default-lpl
>>>> 	git checkout -b default-lpl razvanm/default-lpl
>>> 
>>> Razvan,
>>> 
>>> This implementation looks great, with one exception: it would be nice if 
>>> the LPL setting were stored in a component, rather than being an 
>>> enum/define. That way, it is possible to write such a component so that 
>>> the setting could change at runtime. The standard one might just be a 
>>> function wrapper around the enum, but an ADT would be better.
>> 
>> Quick q: what should this ADT be? Should it be something like this:
>> 	http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430UartConfigure.nc?revision=1.4&view=markup
>> Another option is to be offer a modified LowPowerListening interface.
>
> No -- this isn't an ADT, it's a callback for per-client configuration. That's 
> the opposite of what we want here, which is a uniform LPL setting across 
> clients.
>
> I think ActiveMessageAddressC is a better example.
>

Here is an attempt: to configure the default lpl settings an application 
needs to shadow a component called DefaultLplSettingsC that looks like 
this:

 	configuration DefaultLplSettingsC
 	{
 	  provides interface DefaultLplSettings;
 	}

 	implementation
 	{
 	  // The parameters are: local sleep, rx sleep, delay after receive
 	  components new DefaultLplSettingsP(512, 512, 20);

 	  DefaultLplSettings = DefaultLplSettingsP;
 	}

Is this ok? :-)

This is already committed in the defaul-lpl-new branch of my tree:
 	http://hinrg.cs.jhu.edu/git/?p=razvanm/tinyos-2.x.git;a=shortlog;h=default-lpl-new

The implementation is a little messy due to the wirings necessary to make 
the settings accessible to all the places they are required. Something 
notable: in PowerCycleP.nc I had to use the Init interface to set a local 
variable to the proper value.

commit 50d5f569e45d74d87afdb39bc476c67f22e471e8
Author: Razvan Musaloiu-E <razvanm at cs.jhu.edu>
Date:   Thu Jun 25 20:37:28 2009 -0400

     Add DefaultLplSettingsC for declaring the LPL settings.

  apps/tests/TestNetworkLpl/Makefile   |    9 ---------
  tos/chips/cc2420/CC2420.h            |   11 -----------
  tos/chips/cc2420/lpl/DefaultLplC.nc  |    2 ++
  tos/chips/cc2420/lpl/DefaultLplP.nc  |    3 ++-
  tos/chips/cc2420/lpl/PowerCycleC.nc  |    7 +++++--
  tos/chips/cc2420/lpl/PowerCycleP.nc  |   12 ++++++++++--
  tos/interfaces/DefaultLplSettings.nc |    6 ++++++
  tos/system/DefaultLplSettingsC.nc    |   11 +++++++++++
  tos/system/DefaultLplSettingsP.nc    |   13 +++++++++++++
  tos/system/LplAMSenderC.nc           |    2 ++
  tos/system/LplAMSenderP.nc           |    3 ++-
  11 files changed, 53 insertions(+), 26 deletions(-)

--
Razvan ME


More information about the Tinyos-devel mailing list