From a5e969a23631f38c51a44cdee0d0d377521748c2 Mon Sep 17 00:00:00 2001 From: razvanm Date: Wed, 21 Oct 2009 19:11:51 +0000 Subject: [PATCH] Switch to the new LowPowerListening interface --- apps/tests/TestLpl/README.txt | 10 ++-------- apps/tests/TestLpl/TestLplC.nc | 16 +++++----------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/apps/tests/TestLpl/README.txt b/apps/tests/TestLpl/README.txt index 1add1755..d0092953 100644 --- a/apps/tests/TestLpl/README.txt +++ b/apps/tests/TestLpl/README.txt @@ -4,7 +4,7 @@ Author/Contact: tinyos-help@millennium.berkeley.edu Description: A simple low-power-listening test app, which cycles through different -low-power-listening settings every ~32s, repeating every ~256s. +low-power-listening settings every ~32s, repeating every ~192s. This application currently runs on motes using the CC1000, CC2420 and RF230 radios. To compile for motes with CC2420 or RF230 radios, you @@ -36,16 +36,10 @@ Its low-power-listening settings are as follows (repeating every 256s): 160-192s: receive: low-power-listening with 2000ms interval send: every 7 seconds, to low-power-listeners with 2000ms interval -192-224s: receive: low-power-listening with 1% duty cycle - send: every 7 seconds, to low-power-listeners with 1% duty cycle - -224-256s: receive: low-power-listening with 0.1% duty cycle - send: every 7 seconds, to low-power-listeners with 0.1% duty cycle - Whether two motes running TestLPL can receive each others messages depends on their current send and receive low-power-listening settings. If you reset two such motes at the same time, they will be able to receive each other's -messages in the following intervals: 0-96s and 128-256s. +messages in the following intervals: 0-96s and 128-192s. Tools: diff --git a/apps/tests/TestLpl/TestLplC.nc b/apps/tests/TestLpl/TestLplC.nc index 0920f136..b186e65d 100644 --- a/apps/tests/TestLpl/TestLplC.nc +++ b/apps/tests/TestLpl/TestLplC.nc @@ -68,31 +68,25 @@ implementation case 0: sendSkip = 0; sendInterval = 0; - call LowPowerListening.setLocalSleepInterval(0); + call LowPowerListening.setLocalWakeupInterval(0); break; case 1: sendInterval = 100; /* Send to sleepy listener */ break; case 2: sendInterval = -1; /* Send to listener like us */ - call LowPowerListening.setLocalSleepInterval(250); + call LowPowerListening.setLocalWakeupInterval(250); break; case 3: sendInterval = 0; /* Send to awake listener */ break; case 4: sendInterval = -1; /* Send to listener like us */ - call LowPowerListening.setLocalSleepInterval(10); + call LowPowerListening.setLocalWakeupInterval(10); break; case 5: sendSkip = 7; /* Send every 7s */ - call LowPowerListening.setLocalSleepInterval(2000); - break; - case 6: - call LowPowerListening.setLocalDutyCycle(100); - break; - case 7: - call LowPowerListening.setLocalDutyCycle(10); + call LowPowerListening.setLocalWakeupInterval(2000); break; } } @@ -106,7 +100,7 @@ implementation if (!locked && ((counter & sendSkip) == sendSkip)) { if (sendInterval >= 0) - call LowPowerListening.setRxSleepInterval(&packet, sendInterval); + call LowPowerListening.setRemoteWakeupInterval(&packet, sendInterval); if (call AMSend.send(AM_BROADCAST_ADDR, &packet, 0) == SUCCESS) { call Leds.led0On(); -- 2.39.2