]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc
1) simplified the resource transfer: removed ResourceTransfer* interfaces and corresp...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / dummies / NoCoordCfpP.nc
index e142bf62f94b6390fe39e820787fe741c927c052..b8ba907ffdb1d3a454290e6456b00087b8768bff 100644 (file)
@@ -32,7 +32,7 @@
  * @author Jan Hauer <hauer@tkn.tu-berlin.de>
  * ========================================================================
  */
-
 /**
  * The contention free period (CFP) in beacon mode, a.k.a. GTS, is not yet
  * implemented - this is only an empty placeholder. In contrast to the CAP
@@ -52,18 +52,10 @@ module NoCoordCfpP
     interface FrameTx as CfpTx;
     interface Purge;
   } uses {
-    interface Resource as Token;
-    interface ResourceTransferred as TokenTransferred;
-    interface ResourceRequested as TokenRequested;
-    interface ResourceTransfer as TokenToBeaconTransmit;
-    interface GetNow<bool> as IsTrackingBeacons; 
-    interface GetNow<uint32_t> as CfpEnd; 
-    interface GetNow<ieee154_reftime_t*> as CapStartRefTime; 
-    interface GetNow<uint8_t*> as GtsField; 
-    interface GetNow<uint32_t> as SfSlotDuration; 
-    interface GetNow<uint8_t> as FinalCapSlot; 
+    interface TransferableResource as RadioToken;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
+    interface SuperframeStructure as OutgoingSF; 
     interface RadioTx;
     interface RadioRx;
     interface RadioOff;
@@ -91,16 +83,15 @@ implementation
     return IEEE154_INVALID_HANDLE; 
   } 
 
-  async event void TokenTransferred.transferred()
+  async event void RadioToken.transferredFrom(uint8_t fromClient)
   {
     // the CFP has started, this component now owns the token -  
-    // because GTS is not implemented we release the token
-    // (or pass it back to BeaconTransmitP if 
-    // we are not tracking beacons)
-    if (call IsTrackingBeacons.getNow())
-      call Token.release();  
-    else
-      call TokenToBeaconTransmit.transfer();
+    // because GTS is not implemented we pass it on
+#ifndef IEEE154_BEACON_SYNC_DISABLED
+    call RadioToken.transferTo(RADIO_CLIENT_BEACONSYNCHRONIZE);
+#else
+    call RadioToken.transferTo(RADIO_CLIENT_BEACONTRANSMIT);
+#endif
   }
 
   async event void CfpEndAlarm.fired() {}
@@ -125,19 +116,13 @@ implementation
     return 1;
   }  
 
-  async event void RadioTx.loadDone(){}
-  async event void RadioTx.transmitDone(ieee154_txframe_t *frame, 
-      ieee154_reftime_t *referenceTime, bool ackPendingFlag, error_t error){}
+  async event void RadioTx.transmitDone(ieee154_txframe_t *frame, const ieee154_timestamp_t *timestamp, error_t result){}
 
-  async event void RadioRx.prepareDone(){} 
-  event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
+  async event void RadioRx.enableRxDone(){} 
+  event message_t* RadioRx.received(message_t *frame, const ieee154_timestamp_t *timestamp){return frame;}
 
-  async event void TokenRequested.requested()
+  event void RadioToken.granted()
   {
-    // someone (e.g. SCAN component) requested access to the radio,
-    // you might want to release the token...
-  }
-
-  async event void TokenRequested.immediateRequested(){ }
-  event void Token.granted(){ }
+    ASSERT(0); // should never happen, because we never call RadioToken.request()
+  }  
 }