31 #include <ns3/object.h>
32 #include <ns3/packet.h>
71 void SetPhy(Ptr<SatPhy> phy);
92 virtual void Send(Ptr<Packet> packet,
const Address& dest, uint16_t protocolNumber);
99 virtual void Send(Ptr<Packet> packet) = 0;
107 Ptr<SatSignalParameters> ) = 0;
This class supports LorawanMac instances by managing a list of the logical channels that the device i...
Class representing the LoRaWAN MAC layer.
TracedCallback< Ptr< const Packet > > m_receivedPacket
Trace source that is fired when a packet reaches the MAC layer.
ReplyDataRateMatrix m_replyDataRateMatrix
The matrix that decides the DR the GW will use in a reply based on the ED's sending DR and on the val...
void SetReplyDataRateMatrix(ReplyDataRateMatrix replyDataRateMatrix)
Set the matrix to use when deciding with which DataRate to respond.
virtual void Send(Ptr< Packet > packet)=0
Send a packet.
std::vector< uint32_t > m_maxAppPayloadForDataRate
A vector holding the maximum app payload size that corresponds to a certain DataRate.
std::vector< double > m_bandwidthForDataRate
A vector holding the bandwidth each Data Rate corresponds to.
int m_nPreambleSymbols
The number of symbols to use in the PHY preamble.
int GetNPreambleSymbols(void)
Get the number of PHY preamble symbols this MAC is set to use.
void SetTxDbmForTxPower(std::vector< double > txDbmForTxPower)
Set the vector to use to check up which transmission power in Dbm corresponds to a certain TxPower va...
Time GetOnAirTime(Ptr< Packet > packet, LoraTxParameters txParams)
Compute the time that a packet with certain characteristics will take to be transmitted.
uint32_t m_beamId
ID of beam for UT.
Ptr< SatPhy > GetPhy(void)
Get the underlying PHY layer.
TracedCallback< Ptr< const Packet > > m_cannotSendBecauseDutyCycle
The trace source that is fired when a packet cannot be sent because of duty cycle limitations.
bool m_isRegenerative
Indicates if satellite is regenerative on the link where this layer is sending packets.
Ptr< SatPhy > m_phy
The PHY instance that sits under this MAC layer.
virtual void Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Send a packet.
void SetBandwidthForDataRate(std::vector< double > bandwidthForDataRate)
Set the vector to use to check up correspondence between bandwidth and DataRate.
virtual void FailedReception(Ptr< const Packet > packet)=0
Function called by lower layers to inform this layer that reception of a packet we were locked on fai...
static TypeId GetTypeId(void)
TracedCallback< Ptr< const Packet > > m_sentNewPacket
Trace source that is fired when a new APP layer packet arrives at the MAC layer.
void SetSfForDataRate(std::vector< uint8_t > sfForDataRate)
Set the vector to use to check up correspondence between SF and DataRate.
void SetMaxAppPayloadForDataRate(std::vector< uint32_t > maxAppPayloadForDataRate)
Set the maximum App layer payload for a set DataRate.
uint8_t GetSfFromDataRate(uint8_t dataRate)
Get the SF corresponding to a data rate, based on this MAC's region.
void SetPhyTx(Ptr< SatLoraPhyTx > phyTx)
Set the underlying PHY TX layer.
Ptr< NetDevice > GetDevice(void)
Get the device this MAC layer is installed on.
Ptr< NetDevice > m_device
The device this MAC layer is installed on.
LoraLogicalChannelHelper GetLoraLogicalChannelHelper(void)
Get the logical lora channel helper associated with this MAC.
std::vector< double > m_txDbmForTxPower
A vector holding the power that corresponds to a certain TxPower value.
double GetDbmForTxPower(uint8_t txPower)
Get the transmission power in dBm that corresponds, in this region, to the encoded 8-bit txPower.
virtual void Receive(SatPhy::PacketContainer_t packets, Ptr< SatSignalParameters >)=0
Receive a packet from the lower layer.
Ptr< SatLoraPhyTx > GetPhyTx(void)
Get the underlying PHY TX layer.
void SetNPreambleSymbols(int nPreambleSymbols)
Set the number of PHY preamble symbols this MAC is set to use.
void SetLoraLogicalChannelHelper(LoraLogicalChannelHelper helper)
Set the LoraLogicalChannelHelper this MAC instance will use.
void SetPhy(Ptr< SatPhy > phy)
Set the underlying PHY layer.
void SetDevice(Ptr< NetDevice > device)
Set the device this MAC layer is installed on.
LoraLogicalChannelHelper m_channelHelper
The LoraLogicalChannelHelper instance that is assigned to this MAC.
void setRegenerative(bool isRegenerative)
Indicates if the satellite is regenerative on the link this layer is sending packets.
std::vector< uint8_t > m_sfForDataRate
A vector holding the SF each Data Rate corresponds to.
virtual void TxFinished()=0
Perform actions after sending a packet.
double GetBandwidthFromDataRate(uint8_t dataRate)
Get the BW corresponding to a data rate, based on this MAC's region.
std::array< std::array< uint8_t, 6 >, 8 > ReplyDataRateMatrix
Base MAC class for SatNetDevices.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Structure to collect all parameters that are used to compute the duration of a packet (excluding payl...