]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/ftsp/TimeSyncP.nc
Fix the apps affected by the changes in the LowPowerListening interface.
[tinyos-2.x.git] / tos / lib / ftsp / TimeSyncP.nc
index 864c1c726de8cc148961d9f71f2020d35c15dde0..db59408b5054f625187cd4ea1515b55f48dc0abc 100644 (file)
@@ -46,6 +46,12 @@ generic module TimeSyncP(typedef precision_tag)
         interface Leds;
         interface TimeSyncPacket<precision_tag,uint32_t>;
         interface LocalTime<precision_tag> 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.setRemoteWakeupInterval(&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;
@@ -408,7 +417,7 @@ implementation
         if (mode == mode_)
             return SUCCESS;
 
-        if (mode_ == TS_USER_MODE){
+        if (mode_ == TS_TIMER_MODE){
             call Timer.startPeriodic((uint32_t)1000 * BEACON_RATE);
         }
         else