[Tinyos-devel] Patches to FTSP and CC2420 for 32kHz sync and LPL functionality
Razvan Musaloiu-E.
razvanm at cs.jhu.edu
Sat Jun 27 19:13:15 PDT 2009
Hi!
On Sat, 27 Jun 2009, Omprakash Gnawali wrote:
> On Sat, Jun 27, 2009 at 4:18 PM, Razvan Musaloiu-E.<razvanm at cs.jhu.edu> wrote:
>> Hi!
>>
>> On Sat, 27 Jun 2009, Razvan Musaloiu-E. wrote:
>>
>>> Hi!
>>>
>>> On Sat, 27 Jun 2009, Philip Levis wrote:
>>>
>>>>
>>>> On Jun 26, 2009, at 6:35 PM, Razvan Musaloiu-E. wrote:
>>>>
>>>>> I update the default-lpl-new branch to use a SystemLowPowerListeningC
>>>>> instead of DefaultLplSettingsC. The new interface is like this:
>>>>>
>>>>> interface SystemLowPowerListening
>>>>> {
>>>>> command void setLocalSleepInterval(uint16_t interval);
>>>>> command void setRxSleepInterval(uint16_t interval);
>>>>> command void setDelayAfterReceive(uint16_t interval);
>>>>>
>>>>> command uint16_t getRxSleepInterval();
>>>>> command uint16_t getDelayAfterReceive();
>>>>> }
>>>>>
>>>>> The setX calls are used by the user application while the getX are used by
>>>>> LplAMSenderP and DefaulLplP. One drawback of this is the fact that it
>>>>> doesn't prevent the user from calling the setX at the wrong time. :|
>>>>
>>>> This looks good -- I think my one comment would be to change RxSleepInterval
>>>> to DefaultDestinationSleepInterval. That seems clearer to me.
>>>
>>> Good point. I'll make this change.
>>>
>>>> I agree on the issues with the set calls. One solution here is that you have
>>>> an error_t return value, with can return FAIL if done at the wrong time
>>>> (e.g., radio is on).
>>>>
>>>
>>> I'm going to try to add this too by hooking up to the SplitControl of the
>>> ActiveMessageC and and tracking the startDone/stopDone.
>>>
>>
>> I made the above two changes:
>> http://hinrg.cs.jhu.edu/git/?p=razvanm/tinyos-2.x.git;a=shortlog;h=default-lpl-new
>> So now the SystemLowPowerListening is like this:
>>
>> interface SystemLowPowerListening
>> {
>> command error_t setLocalSleepInterval(uint16_t interval);
>> command void setDefaultDestinationSleepInterval(uint16_t interval);
>> command void setDelayAfterReceive(uint16_t interval);
>>
>> command uint16_t getDefaultDestinationSleepInterval();
>> command uint16_t getDelayAfterReceive();
>> }
>>
>> Note that I renamed setRxSleepInterval to DefaultDestinationSleepInterval
>> only in SystemLowPowerListening. The LowPowerListening interface still
>> carries the setRxSleepInterval command. Should I also change it there?
>
> Are you going to somehow force this to be singleton?
>
I just made the setLocalSleepInterval return FAIL when the radio is on. So
you can call it when the radio is off (or more correctly said, the
duty-cycle is off). The previous design, in which a the settings were
declared by shadowing was used, did not have this issue because there were
no set calls that could be made. :P
--
Razvan ME
More information about the Tinyos-devel
mailing list