From b21866e53a312a43d1a079c36e600e3cdc54357f Mon Sep 17 00:00:00 2001 From: kusy Date: Thu, 16 Jul 2009 06:49:47 +0000 Subject: [PATCH] LPL patch by thomas schmidt --- tos/lib/ftsp/TimeSyncC.nc | 5 +++++ tos/lib/ftsp/TimeSyncP.nc | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tos/lib/ftsp/TimeSyncC.nc b/tos/lib/ftsp/TimeSyncC.nc index 58af71d2..8022d8a9 100644 --- a/tos/lib/ftsp/TimeSyncC.nc +++ b/tos/lib/ftsp/TimeSyncC.nc @@ -69,4 +69,9 @@ implementation #endif TimeSyncP.Leds -> LedsC; +#ifdef LOW_POWER_LISTENING + components CC2420ActiveMessageC; + TimeSyncP.LowPowerListening -> CC2420ActiveMessageC; +#endif + } diff --git a/tos/lib/ftsp/TimeSyncP.nc b/tos/lib/ftsp/TimeSyncP.nc index 86035dc2..3c3affe8 100644 --- a/tos/lib/ftsp/TimeSyncP.nc +++ b/tos/lib/ftsp/TimeSyncP.nc @@ -46,6 +46,12 @@ generic module TimeSyncP(typedef precision_tag) interface Leds; interface TimeSyncPacket; interface LocalTime as LocalTime; + + +#ifdef LOW_POWER_LISTENING + interface LowPowerListening; +#endif + } } implementation @@ -61,7 +67,7 @@ implementation IGNORE_ROOT_MSG = 4, // after becoming the root ignore other roots messages (in send period) ENTRY_VALID_LIMIT = 4, // number of entries to become synchronized ENTRY_SEND_LIMIT = 3, // number of entries to send sync messages - ENTRY_THROWOUT_LIMIT = 100, // if time sync error is bigger than this clear the table + ENTRY_THROWOUT_LIMIT = 500, // if time sync error is bigger than this clear the table }; typedef struct TableItem @@ -353,6 +359,9 @@ implementation outgoingMsg->globalTime = globalTime; +#ifdef LOW_POWER_LISTENING + call LowPowerListening.setRxSleepInterval(&outgoingMsgBuffer, LPL_INTERVAL); +#endif // we don't send time sync msg, if we don't have enough data if( numEntries < ENTRY_SEND_LIMIT && outgoingMsg->rootID != TOS_NODE_ID ){ ++heartBeats; -- 2.39.2