* not part of the MAC implementation but of the chip-specific radio driver.
*/
-#if IEEE154_BEACON_ENABLED_PAN
-#error "The IEEE154_BEACON_ENABLED_PAN macro MUST NOT be set when using this component!"
-#endif
-
module DispatchUnslottedCsmaP
{
provides
call MLME_SET.macPANId(panID);
call MLME_SET.phyCurrentChannel(logicalChannel);
call MLME_SET.macBeaconOrder(beaconOrder);
- call SetMacSuperframeOrder.set(superframeOrder);
call SetMacPanCoordinator.set(panCoordinator);
//TODO: check realignment
post signalStartConfirmTask();
status = IEEE154_SUCCESS;
}
+ dbg_serial("DispatchUnslottedCsmaP", "MLME_START.request -> result: %lu\n", (uint32_t) status);
return status;
}
return IEEE154_TRANSACTION_OVERFLOW;
} else {
setCurrentFrame(frame);
- call RadioToken.request();
+ if (call RadioToken.isOwner())
+ updateState();
+ else
+ call RadioToken.request();
return IEEE154_SUCCESS;
}
}
uint8_t *mhr = MHR(frame);
uint8_t frameType = mhr[MHR_INDEX_FC1] & FC1_FRAMETYPE_MASK;
- dbg("DispatchUnslottedCsmaP", "Received frame, DSN: %lu, result: 0x%lx\n", (uint32_t) mhr[MHR_INDEX_SEQNO]);
if (frameType == FC1_FRAMETYPE_CMD)
frameType += payload[0];
+ dbg("DispatchUnslottedCsmaP", "Received frame, DSN: %lu, type: 0x%lu\n",
+ (uint32_t) mhr[MHR_INDEX_SEQNO], (uint32_t) frameType);
atomic {
if (m_indirectTxPending) {
message_t* frameBuf;