[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 DispatchSlottedCsmaP.nc, 1.6, 1.7 DispatchUnslottedCsmaP.nc, 1.8, 1.9 RadioClientC.nc, 1.4, 1.5 TKN154BeaconEnabledP.nc, 1.6, 1.7 TKN154_MAC.h, 1.7, 1.8 TKN154NonBeaconEnabledP.nc, 1.6, 1.7

Jan-Hinrich Hauer janhauer at users.sourceforge.net
Thu May 14 06:20:37 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7961/tos/lib/mac/tkn154

Modified Files:
	DispatchSlottedCsmaP.nc DispatchUnslottedCsmaP.nc 
	RadioClientC.nc TKN154BeaconEnabledP.nc TKN154_MAC.h 
	TKN154NonBeaconEnabledP.nc 
Log Message:
bugfix: radio token was not properly transferred when MLME_SCAN/_RX_ENABLE was called after the MAC had been switched to Rx/Tx before.

Index: DispatchSlottedCsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/DispatchSlottedCsmaP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DispatchSlottedCsmaP.nc	5 May 2009 16:56:12 -0000	1.6
--- DispatchSlottedCsmaP.nc	14 May 2009 13:20:35 -0000	1.7
***************
*** 74,77 ****
--- 74,78 ----
      interface Alarm<TSymbolIEEE802154,uint32_t> as RxWaitAlarm;
      interface TransferableResource as RadioToken;
+     interface ResourceRequested as RadioTokenRequested;
      interface SuperframeStructure; 
      interface GetNow<token_requested_t> as IsRadioTokenRequested;
***************
*** 742,744 ****
--- 743,747 ----
    command error_t WasRxEnabled.enable() {return FAIL;}
    command error_t WasRxEnabled.disable() {return FAIL;}
+   async event void RadioTokenRequested.requested(){ updateState(); }
+   async event void RadioTokenRequested.immediateRequested(){ updateState(); }
  }

Index: DispatchUnslottedCsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/DispatchUnslottedCsmaP.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DispatchUnslottedCsmaP.nc	5 May 2009 16:56:12 -0000	1.8
--- DispatchUnslottedCsmaP.nc	14 May 2009 13:20:35 -0000	1.9
***************
*** 62,65 ****
--- 62,66 ----
      interface Timer<TSymbolIEEE802154> as IndirectTxWaitTimer;
      interface TransferableResource as RadioToken;
+     interface ResourceRequested as RadioTokenRequested;
      interface GetNow<token_requested_t> as IsRadioTokenRequested;
      interface GetNow<bool> as IsRxEnableActive; 
***************
*** 262,267 ****
          if (call RadioOff.isOff()) {
            // nothing more to do... just release the Token
-           m_lock = FALSE; // unlock
            dbg_serial("DispatchUnslottedCsmaP", "Token requested: releasing it.\n");
            call RadioToken.release();
            return;
--- 263,269 ----
          if (call RadioOff.isOff()) {
            // nothing more to do... just release the Token
            dbg_serial("DispatchUnslottedCsmaP", "Token requested: releasing it.\n");
+           call RadioToken.request(); // we want it back afterwards ...
+           m_lock = FALSE; // unlock
            call RadioToken.release();
            return;
***************
*** 519,521 ****
--- 521,525 ----
    default event void MLME_START.confirm(ieee154_status_t status) {}
    async event void RadioToken.transferredFrom(uint8_t fromClientID) {ASSERT(0);}
+   async event void RadioTokenRequested.requested(){ updateState(); }
+   async event void RadioTokenRequested.immediateRequested(){ updateState(); }
  }

Index: RadioClientC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/RadioClientC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RadioClientC.nc	24 Mar 2009 12:56:46 -0000	1.4
--- RadioClientC.nc	14 May 2009 13:20:35 -0000	1.5
***************
*** 45,48 ****
--- 45,49 ----
      interface UnslottedCsmaCa;
      interface TransferableResource as RadioToken;
+     interface ResourceRequested as RadioTokenRequested;
    }
  }
***************
*** 56,59 ****
--- 57,61 ----
    UnslottedCsmaCa = RadioControlP.UnslottedCsmaCa[clientID];
    RadioToken = RadioControlP.TransferableResource[clientID];
+   RadioTokenRequested = RadioControlP.ResourceRequested[clientID];
  }
  

Index: TKN154BeaconEnabledP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154BeaconEnabledP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TKN154BeaconEnabledP.nc	5 May 2009 16:56:12 -0000	1.6
--- TKN154BeaconEnabledP.nc	14 May 2009 13:20:35 -0000	1.7
***************
*** 404,407 ****
--- 404,408 ----
    DeviceCap.RxWaitAlarm = Alarm5;
    DeviceCap.RadioToken -> DeviceCapRadioClient;
+   DeviceCap.RadioTokenRequested -> DeviceCapRadioClient;
    DeviceCap.SuperframeStructure -> BeaconSynchronizeP.IncomingSF;
    DeviceCap.IsRxEnableActive -> RxEnableP.IsRxEnableActive;
***************
*** 431,434 ****
--- 432,436 ----
    CoordCap.BLEAlarm = Alarm7;
    CoordCap.RadioToken -> CoordCapRadioClient;
+   CoordCap.RadioTokenRequested -> CoordCapRadioClient;
    CoordCap.SuperframeStructure -> BeaconTransmitP.OutgoingSF;
    CoordCap.IsRxEnableActive -> RxEnableP.IsRxEnableActive;

Index: TKN154_MAC.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154_MAC.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TKN154_MAC.h	26 Mar 2009 15:29:23 -0000	1.7
--- TKN154_MAC.h	14 May 2009 13:20:35 -0000	1.8
***************
*** 284,288 ****
  token_requested_t rcombine(token_requested_t r1, token_requested_t r2)
  {
!   return r1 && r2;
  }
  
--- 284,288 ----
  token_requested_t rcombine(token_requested_t r1, token_requested_t r2)
  {
!   return r1 || r2;
  }
  

Index: TKN154NonBeaconEnabledP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154NonBeaconEnabledP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TKN154NonBeaconEnabledP.nc	4 May 2009 09:40:36 -0000	1.6
--- TKN154NonBeaconEnabledP.nc	14 May 2009 13:20:35 -0000	1.7
***************
*** 289,292 ****
--- 289,293 ----
    DispatchP.SetMacPanCoordinator -> PibP.SetMacPanCoordinator;
    DispatchP.IsRxEnableActive -> RxEnableP.IsRxEnableActive;
+   DispatchP.RadioTokenRequested -> DispatchRadioClient;
    DispatchP.IsRadioTokenRequested -> PibP.IsRadioTokenRequested; // fan out...
    DispatchP.IsRadioTokenRequested -> PromiscuousModeP.IsRadioTokenRequested;



More information about the Tinyos-2-commits mailing list