]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/lqi/LqiRoutingEngineP.nc
Remove bogus 'tab:4' and 'tab:2' markers.
[tinyos-2.x.git] / tos / lib / net / lqi / LqiRoutingEngineP.nc
index fdea7b4a06e439fc49118b1ae0d1bac31ff8ad56..9962a8312f20ebd75141f57ef09617c60041634c 100644 (file)
@@ -1,4 +1,4 @@
-/*                                                                     tab:4
+/*
  * "Copyright (c) 2000-2003 The Regents of the University  of California.  
  * All rights reserved.
  *
@@ -108,11 +108,11 @@ implementation {
   }
 
   lqi_header_t* getHeader(message_t* msg) {
-    return (lqi_header_t*)call Packet.getPayload(msg, NULL);
+    return (lqi_header_t*)call Packet.getPayload(msg, sizeof(lqi_header_t));
   }
   
   lqi_beacon_msg_t* getBeacon(message_t* msg) {
-    return (lqi_beacon_msg_t*)call Packet.getPayload(msg, NULL);
+    return (lqi_beacon_msg_t*)call Packet.getPayload(msg, sizeof(lqi_beacon_msg_t));
   }
 
   task void SendRouteTask() {
@@ -277,7 +277,7 @@ implementation {
   }
 
   command error_t RouteSelect.initializeFields(message_t* msg) {
-    lqi_header_t* header = (lqi_header_t*)call Packet.getPayload(msg, NULL);
+    lqi_header_t* header = getHeader(msg);
 
     header->originaddr = TOS_NODE_ID;
     header->originseqno = gOriginSeqNo++;
@@ -330,7 +330,7 @@ implementation {
   event void Timer.fired() {
     call Leds.led0Toggle();
     post TimerTask();
-    call Timer.startPeriodic(1024 * gUpdateInterval + 1);
+    call Timer.startOneShot((uint32_t)1024 * gUpdateInterval + 1);
   }
 
   event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
@@ -397,6 +397,26 @@ implementation {
   event void AMSend.sendDone(message_t* msg, error_t success) {
     msgBufBusy = FALSE;
   }
+
+    /* Default implementations for CollectionDebug calls.
+     * These allow CollectionDebug not to be wired to anything if debugging
+     * is not desired. */
+
+  default command error_t CollectionDebug.logEvent(uint8_t type) {
+    return SUCCESS;
+  }
+  default command error_t CollectionDebug.logEventSimple(uint8_t type, uint16_t arg) {
+    return SUCCESS;
+  }
+  default command error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
+    return SUCCESS;
+  }
+  default command error_t CollectionDebug.logEventMsg(uint8_t type, uint16_t msg, am_addr_t origin, am_addr_t node) {
+    return SUCCESS;
+  }
+  default command error_t CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t etx) {
+    return SUCCESS;
+  }
   
 }