]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/tda5250/mac/RedMacP.nc
keep sfd time
[tinyos-2.x.git] / tos / chips / tda5250 / mac / RedMacP.nc
index c34bcdae217faabb68141578f86cea69dda4b981..d734b492e17f9b7be6b634c810aa7005dcd91193 100644 (file)
@@ -163,8 +163,8 @@ implementation
         ACK_DURATION = SUB_HEADER_TIME + SUB_FOOTER_TIME,
         NAV_FACTOR = 4,
 #ifndef MAC_EVAL
-        MAX_SHORT_RETRY=3,
-        MAX_LONG_RETRY=7,
+        MAX_SHORT_RETRY=9,
+        MAX_LONG_RETRY=3,
         ADD_NAV = 2,
         INCREASE_BACKOFF = TRUE,
 #endif
@@ -875,6 +875,7 @@ implementation
 #ifdef DELTATIMEDEBUG
                             dTrace.sender = getHeader(msg)->src;
 #endif
+                            getMetadata(msg)->sfdtime = rxTime;
                             getMetadata(msg)->time = calcGeneratedTime((red_mac_header_t*) payload);
                             getMetadata(msg)->ack = WAS_NOT_ACKED;
                             m = signal MacReceive.receiveDone(msg);
@@ -1066,9 +1067,12 @@ implementation
             dTrace.delta = call TimeDiff32.computeDelta(dTrace.now, dTrace.msgTime);
             txMacHdr->time = dTrace.delta;
             call DeltaTrace.traceTx(&dTrace);
+            getMetadata(p_msg)->sfdtime = dTrace.now;
 #else
+            getMetadata(p_msg)->sfdtime = call LocalTime32kHz.get();
             txMacHdr->time =
-                call TimeDiff32.computeDelta(call LocalTime32kHz.get(), getMetadata(p_msg)->time);
+                call TimeDiff32.computeDelta(getMetadata(p_msg)->sfdtime,
+                                             getMetadata(p_msg)->time);
 #endif
         }
     }