]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/dummies/NoDeviceCfpP.nc
- re-designed the radio driver interfaces, restructured/improved the CC2420 radio...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / dummies / NoDeviceCfpP.nc
index 4cbc46899c272456afc97e91abd322c6f15983d6..9f6f87e63377c486075a2439cf085fbb6765f651 100644 (file)
@@ -51,16 +51,12 @@ module NoDeviceCfpP
     interface FrameTx as CfpTx;
     interface Purge;
   } uses {
-    interface Resource as Token;
     interface ResourceTransferred as TokenTransferred;
     interface ResourceRequested as TokenRequested;
-    interface GetNow<ieee154_reftime_t*> as CapStartRefTime; 
-    interface GetNow<uint32_t> as CfpEnd; 
-    interface GetNow<uint8_t*> as GtsField; 
-    interface GetNow<uint32_t> as SfSlotDuration; 
-    interface GetNow<uint8_t> as FinalCapSlot; 
+    interface ResourceTransfer as TokenToBeaconSync;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
     interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
+    interface SuperframeStructure as IncomingSF; 
     interface RadioTx;
     interface RadioRx;
     interface RadioOff;
@@ -88,37 +84,30 @@ implementation
     return IEEE154_INVALID_HANDLE; 
   } 
 
-  event void TokenTransferred.transferred()
+  async event void TokenTransferred.transferred()
   { 
     // the CFP has started, this component now owns the token -  
-    // because GTS is not implemented we release the token
-    // immediately; the general rule is: as long as a component
-    // owns the token it has exclusive access to the radio
-    call Token.release();
+    // because GTS is not implemented we pass it back to the
+    // BeaconTransmitP component
+    call TokenToBeaconSync.transfer();
   }
 
-  async event void CfpEndAlarm.fired() { }
+  async event void CfpEndAlarm.fired() {}
 
   async event void CfpSlotAlarm.fired() {}
 
-  async event void RadioOff.offDone()
-  {
-    call Token.release();
-  }
-
-  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 RadioOff.offDone() {}
 
-  async event void RadioRx.prepareDone(){} 
-  event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
+  async event void RadioTx.transmitDone(ieee154_txframe_t *frame, const ieee154_timestamp_t *timestamp, error_t result){}
+  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()
   {
-    // someone requested access to the radio, you might
-    // consider releasing it...
+    // someone (e.g. SCAN component) requested access to the radio, we 
+    // should pass the token back to BeaconSynchronizeP, which can release it
+    // call TokenToBeaconSync.transfer();
   }
 
   async event void TokenRequested.immediateRequested(){ }
-  event void Token.granted(){ }
 }