]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fixed an issue with indirect transmissions in nonbeacon-enabled mode: DispatchUnslott...
authorjanhauer <janhauer>
Wed, 25 Mar 2009 16:47:49 +0000 (16:47 +0000)
committerjanhauer <janhauer>
Wed, 25 Mar 2009 16:47:49 +0000 (16:47 +0000)
tos/lib/mac/tkn154/DebugC.nc
tos/lib/mac/tkn154/DebugP.nc
tos/lib/mac/tkn154/DispatchUnslottedCsmaP.nc
tos/lib/mac/tkn154/IndirectTxP.nc

index 91d3dde95abd89808fe12dd6dae4362e6917c3b5..6af96f46b4ef0ab7538151a9521eead432825af1 100644 (file)
 configuration DebugC {
 }
 implementation {
-  components DebugP, LedsC;
+  components DebugP, LedsC, MainC;
+  DebugP.Boot -> MainC;
   DebugP.Leds -> LedsC;
+
+#if defined(PLATFORM_TELOSB)
+  components UserButtonC;
+  DebugP.ButtonPressed -> UserButtonC;
+#endif
 }
 
index 8cad827c15de6f69a52cdc75385e01224743d803..954e516cff28b5b56c8d3c6eecefd2839800c630 100644 (file)
 #else
 #include <varargs.h>
 #endif
+#if defined(PLATFORM_TELOSB)
+#include <UserButton.h>
+#endif
 
 module DebugP {
-  uses interface Leds;
+  uses {
+    interface Boot;
+    interface Leds;
+#if defined(PLATFORM_TELOSB)
+    interface Notify<button_state_t> as ButtonPressed;
+#endif
+  }
 }
 implementation {
 
@@ -70,6 +79,19 @@ implementation {
   norace char m_assertFilename[MAX_LEN_FILENAME];
   norace char m_assertFunction[MAX_LEN_FUNNAME];
 
+  event void Boot.booted() {
+#if defined(PLATFORM_TELOSB)
+    call ButtonPressed.enable();
+#endif
+  }
+
+#if defined(PLATFORM_TELOSB)
+  event void ButtonPressed.notify( button_state_t val )
+  {
+    dbg_serial_flush();
+  }
+#endif
+
   task void assertFailTask()
   {
     if (m_assertCounter == 0) {
index 7c916dc2490cb6f0de03077b84bc5ffaf20df46e..f997b7986ec5c6411e8a2666e1f0cbd527570c95 100644 (file)
@@ -175,6 +175,7 @@ implementation
       post signalStartConfirmTask();
       status = IEEE154_SUCCESS;
     }      
+    dbg_serial("DispatchUnslottedCsmaP", "MLME_START.request -> result: %lu\n", (uint32_t) status);
     return status;
   }
 
@@ -191,7 +192,10 @@ implementation
       return IEEE154_TRANSACTION_OVERFLOW;
     } else {
       setCurrentFrame(frame);
-      call RadioToken.request();
+      if (call RadioToken.isOwner())
+        updateState();
+      else
+        call RadioToken.request();      
       return IEEE154_SUCCESS;
     }
   }
index e1eacd6f6b2c8ec8b3b38c3db8298c7d30d5e492..773bdf5b184ca8949736b24c7c2fd79e617ecd69 100644 (file)
@@ -276,6 +276,7 @@ implementation
   {
     uint8_t i;
     // TODO: if CSMA-CA algorithm failed, then frame shall still remain in transaction queue
+    dbg_serial("IndirectTxP", "transmitDone(), status: %lu\n", (uint32_t) status);
     for (i=0; i<NUM_MAX_PENDING; i++)
       if (m_txFrameTable[i] == txFrame) {
         m_txFrameTable[i] = NULL; // slot is now empty
@@ -292,7 +293,6 @@ implementation
       m_numExtPending--;    
     signal FrameTx.transmitDone[txFrame->client](txFrame, status);
     post tryCoordCapTxTask();
-    dbg_serial("IndirectTxP", "transmitDone()\n");
   }
 
   command ieee154_txframe_t* GetIndirectTxFrame.get() { return m_pendingTxFrame;}