X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2Fdummies%2FNoDeviceCfpP.nc;h=0cda4b605558976d5cba939732fe8857f33fd976;hb=dac274225f4101f5dd61d0df8c6647d7f7a4c05f;hp=0d672ce6bc0ac8c5b63f6e847811c70073e41297;hpb=f50b3e1320b358f1686b7fd440dc125e3c24c327;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/dummies/NoDeviceCfpP.nc b/tos/lib/mac/tkn154/dummies/NoDeviceCfpP.nc index 0d672ce6..0cda4b60 100644 --- a/tos/lib/mac/tkn154/dummies/NoDeviceCfpP.nc +++ b/tos/lib/mac/tkn154/dummies/NoDeviceCfpP.nc @@ -51,7 +51,6 @@ module NoDeviceCfpP interface FrameTx as CfpTx; interface Purge; } uses { - interface Resource as Token; interface ResourceTransferred as TokenTransferred; interface ResourceRequested as TokenRequested; interface ResourceTransfer as TokenToBeaconSync; @@ -92,14 +91,12 @@ 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 BeaconSynchronizeP if - // we are not transmitting beacons) - if (call IsSendingBeacons.getNow()) - call Token.release(); - else - call TokenToBeaconSync.transfer(); + // the CFP has started, this component now owns the token - + // 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 TokenToBeaconSync.transfer(); } async event void CfpEndAlarm.fired() {} @@ -117,10 +114,10 @@ implementation 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(){ } }