]> 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 45497e6aac02a1c48cf8b96e788d9a280fa4888b..b8ba907ffdb1d3a454290e6456b00087b8768bff 100644 (file)
@@ -52,9 +52,7 @@ module NoCoordCfpP
     interface FrameTx as CfpTx;
     interface Purge;
   } uses {
-    interface ResourceTransferred as TokenTransferred;
-    interface ResourceTransfer as TokenToBeaconTransmit;
-    interface ResourceRequested as TokenRequested;
+    interface TransferableResource as RadioToken;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
     interface SuperframeStructure as OutgoingSF; 
@@ -85,12 +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 pass it back to the
-    // BeaconTransmitP component
-    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() {}
@@ -120,12 +121,8 @@ implementation
   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, we 
-    // should pass the token back to BeaconTransmitP, which can release it
-    // call TokenToBeaconTransmit.transfer();
-  }
-
-  async event void TokenRequested.immediateRequested(){ }
+    ASSERT(0); // should never happen, because we never call RadioToken.request()
+  }  
 }