return SUCCESS;
}
- event void TokenTransferred.transferred()
+ async event void TokenTransferred.transferred()
{
// we got the token, i.e. CAP has just started
uint32_t actualCapLen = call CapLen.getNow();
// and didn't find a beacon for aBaseSuperframeDuration*(2n+1) symbols
// -> transmit current frame using unslotted CSMA-CA
m_numCCA = 1;
- signal Token.granted();
- return;
- }
- else if (actualCapLen < IEEE154_RADIO_GUARD_TIME){
+ } else if (actualCapLen < IEEE154_RADIO_GUARD_TIME){
call Debug.log(LEVEL_IMPORTANT, CapP_TOO_SHORT, superframeDirection, actualCapLen, IEEE154_RADIO_GUARD_TIME);
call TokenToCfp.transfer();
return;
actualCapLen, call CapStart.getNow()+ actualCapLen);
}
updateState();
- call Debug.flush();
}
command ieee154_status_t FrameTx.transmit(ieee154_txframe_t *frame)
event void Token.granted()
{
- // the current frame should be transmitted using unslotted CSMA-CA
- updateState();
+ // will not happen
}
task void tokenRequestedTask()
async event void TokenRequested.requested()
{
+ // TODO: this event can be generated by the BeaconTransmitP or
+ // BeaconSynchronizeP component - in this case the Token should
+ // probably not be released!
atomic {
if (call Token.isOwner()){
if (!m_lock && !(DEVICE_ROLE && m_indirectTxPending) && !(COORD_ROLE && m_bcastFrame))