]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/ctp/CtpForwardingEngineP.nc
Make timing the optimal values.
[tinyos-2.x.git] / tos / lib / net / ctp / CtpForwardingEngineP.nc
index 65fe70086fa116590c30055e86caf6bf2c76a346..df59dfbbf355ca2e34774c8ad83fe5808f40118e 100644 (file)
@@ -274,9 +274,9 @@ implementation {
     }
   }
 
-  static void startRetxmitTimer(uint16_t mask, uint16_t offset) {
+  static void startRetxmitTimer(uint16_t window, uint16_t offset) {
     uint16_t r = call Random.rand16();
-    r &= mask;
+    r %= window;
     r += offset;
     call RetxmitTimer.startOneShot(r);
     dbg("Forwarder", "Rexmit timer will fire in %hu ms\n", r);