dsme::DSMEPlatform Class Reference

DSMEPlatform interface implementation for GNRC. More...

Detailed Description

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
 

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
 
DSMEMessagegetEmptyMessage () 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 More...
 
void scheduleStartOfCFP () override
 callback to offload the start of CFP
 
uint8_t getMinCoordinatorLQI () override
 Get the minimum LQI. More...
 
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 DSMEPlatforminstance
 pointer to the DSME instance
 

Protected Member Functions

 DSMEPlatform (const DSMEPlatform &)
 Copy constructor is not allowed.
 
DSMEPlatformoperator= (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_tgetEventQueue ()
 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_tnetif
 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_tradio
 pointer to the IEEE 802.15.4 HAL descriptor
 

Member Function Documentation

◆ getMinCoordinatorLQI()

uint8_t dsme::DSMEPlatform::getMinCoordinatorLQI ( )
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.

◆ updateVisual()

void dsme::DSMEPlatform::updateVisual ( )
override

update visual components of openDSME

Note
to be used in a simulation environment and therefore not used in RIOT

The documentation for this class was generated from the following file: