[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 IndirectTxP.nc, 1.5, 1.6 PibP.nc, 1.8, 1.9

Jan-Hinrich Hauer janhauer at users.sourceforge.net
Thu May 7 05:41:38 PDT 2009


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

Modified Files:
	IndirectTxP.nc PibP.nc 
Log Message:
PIB attribute macMaxFrameTotalWaitTime  was not calculated correctly and PIB attribute macPersistenceTime was not converted correctly. This is now fixed.

Index: IndirectTxP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/IndirectTxP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** IndirectTxP.nc	25 Mar 2009 16:47:49 -0000	1.5
--- IndirectTxP.nc	7 May 2009 12:41:36 -0000	1.6
***************
*** 90,100 ****
    }
  
!   uint32_t getPersistenceTime()
    {
!     uint32_t persistenceTime;
!     persistenceTime = call MLME_GET.macTransactionPersistenceTime();
!     persistenceTime *= IEEE154_aBaseSuperframeDuration;
!     persistenceTime *= ((uint16_t) 1) << call MLME_GET.macBeaconOrder();
!     return persistenceTime;
    }
  
--- 90,106 ----
    }
  
!   uint32_t getPersistenceTimeSymbols()
    {
!     // transform macTransactionPersistenceTime PIB attribute
!     // from "unit periods" to symbols (cf. page 166) 
!     uint32_t unitPeriod;
!     ieee154_macBeaconOrder_t BO = call MLME_GET.macBeaconOrder();
! 
!     if (BO <= 14) {
!       unitPeriod = IEEE154_aBaseSuperframeDuration;
!       unitPeriod *= ((uint16_t) 1) << BO;
!     } else
!       unitPeriod = IEEE154_aBaseSuperframeDuration;
!     return unitPeriod * call MLME_GET.macTransactionPersistenceTime();
    }
  
***************
*** 158,162 ****
        m_numExtPending++;
      if (!call IndirectTxTimeout.isRunning())
!       call IndirectTxTimeout.startOneShot(getPersistenceTime());
      dbg_serial("IndirectTxP", "Preparing a transmission.\n");
      signal PendingAddrSpecUpdated.notify(TRUE);
--- 164,168 ----
        m_numExtPending++;
      if (!call IndirectTxTimeout.isRunning())
!       call IndirectTxTimeout.startOneShot(getPersistenceTimeSymbols());
      dbg_serial("IndirectTxP", "Preparing a transmission.\n");
      signal PendingAddrSpecUpdated.notify(TRUE);
***************
*** 246,250 ****
      // a transaction has expired 
      uint32_t now = call IndirectTxTimeout.getNow(), dt=0;
!     uint32_t persistenceTime = getPersistenceTime();
      uint8_t i;
  
--- 252,256 ----
      // a transaction has expired 
      uint32_t now = call IndirectTxTimeout.getNow(), dt=0;
!     uint32_t persistenceTime = getPersistenceTimeSymbols();
      uint8_t i;
  

Index: PibP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/PibP.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PibP.nc	7 Apr 2009 15:40:12 -0000	1.8
--- PibP.nc	7 May 2009 12:41:36 -0000	1.9
***************
*** 151,160 ****
        k = 0;
        while (k != m) {
!         waitTime += ((uint16_t) 1 << (macMaxBE+k));
          k += 1;
        }
      }
      waitTime *= IEEE154_aUnitBackoffPeriod;
!     waitTime += IEEE154_SHR_DURATION;
      m_pib.macMaxFrameTotalWaitTime = waitTime;
    }
--- 151,160 ----
        k = 0;
        while (k != m) {
!         waitTime += ((uint16_t) 1 << (macMinBE+k));
          k += 1;
        }
      }
      waitTime *= IEEE154_aUnitBackoffPeriod;
!     waitTime += call MLME_GET.phyMaxFrameDuration();
      m_pib.macMaxFrameTotalWaitTime = waitTime;
    }



More information about the Tinyos-2-commits mailing list