From 1e12ec1e6ce70a5765c7602d3bb32e3c90412d4b Mon Sep 17 00:00:00 2001 From: sallai Date: Wed, 3 Feb 2010 16:50:27 +0000 Subject: [PATCH] LPL interface changes --- tos/chips/cc1000/CC1000ActiveMessageC.nc | 2 ++ tos/chips/cc1000/CC1000CsmaP.nc | 32 +++--------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/tos/chips/cc1000/CC1000ActiveMessageC.nc b/tos/chips/cc1000/CC1000ActiveMessageC.nc index 7c888373..1ad985b9 100644 --- a/tos/chips/cc1000/CC1000ActiveMessageC.nc +++ b/tos/chips/cc1000/CC1000ActiveMessageC.nc @@ -53,6 +53,7 @@ configuration CC1000ActiveMessageC { interface PacketTimeStamp as PacketTimeStamp32khz; interface PacketTimeStamp as PacketTimeStampMilli; interface PacketTimeSyncOffset; + interface LowPowerListening; } } implementation { @@ -78,4 +79,5 @@ implementation { PacketTimeStamp32khz = Radio; PacketTimeStampMilli = Radio; PacketTimeSyncOffset = Radio; + LowPowerListening = Radio; } diff --git a/tos/chips/cc1000/CC1000CsmaP.nc b/tos/chips/cc1000/CC1000CsmaP.nc index f5884fd4..698ab8cb 100644 --- a/tos/chips/cc1000/CC1000CsmaP.nc +++ b/tos/chips/cc1000/CC1000CsmaP.nc @@ -507,29 +507,21 @@ implementation return (1000 * CC1K_LPL_CHECK_TIME) / sleepInterval; } - command void LowPowerListening.setLocalSleepInterval(uint16_t s) { + command void LowPowerListening.setLocalWakeupInterval(uint16_t s) { sleepTime = validateSleepInterval(s); } - command uint16_t LowPowerListening.getLocalSleepInterval() { + command uint16_t LowPowerListening.getLocalWakeupInterval() { return sleepTime; } - command void LowPowerListening.setLocalDutyCycle(uint16_t d) { - call LowPowerListening.setLocalSleepInterval(dutyToSleep(d)); - } - - command uint16_t LowPowerListening.getLocalDutyCycle() { - return sleepToDuty(call LowPowerListening.getLocalSleepInterval()); - } - - command void LowPowerListening.setRxSleepInterval(message_t *msg, uint16_t sleepIntervalMs) { + command void LowPowerListening.setRemoteWakeupInterval(message_t *msg, uint16_t sleepIntervalMs) { cc1000_metadata_t *meta = getMetadata(msg); meta->strength_or_preamble = -(int16_t)validateSleepInterval(sleepIntervalMs) - 1; } - command uint16_t LowPowerListening.getRxSleepInterval(message_t *msg) { + command uint16_t LowPowerListening.getRemoteWakeupInterval(message_t *msg) { cc1000_metadata_t *meta = getMetadata(msg); if (meta->strength_or_preamble >= 0) @@ -538,22 +530,6 @@ implementation return -(meta->strength_or_preamble + 1); } - command void LowPowerListening.setRxDutyCycle(message_t *msg, uint16_t d) { - return call LowPowerListening.setRxSleepInterval(msg, dutyToSleep(d)); - } - - command uint16_t LowPowerListening.getRxDutyCycle(message_t *msg) { - return sleepToDuty(call LowPowerListening.getRxSleepInterval(msg)); - } - - command uint16_t LowPowerListening.dutyCycleToSleepInterval(uint16_t d) { - return dutyToSleep(d); - } - - command uint16_t LowPowerListening.sleepIntervalToDutyCycle(uint16_t s) { - return sleepToDuty(s); - } - void setPreambleLength(message_t * ONE msg) { cc1000_metadata_t *meta = getMetadata(msg); uint16_t s; -- 2.39.2