]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Needed to initialize engine. Fixed bug in packet length calculation that
authorscipio <scipio>
Thu, 15 Feb 2007 18:53:26 +0000 (18:53 +0000)
committerscipio <scipio>
Thu, 15 Feb 2007 18:53:26 +0000 (18:53 +0000)
was preventing transmissions.

tos/lib/net/lqi/LQIMultiHopRouter.nc
tos/lib/net/lqi/MultiHop.h
tos/lib/net/lqi/MultiHopEngineM.nc
tos/lib/net/lqi/MultiHopLQI.nc

index c0e8fc0221639c93dc8906c6fd20b9c846a2414d..28467f7a7c51e98b85d4b51a865ad2d7207a2b84 100644 (file)
@@ -58,12 +58,13 @@ implementation {
     new AMSenderC(AM_DATAMSG) as DataSender,
     new AMReceiverC(AM_DATAMSG) as DataReceiver,
     new TimerMilliC(), 
-    NoLedsC as LedsC,
+    NoLedsC, LedsC,
     RandomC,
     ActiveMessageC,
     MainC;
 
   MainC.SoftwareInit -> MultiHopEngineM;
+  MainC.SoftwareInit -> MultiHopLQI;
   
   components CC2420ActiveMessageC as CC2420;
 
@@ -95,4 +96,5 @@ implementation {
   MultiHopLQI.CC2420Packet -> CC2420;
   MultiHopLQI.AMPacket -> ActiveMessageC;
   MultiHopLQI.Packet -> ActiveMessageC;
+  MultiHopLQI.Leds -> NoLedsC;
 }
index 1a2750adb8f0372d5765fa24c4836dac05d2ac2f..e1d2c765e6bd08f2f3e510a12acc28771e4c3747 100644 (file)
@@ -83,7 +83,6 @@ typedef nx_struct beacon_msg {
   nx_uint16_t parent;
   nx_uint16_t cost;
   nx_uint16_t hopcount;
-  nx_uint32_t timestamp;
 } beacon_msg_t;
 
 typedef struct DBGEstEntry {
index 220c3a1e6602032b5350621ef938a8b9da0ac0cc..cef450005400ee522b3a2a1341fe8ea0fbe572e3 100644 (file)
@@ -119,15 +119,18 @@ implementation {
    ***********************************************************************/
   command error_t Send.send(message_t* pMsg, uint8_t len) {
     len += sizeof(lqi_header_t);
-    if (len > call Packet.maxPayloadLength()) {
+    if (len > call SubPacket.maxPayloadLength()) {
+      call Leds.led0On();
       return ESIZE;
     }
     if (call RootControl.isRoot()) {
+      call Leds.led1On();
       return FAIL;
     }
     call RouteSelect.initializeFields(pMsg);
     
     if (call RouteSelect.selectRoute(pMsg, 0) != SUCCESS) {
+      call Leds.led2On();
       return FAIL;
     }
     call PacketAcknowledgements.requestAck(pMsg);
@@ -168,7 +171,8 @@ implementation {
   static message_t* mForward(message_t* msg) {
     message_t* newMsg = msg;
     int8_t buf = get_buff();
-
+    call Leds.led2Toggle();
+    
     if (call RootControl.isRoot()) {
       return signal Receive.receive(msg, call Packet.getPayload(msg, NULL), call Packet.payloadLength(msg));
     }
index 9259b3e49a7b2648293d914a9b4db3a7628577b5..f1c18dfb349e970866f5e5032b42cdccfc294e61 100644 (file)
@@ -55,6 +55,7 @@ module MultiHopLQI {
     interface AMPacket;
     interface LqiRouteStats;
     interface CC2420Packet;
+    interface Leds;
   }
 }
 
@@ -190,6 +191,7 @@ implementation {
   }
 
   command error_t RootControl.setRoot() {
+    call Leds.led2On();
     isRoot = TRUE;
     return SUCCESS;
   }