X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2Fdummies%2FNoCoordCfpP.nc;h=b8ba907ffdb1d3a454290e6456b00087b8768bff;hb=7c8134e8789a99210cc147b3a3379dffeb0f3bae;hp=45497e6aac02a1c48cf8b96e788d9a280fa4888b;hpb=dd2eec28b5c692a5319c6e7feb14a67e716f2406;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc index 45497e6a..b8ba907f 100644 --- a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc +++ b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc @@ -52,9 +52,7 @@ module NoCoordCfpP interface FrameTx as CfpTx; interface Purge; } uses { - interface ResourceTransferred as TokenTransferred; - interface ResourceTransfer as TokenToBeaconTransmit; - interface ResourceRequested as TokenRequested; + interface TransferableResource as RadioToken; interface Alarm as CfpSlotAlarm; interface Alarm as CfpEndAlarm; interface SuperframeStructure as OutgoingSF; @@ -85,12 +83,15 @@ implementation return IEEE154_INVALID_HANDLE; } - async event void TokenTransferred.transferred() + async event void RadioToken.transferredFrom(uint8_t fromClient) { // the CFP has started, this component now owns the token - - // because GTS is not implemented we pass it back to the - // BeaconTransmitP component - call TokenToBeaconTransmit.transfer(); + // because GTS is not implemented we pass it on +#ifndef IEEE154_BEACON_SYNC_DISABLED + call RadioToken.transferTo(RADIO_CLIENT_BEACONSYNCHRONIZE); +#else + call RadioToken.transferTo(RADIO_CLIENT_BEACONTRANSMIT); +#endif } async event void CfpEndAlarm.fired() {} @@ -120,12 +121,8 @@ implementation 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() + event void RadioToken.granted() { - // 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(){ } + ASSERT(0); // should never happen, because we never call RadioToken.request() + } }