[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 BeaconRequestRxP.nc, 1.2, 1.3 BeaconTransmitP.nc, 1.9, 1.10 TKN154_MAC.h, 1.8, 1.9

Jan-Hinrich Hauer janhauer at users.sourceforge.net
Thu May 28 02:52:56 PDT 2009


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

Modified Files:
	BeaconRequestRxP.nc BeaconTransmitP.nc TKN154_MAC.h 
Log Message:
some cosmetic changes

Index: BeaconRequestRxP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/BeaconRequestRxP.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BeaconRequestRxP.nc	18 May 2009 17:16:25 -0000	1.2
--- BeaconRequestRxP.nc	28 May 2009 09:52:54 -0000	1.3
***************
*** 107,122 ****
  
      // Superframe-spec
!     m_payload[0] = 0xff; // beacon- and superframe order always 15 in non-beaconenabled mode
!     m_payload[1] = 0x00; 
      if (call MLME_GET.macPanCoordinator() == TRUE) 
!       m_payload[1] |= 0x40;
      if (call MLME_GET.macAssociationPermit() == TRUE) 
!       m_payload[1] |= 0x80;
      if (call MLME_GET.macBattLifeExt() == TRUE) 
!       m_payload[1] |= 0x10;
      // GTS-spec
!     m_payload[2] = 0;
!     // Pending-Address-spec
!     m_payload[3] = 0;
  
      signal IEEE154TxBeaconPayload.aboutToTransmit(); 
--- 107,122 ----
  
      // Superframe-spec
!     m_payload[BEACON_INDEX_SF_SPEC1] = 0xff; // beacon- and superframe order always 15 in nonbeacon-enabled mode
!     m_payload[BEACON_INDEX_SF_SPEC2] = 0x00; 
      if (call MLME_GET.macPanCoordinator() == TRUE) 
!       m_payload[BEACON_INDEX_SF_SPEC2] |= SF_SPEC2_PAN_COORD;
      if (call MLME_GET.macAssociationPermit() == TRUE) 
!       m_payload[BEACON_INDEX_SF_SPEC2] |= SF_SPEC2_ASSOCIATION_PERMIT;
      if (call MLME_GET.macBattLifeExt() == TRUE) 
!       m_payload[BEACON_INDEX_SF_SPEC2] |= SF_SPEC2_BATT_LIFE_EXT;
      // GTS-spec
!     m_payload[BEACON_INDEX_GTS_SPEC] = 0;
!     // Pending-Address-spec (behind empty single-byte GTS field)
!     m_payload[BEACON_INDEX_GTS_SPEC + 1] = 0;
  
      signal IEEE154TxBeaconPayload.aboutToTransmit(); 

Index: BeaconTransmitP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/BeaconTransmitP.nc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** BeaconTransmitP.nc	19 May 2009 16:53:15 -0000	1.9
--- BeaconTransmitP.nc	28 May 2009 09:52:54 -0000	1.10
***************
*** 527,541 ****
  
      // update superframe-related variables
!     m_numGtsSlots = (frame->payload[2] & 0x07);
      gtsFieldLength = 1 + ((m_numGtsSlots > 0) ? 1 + m_numGtsSlots * 3: 0);
!     m_numCapSlots = (frame->payload[1] & 0x0F) + 1;
!     m_sfSlotDuration = (((uint32_t) 1) << ((frame->payload[0] & 0xF0) >> 4)) * IEEE154_aBaseSlotDuration;
  
!     if (frame->header->mhr[0] & FC1_FRAME_PENDING)
        m_framePendingBit = TRUE;
      else
        m_framePendingBit = FALSE;
!     memcpy(m_gtsField, &frame->payload[2], gtsFieldLength);
!     if (frame->payload[1] & 0x10) {
        // BLE is active; calculate the time offset from slot 0
        m_battLifeExtDuration = IEEE154_SHR_DURATION + 
--- 527,545 ----
  
      // update superframe-related variables
!     m_numGtsSlots = 
!       (frame->payload[BEACON_INDEX_GTS_SPEC] & GTS_DESCRIPTOR_COUNT_MASK) >> GTS_DESCRIPTOR_COUNT_OFFSET;
      gtsFieldLength = 1 + ((m_numGtsSlots > 0) ? 1 + m_numGtsSlots * 3: 0);
!     m_numCapSlots = 
!       ((frame->payload[BEACON_INDEX_SF_SPEC2] & SF_SPEC2_FINAL_CAPSLOT_MASK) >> SF_SPEC2_FINAL_CAPSLOT_OFFSET) + 1;
!     m_sfSlotDuration = 
!       (((uint32_t) 1) << ((frame->payload[BEACON_INDEX_SF_SPEC1] & SF_SPEC1_SO_MASK) >> SF_SPEC1_SO_OFFSET)) * 
!       IEEE154_aBaseSlotDuration;
  
!     if (frame->header->mhr[MHR_INDEX_FC1] & FC1_FRAME_PENDING)
        m_framePendingBit = TRUE;
      else
        m_framePendingBit = FALSE;
!     memcpy(m_gtsField, &frame->payload[BEACON_INDEX_GTS_SPEC], gtsFieldLength);
!     if (frame->payload[BEACON_INDEX_SF_SPEC2] & SF_SPEC2_BATT_LIFE_EXT) {
        // BLE is active; calculate the time offset from slot 0
        m_battLifeExtDuration = IEEE154_SHR_DURATION + 
***************
*** 650,654 ****
    {
      uint8_t i, num=0;
!     for (i=0; i<(gtsInfoField[0] & GTS_DESCRIPTOR_COUNT_MASK); i++)
        num += ((gtsInfoField[4+i*3] & GTS_LENGTH_MASK) >> GTS_LENGTH_OFFSET);
      return num;
--- 654,658 ----
    {
      uint8_t i, num=0;
!     for (i=0; i<((gtsInfoField[0] & GTS_DESCRIPTOR_COUNT_MASK) >> GTS_DESCRIPTOR_COUNT_OFFSET); i++)
        num += ((gtsInfoField[4+i*3] & GTS_LENGTH_MASK) >> GTS_LENGTH_OFFSET);
      return num;
***************
*** 700,710 ****
        beaconSpecs -= 2; // sizeof SF Spec
        if (m_payloadState & MODIFIED_SF_SPEC) {
!         beaconSpecs[0] = m_beaconOrder | (m_superframeOrder << 4);
!         beaconSpecs[1] = 0;
          if (call MLME_GET.macAssociationPermit())
!           beaconSpecs[1] |= SF_SPEC2_ASSOCIATION_PERMIT;        
          if (call MLME_GET.macPanCoordinator())
!           beaconSpecs[1] |= SF_SPEC2_PAN_COORD;
!         beaconSpecs[1] |= ((15-numGtsSlots) & 0x0F); // update FinalCAPSlot field
        }
        m_beaconFrame.payloadLen = (m_pendingAddrLen + m_pendingGtsLen + 2) + m_beaconPayloadLen;
--- 704,716 ----
        beaconSpecs -= 2; // sizeof SF Spec
        if (m_payloadState & MODIFIED_SF_SPEC) {
!         beaconSpecs[BEACON_INDEX_SF_SPEC1] = 
!           (m_beaconOrder << SF_SPEC1_BO_OFFSET) | (m_superframeOrder << SF_SPEC1_SO_OFFSET);
!         beaconSpecs[BEACON_INDEX_SF_SPEC2] = 0;
          if (call MLME_GET.macAssociationPermit())
!           beaconSpecs[BEACON_INDEX_SF_SPEC2] |= SF_SPEC2_ASSOCIATION_PERMIT;        
          if (call MLME_GET.macPanCoordinator())
!           beaconSpecs[BEACON_INDEX_SF_SPEC2] |= SF_SPEC2_PAN_COORD;
!         beaconSpecs[BEACON_INDEX_SF_SPEC2] |= 
!           ((15-numGtsSlots) & SF_SPEC2_FINAL_CAPSLOT_MASK);
        }
        m_beaconFrame.payloadLen = (m_pendingAddrLen + m_pendingGtsLen + 2) + m_beaconPayloadLen;

Index: TKN154_MAC.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154_MAC.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TKN154_MAC.h	14 May 2009 13:20:35 -0000	1.8
--- TKN154_MAC.h	28 May 2009 09:52:54 -0000	1.9
***************
*** 241,248 ****
--- 241,257 ----
    BEACON_INDEX_GTS_SPEC = 2,
  
+   SF_SPEC1_BO_MASK = 0x0F,
+   SF_SPEC1_BO_OFFSET = 0,
+   SF_SPEC1_SO_MASK = 0xF0,
+   SF_SPEC1_SO_OFFSET = 4,
+ 
+   SF_SPEC2_FINAL_CAPSLOT_MASK = 0x0F,
+   SF_SPEC2_FINAL_CAPSLOT_OFFSET = 0,
+   SF_SPEC2_BATT_LIFE_EXT = 0x10,
    SF_SPEC2_PAN_COORD = 0x40,
    SF_SPEC2_ASSOCIATION_PERMIT = 0x80,
  
    GTS_DESCRIPTOR_COUNT_MASK = 0x07,
+   GTS_DESCRIPTOR_COUNT_OFFSET = 0,
    GTS_LENGTH_MASK = 0xF0,
    GTS_LENGTH_OFFSET = 4,



More information about the Tinyos-2-commits mailing list