]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/BeaconTransmitP.nc
+ fixed an issue with 62500Hz Alarms when overlapping
[tinyos-2.x.git] / tos / lib / mac / tkn154 / BeaconTransmitP.nc
index d3034e142049992aff6e103c2e0b72e5c0e2292b..3d0dd438868e2ffc290d7b6aa36890e5ed3b52f5 100644 (file)
@@ -77,7 +77,7 @@ module BeaconTransmitP
     interface WriteBeaconField as GtsInfoWrite;
     interface WriteBeaconField as PendingAddrWrite;
     interface FrameUtility;
-    interface Get<bool> as IsTrackingBeacons;
+    interface GetNow<bool> as IsTrackingBeacons;
     interface GetNow<uint32_t> as LastBeaconRxTime;
     interface GetNow<ieee154_reftime_t*> as LastBeaconRxRefTime; 
     interface Ieee802154Debug as Debug;
@@ -222,7 +222,7 @@ implementation
         !(IEEE154_SUPPORTED_CHANNELS & ((uint32_t) 1 << logicalChannel)) ||
         (superframeOrder > beaconOrder))
       status =  IEEE154_INVALID_PARAMETER;
-    else if (startTime && !call IsTrackingBeacons.get())
+    else if (startTime && !call IsTrackingBeacons.getNow())
       status = IEEE154_TRACKING_OFF;
     else if (startTime && 0xFF000000)
       status = IEEE154_INVALID_PARAMETER;
@@ -391,6 +391,7 @@ implementation
 
   event void Token.granted()
   {
+    call Debug.flush();
     call Debug.log(LEVEL_INFO, StartP_GOT_RESOURCE, m_lastBeaconTxTime, m_beaconInterval, m_requests);
     if (m_requests & REQUEST_REALIGNMENT_DONE_PENDING){
       // unlikely to occur: we have not yet received a done()
@@ -516,7 +517,7 @@ implementation
       m_framePendingBit = TRUE;
     else
       m_framePendingBit = FALSE;
-    memcpy(m_gtsField, &frame->payload[0], gtsFieldLength);
+    memcpy(m_gtsField, &frame->payload[2], gtsFieldLength);
     if (frame->payload[1] & 0x10){
       // BLE is active; calculate the time offset from slot0
       m_BLELen = IEEE154_SHR_DURATION +