]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/ctp/CtpRoutingEngineP.nc
The big interface switchover for Packet, Send, Receive, and AMSend.
[tinyos-2.x.git] / tos / lib / net / ctp / CtpRoutingEngineP.nc
index 5c6faeb01ef3a4e360d0f4563f847cbd7abb882a..7c8810302b35322bda842609ddf59ae6532f7414 100644 (file)
@@ -207,7 +207,7 @@ implementation {
         routeInfoInit(&routeInfo);
         routingTableInit();
         my_ll_addr = call AMPacket.address();
-        beaconMsg = call BeaconSend.getPayload(&beaconMsgBuffer);
+        beaconMsg = call BeaconSend.getPayload(&beaconMsgBuffer, call BeaconSend.maxPayloadLength());
         maxLength = call BeaconSend.maxPayloadLength();
         dbg("TreeRoutingCtl","TreeRouting initialized. (used payload:%d max payload:%d!\n", 
               sizeof(beaconMsg), maxLength);
@@ -454,7 +454,7 @@ implementation {
 
 
     ctp_routing_header_t* getHeader(message_t* m) {
-      return (ctp_routing_header_t*)call BeaconReceive.getPayload(m, NULL);
+      return (ctp_routing_header_t*)call BeaconSend.getPayload(m, call BeaconSend.maxPayloadLength());
     }
     
     
@@ -555,23 +555,23 @@ implementation {
 
     command void CtpInfo.triggerRouteUpdate() {
       // Random time in interval 64-127ms
-      uint16_t time = call Random.rand16();
-      time &= 0x3f; 
-      time += 64;
+      uint16_t beaconDelay = call Random.rand16();
+      beaconDelay &= 0x3f; 
+      beaconDelay += 64;
       if (call BeaconTimer.gett0() + call BeaconTimer.getdt() -
-                                     call BeaconTimer.getNow() >= time) {
+                                     call BeaconTimer.getNow() >= beaconDelay) {
          call BeaconTimer.stop();
-         call BeaconTimer.startOneShot(time);
+         call BeaconTimer.startOneShot(beaconDelay);
         }
      }
 
     command void CtpInfo.triggerImmediateRouteUpdate() {
       // Random time in interval 4-11ms
-      uint16_t time = call Random.rand16();
-      time &= 0x7; 
-      time += 4;
+      uint16_t beaconDelay = call Random.rand16();
+      beaconDelay &= 0x7; 
+      beaconDelay += 4;
       call BeaconTimer.stop();
-      call BeaconTimer.startOneShot(time);
+      call BeaconTimer.startOneShot(beaconDelay);
     }
 
     command void CtpInfo.setNeighborCongested(am_addr_t n, bool congested) {