X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2Fdummies%2FNoCoordCfpP.nc;h=e142bf62f94b6390fe39e820787fe741c927c052;hb=d0573ffd623b75029b406fb2f74fc1de5160e8ab;hp=f805fa1aa1298c71e25ff35eaaaf6da0ea4ab9a9;hpb=4e123af010077900246c741bb14231338d98f450;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc index f805fa1a..e142bf62 100644 --- a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc +++ b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc @@ -55,6 +55,8 @@ module NoCoordCfpP interface Resource as Token; interface ResourceTransferred as TokenTransferred; interface ResourceRequested as TokenRequested; + interface ResourceTransfer as TokenToBeaconTransmit; + interface GetNow as IsTrackingBeacons; interface GetNow as CfpEnd; interface GetNow as CapStartRefTime; interface GetNow as GtsField; @@ -89,23 +91,23 @@ 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(); + // (or pass it back to BeaconTransmitP if + // we are not tracking beacons) + if (call IsTrackingBeacons.getNow()) + call Token.release(); + else + 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) {