]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/lqi/MultiHopEngineM.nc
Needed to initialize engine. Fixed bug in packet length calculation that
[tinyos-2.x.git] / tos / lib / net / lqi / MultiHopEngineM.nc
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));
     }