interface FrameTx as CfpTx;
interface Purge;
} uses {
- interface Resource as Token;
- interface ResourceTransferred as TokenTransferred;
- interface ResourceRequested as TokenRequested;
- interface ResourceTransfer as TokenToBeaconSync;
- interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
- interface GetNow<bool> as IsSendingBeacons;
- interface GetNow<uint32_t> as CfpEnd;
- interface GetNow<uint8_t*> as GtsField;
- interface GetNow<uint32_t> as SfSlotDuration;
- interface GetNow<uint8_t> as FinalCapSlot;
+ interface TransferableResource as RadioToken;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
+ interface SuperframeStructure as IncomingSF;
interface RadioTx;
interface RadioRx;
interface RadioOff;
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 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 on
+#ifndef IEEE154_BEACON_TX_DISABLED
+ call RadioToken.transferTo(RADIO_CLIENT_BEACONTRANSMIT);
+#else
+ call RadioToken.transferTo(RADIO_CLIENT_BEACONSYNCHRONIZE);
+#endif
}
async event void CfpEndAlarm.fired() {}
async event void RadioOff.offDone() {}
- 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.enableRxDone(){}
+ event message_t* RadioRx.received(message_t *frame, const ieee154_timestamp_t *timestamp){return frame;}
- async event void RadioRx.prepareDone(){}
- event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
-
- async event void TokenRequested.requested()
+ event void RadioToken.granted()
{
- // someone requested access to the radio, you might
- // consider releasing it...
- }
-
- async event void TokenRequested.immediateRequested(){ }
- event void Token.granted(){ }
+ ASSERT(0); // should never happen, because we never call RadioToken.request()
+ }
}