X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2Fdummies%2FNoCoordCfpP.nc;h=b8ba907ffdb1d3a454290e6456b00087b8768bff;hp=f805fa1aa1298c71e25ff35eaaaf6da0ea4ab9a9;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hpb=adf1de6c009d13b7b52e68535c63b28f59c97400 diff --git a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc index f805fa1a..b8ba907f 100644 --- a/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc +++ b/tos/lib/mac/tkn154/dummies/NoCoordCfpP.nc @@ -32,7 +32,7 @@ * @author Jan Hauer * ======================================================================== */ - + /** * The contention free period (CFP) in beacon mode, a.k.a. GTS, is not yet * implemented - this is only an empty placeholder. In contrast to the CAP @@ -52,16 +52,10 @@ module NoCoordCfpP interface FrameTx as CfpTx; interface Purge; } uses { - interface Resource as Token; - interface ResourceTransferred as TokenTransferred; - interface ResourceRequested as TokenRequested; - interface GetNow as CfpEnd; - interface GetNow as CapStartRefTime; - interface GetNow as GtsField; - interface GetNow as SfSlotDuration; - interface GetNow as FinalCapSlot; + interface TransferableResource as RadioToken; interface Alarm as CfpSlotAlarm; interface Alarm as CfpEndAlarm; + interface SuperframeStructure as OutgoingSF; interface RadioTx; interface RadioRx; interface RadioOff; @@ -89,23 +83,22 @@ implementation return IEEE154_INVALID_HANDLE; } - 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 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 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() { } + 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) { @@ -123,19 +116,13 @@ implementation return 1; } - 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, const ieee154_timestamp_t *timestamp, error_t result){} - async event void RadioRx.prepareDone(){} - event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;} + 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, - // you might want to release the token... - } - - async event void TokenRequested.immediateRequested(){ } - event void Token.granted(){ } + ASSERT(0); // should never happen, because we never call RadioToken.request() + } }