22#ifndef OPENDSME_DSMEMESSAGE_H
23#define OPENDSME_DSMEMESSAGE_H
28#include "dsmeLayer/messages/IEEE802154eMACHeader.h"
29#include "interfaces/IDSMEMessage.h"
31#include "mac_services/dataStructures/DSMEMessageElement.h"
67 void copyTo(DSMEMessageElement *msg);
74 return this->pkt != NULL && this->pkt->
size > 0;
82 return startOfFrameDelimiterSymbolCounter;
90 startOfFrameDelimiterSymbolCounter = symbolCounter;
100 uint16_t bytes = macHdr.getSerializationLength()
137 return receivedViaMCPS;
145 this->receivedViaMCPS = receivedViaMCPS;
153 return currentlySending;
161 this->currentlySending = currentlySending;
169 this->retryCounter++;
177 return this->retryCounter;
194 return this->messageRSSI;
213 return (uint8_t *)pkt->
data;
257 receivedViaMCPS(false),
258 currentlySending(false),
273 currentlySending =
false;
275 receivedViaMCPS =
false;
284 IEEE802154eMACHeader macHdr;
304 uint32_t startOfFrameDelimiterSymbolCounter;
309 bool receivedViaMCPS;
314 bool currentlySending;
319 uint8_t retryCounter;
327friend class DSMEPlatform;
328friend class DSMEMessageElement;
329friend class DSMEPlatformBase;
330friend class DSMEMessageBuffer;
DSME Message interface implementation for GNRC.
bool hasPayload() override
check whether the message has payload
void increaseRetryCounter() override
increase retry counter for current message
uint8_t getRetryCounter() override
get retry counter
void setCurrentlySending(bool currentlySending) override
indicate that the message is being sent
bool free
whether the message is free
uint8_t getLQI() override
get LQI of the message
void clearMessage()
clear the message
int dropHdr(size_t len)
drop a number of bytes from the header
void copyTo(DSMEMessageElement *msg)
copy payload to DSME Message Element
int8_t getRSSI() override
get RSSI of frame
void setReceivedViaMCPS(bool receivedViaMCPS) override
indicated that message was received via MCPS
int loadBuffer(size_t len)
preallocate buffer with a given length
bool firstTry
whether the message is being sent on the first try
bool getReceivedViaMCPS() override
check whether the message was received via MCPS
void setStartOfFrameDelimiterSymbolCounter(uint32_t symbolCounter) override
set the symbol counter at the end of the SFD
int loadBuffer(iolist_t *pkt)
load a GNRC packet into the internal openDSME message representation
void decapsulateTo(DSMEMessageElement *msg) override
decapsulate header to a message
uint8_t getPayloadLength()
get payload length
uint16_t getTotalSymbols() override
get the total number of symbols in current frame
uint8_t getMPDUSymbols() override
get number of MPDU Symbols
IEEE802154eMACHeader & getHeader() override
get IEEE 802.15.4 header
void dispatchMessage()
dispatch the message to upper layers
iolist_t * getIolPayload()
get the IOLIST representation of the message
uint32_t getStartOfFrameDelimiterSymbolCounter() override
get the symbol counter at the end of the SFD
void prependFrom(DSMEMessageElement *msg) override
prepend a header to current message
bool getCurrentlySending() override
whether the message is being sent
void releaseMessage()
release the message
uint8_t * getPayload()
get buffer associated to the current payload
iolist scatter / gather IO
Interface definition for the global network buffer.
Representation of a network interface.
Type to represent parts (either headers or payload) of a packet, called snips.
void * data
pointer to the data of the snip
size_t size
the length of the snip in byte
iolist structure definition