DSMEPlatform interface implementation for GNRC. More...
DSMEPlatform interface implementation for GNRC.
Definition at line 62 of file DSMEPlatform.h.
#include <DSMEPlatform.h>
Public Types | |
enum | { STATE_READY = 0 , STATE_CCA_WAIT = 1 , STATE_SEND = 2 } |
state of the Platform layer More... | |
Public Member Functions | |
DSMEPlatform () | |
DSMEPlatform constructor. | |
~DSMEPlatform () | |
DSMEPlatform destructor. | |
void | initialize (bool pan_coord) |
initialize MAC with a role (PAN coordinator, child) | |
void | sendFrame (uint16_t addr, iolist_t *pkt) |
to be called by the upper layer in order to send a frame | |
void | start () |
start DSME | |
DSMELayer & | getDSME () |
get the DSME layer | |
bool | isAssociated () |
check whether the node associated | |
void | allocateGTS (uint8_t superframeID, uint8_t slotID, uint8_t channelID, Direction direction, uint16_t address) |
allocate a GTS slot | |
void | getShortAddress (network_uint16_t *addr) |
get short address | |
void | setGTSTransmission (bool gts) |
set GTS or CAP transmission | |
void | setAckReq (bool ackReq) |
set ACK_REQ bit | |
void | offloadCCAEvent () |
request to offload the CCA Done event | |
void | offloadTXDoneEvent () |
request to offload the TX Done event | |
void | indicateRxStart () |
indicate the MAC layer that the reception started | |
void | offloadRXDoneEvent () |
request to offload RX Done event | |
void | offloadACKTimer () |
request to offload ACK Timer event | |
void | offloadTimerEvent () |
request to offload Timer event | |
void | setPlatformState (uint8_t state) |
set the platform state | |
void | processCCAEvent () |
process the CCA Done event | |
void | processTXDoneEvent () |
process the TX Done event | |
void | processRxDone () |
process the RX Done event from radio | |
void | processRxOffload () |
process the offload event of received frame | |
void | setGNRCNetif (gnrc_netif_t *netif) |
set the GNRC netif | |
uint8_t | getChannelNumber () override |
get channel number | |
bool | setChannelNumber (uint8_t k) override |
set channel number | |
bool | sendNow () override |
Directly send packet without delay and without CSMA but keep the message (the caller has to ensure that the message is eventually released) This might lead to an additional memory copy in the platform. | |
bool | prepareSendingCopy (IDSMEMessage *msg, Delegate< void(bool)> txEndCallback) override |
prepare the next transmission | |
bool | prepareSendingCopy (DSMEMessage *msg, Delegate< void(bool)> txEndCallback) |
prepare the next transmission | |
void | abortPreparedTransmission () override |
abort an already prepared transmission | |
bool | sendDelayedAck (IDSMEMessage *ackMsg, IDSMEMessage *receivedMsg, Delegate< void(bool)> txEndCallback) override |
send an ACK message, delay until aTurnaRoundTime after reception_time has expired | |
bool | sendDelayedAck (DSMEMessage *ackMsg, DSMEMessage *receivedMsg, Delegate< void(bool)> txEndCallback) |
send an ACK message, delay until aTurnaRoundTime after reception_time has expired | |
void | setReceiveDelegate (receive_delegate_t receiveDelegate) override |
set the receive callback | |
bool | isReceptionFromAckLayerPossible () override |
check whether the ACK layer is busy | |
void | handleReceivedMessageFromAckLayer (IDSMEMessage *message) override |
handle reception of frames from ACK Layer | |
void | handleReceivedMessageFromAckLayer (DSMEMessage *message) |
handle reception of frames from ACK Layer | |
DSMEMessage * | getEmptyMessage () override |
get an empty message | |
void | releaseMessage (IDSMEMessage *msg) override |
release a message | |
void | releaseMessage (DSMEMessage *msg) |
release a message | |
bool | startCCA () override |
start CCA procedure | |
void | startTimer (uint32_t symbolCounterValue) override |
start timer | |
uint32_t | getSymbolCounter () override |
get elapsed number of symbols since initialization | |
uint16_t | getRandom () override |
get a uint16_t random number | |
void | updateVisual () override |
update visual components of openDSME | |
void | scheduleStartOfCFP () override |
callback to offload the start of CFP | |
uint8_t | getMinCoordinatorLQI () override |
Get the minimum LQI. | |
void | turnTransceiverOn () override |
turn on transceiver | |
void | turnTransceiverOff () override |
turn off transceiver | |
IEEE802154MacAddress & | getAddress () |
get extended address | |
void | signalAckedTransmissionResult (bool success, uint8_t transmissionAttempts, IEEE802154MacAddress receiver) override |
signal finish of ACK'd transmission | |
void | signalGTSChange (bool deallocation, IEEE802154MacAddress counterpart, uint16_t superframeID, uint8_t gtSlotID, uint8_t channel, Direction direction) override |
signal a change in GTS status | |
void | signalQueueLength (uint32_t length) override |
signal a change in queue length | |
void | signalPacketsPerCAP (uint32_t packets) override |
signal the number of packets transmitted during the last CAP | |
void | signalFailedPacketsPerCAP (uint32_t packets) override |
signal the number of failed packets transmitted during the last CAP | |
bool | isRxEnabledOnCap () override |
callback to check where RX is on during CAP | |
Static Public Attributes | |
static DSMEPlatform * | instance |
pointer to the DSME instance | |
Protected Member Functions | |
DSMEPlatform (const DSMEPlatform &) | |
Copy constructor is not allowed. | |
DSMEPlatform & | operator= (const DSMEPlatform &) |
Assignment operator is not allowed. | |
void | signalNewMsg (DSMEMessage *msg) |
signal creation of new message | |
virtual void | signalReleasedMsg (DSMEMessage *msg) |
signal release of message | |
void | handleDataMessageFromMCPSWrapper (IDSMEMessage *msg) |
dSMEAdaptionLayer wrapper for MCPS Indication callbacks | |
void | handleDataMessageFromMCPS (DSMEMessage *msg) |
dSMEAdaptionLayer wrapper for MCPS Indication callbacks | |
void | handleConfirmFromMCPSWrapper (IDSMEMessage *msg, DataStatus::Data_Status dataStatus) |
dSMEAdaptionLayer wrapper for MCPS Confirm callbacks | |
void | handleConfirmFromMCPS (DSMEMessage *msg, DataStatus::Data_Status dataStatus) |
dSMEAdaptionLayer wrapper for MCPS Confirm callbacks | |
void | translateMacAddress (uint16_t &from, IEEE802154MacAddress &to) |
translate MAC Address representation | |
event_queue_t * | getEventQueue () |
get the event queue of the MAC | |
Protected Attributes | |
Delegate< void(bool)> | txEndCallback |
delegate callback for TX end | |
PHY_PIB | phy_pib |
holds the PHY Information Base | |
MAC_PIB | mac_pib |
holds the MAC Information Base | |
DSMELayer | dsme |
descriptor of the DSME MAC | |
mcps_sap::MCPS_SAP | mcps_sap |
descriptor of the MCPS Service Access Point | |
mlme_sap::MLME_SAP | mlme_sap |
descriptor of the MLME Service Access Point | |
DSMEAdaptionLayer | dsmeAdaptionLayer |
descriptor of the DSME Adaption Layer | |
bool | initialized |
whether the MAC is initialized | |
bool | scanOrSyncInProgress {false} |
whether there is a scan or sync in progress | |
bool | associationInProgress {false} |
whether the association is in progress | |
bool | syncActive {false} |
whether the MAC is synchronized | |
bool | rx_on_cap {true} |
whether the MAC keeps the receiver on during CAP | |
receive_delegate_t | receiveFromAckLayerDelegate |
delegate callback for passing frames to the ACK layer | |
gnrc_netif_t * | netif |
pointer to the GNRC interface | |
ztimer_t | timer |
timer used for the MAC | |
IDSMEMessage * | message |
used to hold an incoming message before passing it to the MAC | |
GTSScheduling * | scheduling = nullptr |
pointer to the scheduler | |
uint32_t | rx_sfd |
timestamp (in number of symbols) of the last received preamble | |
ztimer_t | acktimer |
timer used for ACK timeout events | |
uint8_t | state |
state of the platform layer | |
bool | wait_for_ack |
whether the MAC expects an ACK frame | |
bool | pending_tx |
whether there is a pending TX frame | |
ieee802154_dev_t * | radio |
pointer to the IEEE 802.15.4 HAL descriptor | |
anonymous enum |
state of the Platform layer
Definition at line 195 of file DSMEPlatform.h.
|
inline |
get extended address
Definition at line 334 of file DSMEPlatform.h.
|
inline |
get the DSME layer
Definition at line 96 of file DSMEPlatform.h.
|
inlineprotected |
get the event queue of the MAC
Definition at line 424 of file DSMEPlatform.h.
|
inlineoverride |
Get the minimum LQI.
Beacons with LQI lower than this will not be considered when deciding for a coordinator to associate to.
Definition at line 317 of file DSMEPlatform.h.
|
inlineoverride |
get a uint16_t random number
Definition at line 297 of file DSMEPlatform.h.
|
inline |
set the GNRC netif
Definition at line 188 of file DSMEPlatform.h.
|
inline |
set the platform state
Definition at line 161 of file DSMEPlatform.h.
|
inlineprotectedvirtual |
signal release of message
Definition at line 394 of file DSMEPlatform.h.
|
override |
update visual components of openDSME
|
protected |
timer used for ACK timeout events
Definition at line 516 of file DSMEPlatform.h.
|
protected |
whether the association is in progress
Definition at line 471 of file DSMEPlatform.h.
|
protected |
descriptor of the DSME MAC
Definition at line 441 of file DSMEPlatform.h.
|
protected |
descriptor of the DSME Adaption Layer
Definition at line 456 of file DSMEPlatform.h.
|
protected |
whether the MAC is initialized
Definition at line 461 of file DSMEPlatform.h.
|
static |
pointer to the DSME instance
Definition at line 76 of file DSMEPlatform.h.
|
protected |
holds the MAC Information Base
Definition at line 436 of file DSMEPlatform.h.
|
protected |
descriptor of the MCPS Service Access Point
Definition at line 446 of file DSMEPlatform.h.
|
protected |
used to hold an incoming message before passing it to the MAC
Definition at line 501 of file DSMEPlatform.h.
|
protected |
descriptor of the MLME Service Access Point
Definition at line 451 of file DSMEPlatform.h.
|
protected |
pointer to the GNRC interface
Definition at line 491 of file DSMEPlatform.h.
|
protected |
whether there is a pending TX frame
Definition at line 531 of file DSMEPlatform.h.
|
protected |
holds the PHY Information Base
Definition at line 431 of file DSMEPlatform.h.
|
protected |
pointer to the IEEE 802.15.4 HAL descriptor
Definition at line 536 of file DSMEPlatform.h.
|
protected |
delegate callback for passing frames to the ACK layer
Definition at line 486 of file DSMEPlatform.h.
|
protected |
whether the MAC keeps the receiver on during CAP
Definition at line 481 of file DSMEPlatform.h.
|
protected |
timestamp (in number of symbols) of the last received preamble
Definition at line 511 of file DSMEPlatform.h.
|
protected |
whether there is a scan or sync in progress
Definition at line 466 of file DSMEPlatform.h.
|
protected |
pointer to the scheduler
Definition at line 506 of file DSMEPlatform.h.
|
protected |
state of the platform layer
Definition at line 521 of file DSMEPlatform.h.
|
protected |
whether the MAC is synchronized
Definition at line 476 of file DSMEPlatform.h.
|
protected |
timer used for the MAC
Definition at line 496 of file DSMEPlatform.h.
|
protected |
delegate callback for TX end
Definition at line 384 of file DSMEPlatform.h.
|
protected |
whether the MAC expects an ACK frame
Definition at line 526 of file DSMEPlatform.h.