X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2Fdummies%2FNoCoordCfpP.nc;h=76974d2d9e2bf492a1072471b48ef8b7423d9a59;hb=dac274225f4101f5dd61d0df8c6647d7f7a4c05f;hp=e142bf62f94b6390fe39e820787fe741c927c052;hpb=f50b3e1320b358f1686b7fd440dc125e3c24c327;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc index e142bf62..76974d2d 100644 --- a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc +++ b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc @@ -52,10 +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 ResourceRequested as TokenRequested; + interface GetNow as IsTokenRequested; interface GetNow as IsTrackingBeacons; interface GetNow as CfpEnd; interface GetNow as CapStartRefTime; @@ -94,13 +94,11 @@ 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 - // (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 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() {} @@ -134,10 +132,10 @@ implementation 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(){ } }