]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc
+ modified radio driver (PHY) interfaces: CSMA-CA algorithm is now pushed to radio...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / dummies / NoCoordCfpP.nc
index 145df15fb1797c06aa4c02a76a2eec6a41ad8a6d..5ea629328d749c123c722e43d0aa99b5c8de30bb 100644 (file)
@@ -52,9 +52,11 @@ module NoCoordCfpP
     interface FrameTx as CfpTx;
     interface Purge;
   } uses {
-    interface Resource as Token;
     interface ResourceTransferred as TokenTransferred;
+    interface ResourceTransfer as TokenToBeaconTransmit;
     interface ResourceRequested as TokenRequested;
+    interface GetNow<bool> as IsTokenRequested;
+    interface GetNow<bool> as IsTrackingBeacons; 
     interface GetNow<uint32_t> as CfpEnd; 
     interface GetNow<ieee154_reftime_t*> as CapStartRefTime; 
     interface GetNow<uint8_t*> as GtsField; 
@@ -92,20 +94,18 @@ implementation
   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
+    // Note: this component must not use the Resource
+    // interface to release the token!
+    call TokenToBeaconTransmit.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 RadioOff.offDone() {}
     
   command uint8_t GtsInfoWrite.write(uint8_t *gtsSpecField, uint8_t maxlen)
   {
@@ -124,18 +124,21 @@ implementation
   }  
 
   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, ieee154_reftime_t *txTime){}
 
   async event void RadioRx.prepareDone(){} 
   event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
 
   async event void TokenRequested.requested()
   {
-    // someone (e.g. SCAN component) requested access to the radio,
-    // you might want to release the token...
+    // 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(){ }
-  event void Token.granted(){ }
+  async event void RadioTx.transmitUnslottedCsmaCaDone(ieee154_txframe_t *frame,
+      bool ackPendingFlag, ieee154_csma_t *csmaParams, error_t result){}
+  async event void RadioTx.transmitSlottedCsmaCaDone(ieee154_txframe_t *frame, ieee154_reftime_t *txTime, 
+      bool ackPendingFlag, uint16_t remainingBackoff, ieee154_csma_t *csmaParams, error_t result){} 
 }