Loading...
Searching...
No Matches
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 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
 
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
 
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 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 Enumeration Documentation

◆ anonymous enum

anonymous enum

state of the Platform layer

Definition at line 195 of file DSMEPlatform.h.

Member Function Documentation

◆ getAddress()

IEEE802154MacAddress & dsme::DSMEPlatform::getAddress ( )
inline

get extended address

Definition at line 334 of file DSMEPlatform.h.

◆ getDSME()

DSMELayer & dsme::DSMEPlatform::getDSME ( )
inline

get the DSME layer

Definition at line 96 of file DSMEPlatform.h.

◆ getEventQueue()

event_queue_t * dsme::DSMEPlatform::getEventQueue ( )
inlineprotected

get the event queue of the MAC

Definition at line 424 of file DSMEPlatform.h.

◆ 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.

◆ getRandom()

uint16_t dsme::DSMEPlatform::getRandom ( )
inlineoverride

get a uint16_t random number

Definition at line 297 of file DSMEPlatform.h.

◆ setGNRCNetif()

void dsme::DSMEPlatform::setGNRCNetif ( gnrc_netif_t netif)
inline

set the GNRC netif

Definition at line 188 of file DSMEPlatform.h.

◆ setPlatformState()

void dsme::DSMEPlatform::setPlatformState ( uint8_t  state)
inline

set the platform state

Definition at line 161 of file DSMEPlatform.h.

◆ signalReleasedMsg()

virtual void dsme::DSMEPlatform::signalReleasedMsg ( DSMEMessage msg)
inlineprotectedvirtual

signal release of message

Definition at line 394 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

Field Documentation

◆ acktimer

ztimer_t dsme::DSMEPlatform::acktimer
protected

timer used for ACK timeout events

Definition at line 516 of file DSMEPlatform.h.

◆ associationInProgress

bool dsme::DSMEPlatform::associationInProgress {false}
protected

whether the association is in progress

Definition at line 471 of file DSMEPlatform.h.

◆ dsme

DSMELayer dsme::DSMEPlatform::dsme
protected

descriptor of the DSME MAC

Definition at line 441 of file DSMEPlatform.h.

◆ dsmeAdaptionLayer

DSMEAdaptionLayer dsme::DSMEPlatform::dsmeAdaptionLayer
protected

descriptor of the DSME Adaption Layer

Definition at line 456 of file DSMEPlatform.h.

◆ initialized

bool dsme::DSMEPlatform::initialized
protected

whether the MAC is initialized

Definition at line 461 of file DSMEPlatform.h.

◆ instance

DSMEPlatform* dsme::DSMEPlatform::instance
static

pointer to the DSME instance

Definition at line 76 of file DSMEPlatform.h.

◆ mac_pib

MAC_PIB dsme::DSMEPlatform::mac_pib
protected

holds the MAC Information Base

Definition at line 436 of file DSMEPlatform.h.

◆ mcps_sap

mcps_sap::MCPS_SAP dsme::DSMEPlatform::mcps_sap
protected

descriptor of the MCPS Service Access Point

Definition at line 446 of file DSMEPlatform.h.

◆ message

IDSMEMessage* dsme::DSMEPlatform::message
protected

used to hold an incoming message before passing it to the MAC

Definition at line 501 of file DSMEPlatform.h.

◆ mlme_sap

mlme_sap::MLME_SAP dsme::DSMEPlatform::mlme_sap
protected

descriptor of the MLME Service Access Point

Definition at line 451 of file DSMEPlatform.h.

◆ netif

gnrc_netif_t* dsme::DSMEPlatform::netif
protected

pointer to the GNRC interface

Definition at line 491 of file DSMEPlatform.h.

◆ pending_tx

bool dsme::DSMEPlatform::pending_tx
protected

whether there is a pending TX frame

Definition at line 531 of file DSMEPlatform.h.

◆ phy_pib

PHY_PIB dsme::DSMEPlatform::phy_pib
protected

holds the PHY Information Base

Definition at line 431 of file DSMEPlatform.h.

◆ radio

ieee802154_dev_t* dsme::DSMEPlatform::radio
protected

pointer to the IEEE 802.15.4 HAL descriptor

Definition at line 536 of file DSMEPlatform.h.

◆ receiveFromAckLayerDelegate

receive_delegate_t dsme::DSMEPlatform::receiveFromAckLayerDelegate
protected

delegate callback for passing frames to the ACK layer

Definition at line 486 of file DSMEPlatform.h.

◆ rx_on_cap

bool dsme::DSMEPlatform::rx_on_cap {true}
protected

whether the MAC keeps the receiver on during CAP

Definition at line 481 of file DSMEPlatform.h.

◆ rx_sfd

uint32_t dsme::DSMEPlatform::rx_sfd
protected

timestamp (in number of symbols) of the last received preamble

Definition at line 511 of file DSMEPlatform.h.

◆ scanOrSyncInProgress

bool dsme::DSMEPlatform::scanOrSyncInProgress {false}
protected

whether there is a scan or sync in progress

Definition at line 466 of file DSMEPlatform.h.

◆ scheduling

GTSScheduling* dsme::DSMEPlatform::scheduling = nullptr
protected

pointer to the scheduler

Definition at line 506 of file DSMEPlatform.h.

◆ state

uint8_t dsme::DSMEPlatform::state
protected

state of the platform layer

Definition at line 521 of file DSMEPlatform.h.

◆ syncActive

bool dsme::DSMEPlatform::syncActive {false}
protected

whether the MAC is synchronized

Definition at line 476 of file DSMEPlatform.h.

◆ timer

ztimer_t dsme::DSMEPlatform::timer
protected

timer used for the MAC

Definition at line 496 of file DSMEPlatform.h.

◆ txEndCallback

Delegate<void(bool)> dsme::DSMEPlatform::txEndCallback
protected

delegate callback for TX end

Definition at line 384 of file DSMEPlatform.h.

◆ wait_for_ack

bool dsme::DSMEPlatform::wait_for_ack
protected

whether the MAC expects an ACK frame

Definition at line 526 of file DSMEPlatform.h.


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