A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::ClassAEndDeviceLorawanMac Class Reference

Class representing the MAC layer of a Class A LoRaWAN device. More...

#include "class-a-end-device-lorawan-mac.h"

+ Inheritance diagram for ns3::lorawan::ClassAEndDeviceLorawanMac:
+ Collaboration diagram for ns3::lorawan::ClassAEndDeviceLorawanMac:

Public Member Functions

 ClassAEndDeviceLorawanMac ()
 Default constructor.
 
 ~ClassAEndDeviceLorawanMac () override
 Destructor.
 
void CloseFirstReceiveWindow ()
 Perform operations needed to close the first receive window.
 
void CloseSecondReceiveWindow ()
 Perform operations needed to close the second receive window.
 
void FailedReception (Ptr< const Packet > packet) override
 Function called by lower layers to inform this layer that reception of a packet we were locked on failed.
 
uint8_t GetFirstReceiveWindowDataRate ()
 Get the data rate that will be used in the first receive window.
 
Time GetNextClassTransmissionDelay (Time waitTime) override
 Find the minimum wait time before the next possible transmission based on end device's Class Type.
 
uint8_t GetSecondReceiveWindowDataRate () const
 Get the data rate that will be used in the second receive window.
 
uint32_t GetSecondReceiveWindowFrequency () const
 Get the frequency that is used for the second receive window.
 
void OnRxParamSetupReq (uint8_t rx1DrOffset, uint8_t rx2DataRate, double frequencyHz) override
 Perform the actions that need to be taken when receiving a RxParamSetupReq command based on the Device's Class Type.
 
void OpenFirstReceiveWindow ()
 Perform operations needed to open the first receive window.
 
void OpenSecondReceiveWindow ()
 Perform operations needed to open the second receive window.
 
void Receive (Ptr< const Packet > packet) override
 Receive a packet.
 
void SendToPhy (Ptr< Packet > packet) override
 Add headers and send a packet with the sending function of the physical layer.
 
void SetSecondReceiveWindowDataRate (uint8_t dataRate)
 Set the data rate to be used in the second receive window.
 
void SetSecondReceiveWindowFrequency (uint32_t frequencyHz)
 Set the frequency that will be used for the second receive window.
 
void TxFinished (Ptr< const Packet > packet) override
 Perform the actions that are required after a packet send.
 
- Public Member Functions inherited from ns3::lorawan::EndDeviceLorawanMac
 EndDeviceLorawanMac ()
 Default constructor.
 
 ~EndDeviceLorawanMac () override
 Destructor.
 
void AddMacCommand (Ptr< MacCommand > macCommand)
 Add a MAC command to the list of those that will be sent out in the next packet.
 
void ApplyNecessaryOptions (LoraFrameHeader &frameHeader)
 Add the necessary options and MAC commands to the LoraFrameHeader.
 
void ApplyNecessaryOptions (LorawanMacHeader &macHeader)
 Add the necessary options and MAC commands to the LorawanMacHeader.
 
virtual void DoSend (Ptr< Packet > packet)
 Checking if we are performing the transmission of a new packet or a retransmission, and call SendToPhy function.
 
void FailedReception (Ptr< const Packet > packet) override
 Function called by lower layers to inform this layer that reception of a packet we were locked on failed.
 
double GetAggregatedDutyCycle ()
 Get the aggregated duty cycle.
 
uint8_t GetDataRate ()
 Get the data rate this end device is set to use.
 
LoraDeviceAddress GetDeviceAddress ()
 Get the network address of this device.
 
uint8_t GetLastKnownGatewayCount () const
 Get the last known number of gateways concurrently receiving transmissions from the device.
 
uint8_t GetLastKnownLinkMarginDb () const
 Get the last known link margin from the demodulation floor.
 
uint8_t GetMaxNumberOfTransmissions ()
 Get the max number of unacknowledged redundant transmissions of each packet.
 
LorawanMacHeader::MType GetMType ()
 Get the message type to send when the Send method is called.
 
double GetTransmissionPowerDbm ()
 Get the transmission power this end device is set to use.
 
bool GetUplinkAdrBit () const
 Get the current value of the device's uplink ADR bit of the LoRaWAN FHDR.
 
void OnDevStatusReq ()
 Perform the actions that need to be taken when receiving a DevStatusReq command.
 
void OnDutyCycleReq (uint8_t maxDutyCycle)
 Perform the actions that need to be taken when receiving a DutyCycleReq command.
 
void OnLinkAdrReq (uint8_t dataRate, uint8_t txPower, uint16_t chMask, uint8_t chMaskCntl, uint8_t nbTrans)
 Perform the actions that need to be taken when receiving a LinkAdrReq command.
 
void OnLinkCheckAns (uint8_t margin, uint8_t gwCnt)
 Perform the actions that need to be taken when receiving a LinkCheckAns command.
 
void OnNewChannelReq (uint8_t chIndex, uint32_t frequencyHz, uint8_t minDataRate, uint8_t maxDataRate)
 Perform the actions that need to be taken when receiving a NewChannelReq command.
 
void ParseCommands (LoraFrameHeader frameHeader)
 Parse and take action on the commands contained on this FrameHeader.
 
virtual void postponeTransmission (Time nextTxDelay, Ptr< Packet > packet)
 Postpone transmission to the specified time and delete previously scheduled transmissions if present.
 
void Receive (Ptr< const Packet > packet) override
 Receive a packet from the lower layer.
 
virtual void resetRetransmissionParameters ()
 Reset retransmission parameters contained in the structure LoraRetxParams.
 
void Send (Ptr< Packet > packet) override
 Send a packet.
 
void SetDataRate (uint8_t dataRate)
 Set the data rate this end device will use when transmitting.
 
void SetDeviceAddress (LoraDeviceAddress address)
 Set the network address of this device.
 
void SetMaxNumberOfTransmissions (uint8_t nbTrans)
 Set the max number of unacknowledged redundant transmissions of each packet.
 
void SetMType (LorawanMacHeader::MType mType)
 Set the message type to send when the Send method is called.
 
void SetTransmissionPowerDbm (double txPowerDbm)
 Set the transmission power of this end device.
 
void SetUplinkAdrBit (bool adr)
 Signals to the network server that this device will or may not comply with LinkADRReq settings (data rate, transmission power and number of retransmissions) received in downlink.
 
void TxFinished (Ptr< const Packet > packet) override
 Perform actions after sending a packet.
 
- Public Member Functions inherited from ns3::lorawan::LorawanMac
 LorawanMac ()
 Default constructor.
 
 ~LorawanMac () override
 Destructor.
 
double GetBandwidthFromDataRate (uint8_t dataRate)
 Get the bandwidth corresponding to a data rate, based on this MAC's region.
 
double GetDbmForTxPower (uint8_t txPower)
 Get the transmission power in dBm that corresponds, in this region, to the encoded 8-bit txPower.
 
Ptr< NetDeviceGetDevice ()
 Get the device this MAC layer is installed on.
 
Ptr< LogicalLoraChannelHelperGetLogicalLoraChannelHelper ()
 Get the logical lora channel helper associated with this MAC.
 
int GetNPreambleSymbols () const
 Get the number of PHY preamble symbols this MAC is set to use.
 
Ptr< LoraPhyGetPhy ()
 Get the underlying PHY layer.
 
uint8_t GetSfFromDataRate (uint8_t dataRate)
 Get the spreading factor corresponding to a data rate, based on this MAC's region.
 
void SetBandwidthForDataRate (std::vector< double > bandwidthForDataRate)
 Set the vector to use to check up correspondence between bandwidth and data rate.
 
void SetDevice (Ptr< NetDevice > device)
 Set the device this MAC layer is installed on.
 
void SetLogicalLoraChannelHelper (Ptr< LogicalLoraChannelHelper > helper)
 Set the LogicalLoraChannelHelper this MAC instance will use.
 
void SetMaxAppPayloadForDataRate (std::vector< uint32_t > maxAppPayloadForDataRate)
 Set the maximum App layer payload for a set data rate.
 
void SetNPreambleSymbols (int nPreambleSymbols)
 Set the number of PHY preamble symbols this MAC is set to use.
 
void SetPhy (Ptr< LoraPhy > phy)
 Set the underlying PHY layer.
 
void SetReplyDataRateMatrix (ReplyDataRateMatrix replyDataRateMatrix)
 Set the matrix to use when deciding with which data rate to respond.
 
void SetSfForDataRate (std::vector< uint8_t > sfForDataRate)
 Set the vector to use to check up correspondence between spreading factor and data rate.
 
void SetTxDbmForTxPower (std::vector< double > txDbmForTxPower)
 Set the vector to use to check up which transmission power in Dbm corresponds to a certain TxPower value in this MAC's region.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const final
 Get the most derived TypeId for this Object.
 
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T>
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::lorawan::EndDeviceLorawanMac
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::lorawan::LorawanMac
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

EventId m_closeFirstWindow
 The event of the closing the first receive window.
 
EventId m_closeSecondWindow
 The event of the closing the second receive window.
 
Time m_receiveDelay1
 The interval between when a packet is done sending and when the first receive window is opened.
 
Time m_receiveDelay2
 The interval between when a packet is done sending and when the second receive window is opened.
 
uint8_t m_rx1DrOffset
 The RX1DROffset parameter value.
 
EventId m_secondReceiveWindow
 The event of the second receive window opening.
 
uint8_t m_secondReceiveWindowDataRate
 The data rate to listen for during the second downlink transmission.
 
uint32_t m_secondReceiveWindowFrequencyHz
 The frequency [Hz] to listen on for the second receive window.
 

Additional Inherited Members

- Public Types inherited from ns3::lorawan::LorawanMac
typedef std::array< std::array< uint8_t, 6 >, 8 > ReplyDataRateMatrix
 Matrix structure to store possible data rate value to be used by a LoRaWAN end device for listening during the RX1 receive window.
 
- Protected Member Functions inherited from ns3::lorawan::EndDeviceLorawanMac
Ptr< LogicalLoraChannelGetChannelForTx ()
 Find a suitable channel for transmission.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 
- Protected Attributes inherited from ns3::lorawan::EndDeviceLorawanMac
LoraDeviceAddress m_address
 The address of this device.
 
uint8_t m_codingRate
 The coding rate used by this device.
 
TracedValue< uint8_t > m_dataRate
 The data rate this device is using to transmit.
 
bool m_enableDRAdapt
 Enable data rate adaptation (ADR) during the retransmission procedure.
 
bool m_headerDisabled
 Whether or not the LoRa PHY header is disabled for communications by this device.
 
double m_lastRxSnr
 Used to record the last reception SNR measurement to be included in the DevStatusAns.
 
std::list< Ptr< MacCommand > > m_macCommandList
 List of the MAC commands that need to be applied to the next UL packet.
 
uint8_t m_nbTrans
 Default number of unacknowledged redundant transmissions of each packet.
 
uint8_t m_receiveWindowDurationInSymbols
 The duration of a receive window in number of symbols.
 
TracedCallback< uint8_t, bool, Time, Ptr< Packet > > m_requiredTxCallback
 The trace source fired when the transmission procedure is finished.
 
struct LoraRetxParameters m_retxParams
 Structure containing the retransmission parameters for this device.
 
TracedValue< doublem_txPowerDbm
 The transmission ERP [dBm] this device is currently using.
 
Ptr< UniformRandomVariablem_uniformRV
 An uniform random variable, used to randomly pick from the channel list.
 
- Protected Attributes inherited from ns3::lorawan::LorawanMac
std::vector< doublem_bandwidthForDataRate
 A vector holding the bandwidth each data rate corresponds to.
 
TracedCallback< Ptr< const Packet > > m_cannotSendBecauseDutyCycle
 The trace source that is fired when a packet cannot be sent because of duty cycle limitations.
 
Ptr< LogicalLoraChannelHelperm_channelHelper
 The LogicalLoraChannelHelper instance that is assigned to this MAC.
 
Ptr< NetDevicem_device
 The device this MAC layer is installed on.
 
std::vector< uint32_tm_maxAppPayloadForDataRate
 A vector holding the maximum app payload size that corresponds to a certain data rate.
 
int m_nPreambleSymbols
 The number of symbols to use in the PHY preamble.
 
Ptr< LoraPhym_phy
 The PHY instance that sits under this 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 data rate the gateway will use in a reply based on the end device's sending data rate and on the value of the RX1DROffset parameter.
 
TracedCallback< Ptr< const Packet > > m_sentNewPacket
 Trace source that is fired when a new APP layer packet arrives at the MAC layer.
 
std::vector< uint8_t > m_sfForDataRate
 A vector holding the spreading factor each data rate corresponds to.
 
std::vector< doublem_txDbmForTxPower
 A vector holding the power that corresponds to a certain TxPower value.
 

Detailed Description

Class representing the MAC layer of a Class A LoRaWAN device.

Definition at line 33 of file class-a-end-device-lorawan-mac.h.

Constructor & Destructor Documentation

◆ ClassAEndDeviceLorawanMac()

ns3::lorawan::ClassAEndDeviceLorawanMac::ClassAEndDeviceLorawanMac ( )

Default constructor.

Definition at line 40 of file class-a-end-device-lorawan-mac.cc.

References m_closeFirstWindow, m_closeSecondWindow, m_receiveDelay1, m_receiveDelay2, m_rx1DrOffset, m_secondReceiveWindow, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~ClassAEndDeviceLorawanMac()

ns3::lorawan::ClassAEndDeviceLorawanMac::~ClassAEndDeviceLorawanMac ( )
override

Destructor.

Definition at line 58 of file class-a-end-device-lorawan-mac.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ CloseFirstReceiveWindow()

void ns3::lorawan::ClassAEndDeviceLorawanMac::CloseFirstReceiveWindow ( )

Perform operations needed to close the first receive window.

Definition at line 313 of file class-a-end-device-lorawan-mac.cc.

References ns3::DynamicCast(), ns3::lorawan::LorawanMac::m_phy, NS_ABORT_MSG, NS_LOG_FUNCTION_NOARGS, ns3::lorawan::EndDeviceLoraPhy::RX, ns3::lorawan::EndDeviceLoraPhy::SLEEP, ns3::lorawan::EndDeviceLoraPhy::STANDBY, and ns3::lorawan::EndDeviceLoraPhy::TX.

Referenced by OpenFirstReceiveWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CloseSecondReceiveWindow()

void ns3::lorawan::ClassAEndDeviceLorawanMac::CloseSecondReceiveWindow ( )

Perform operations needed to close the second receive window.

Definition at line 379 of file class-a-end-device-lorawan-mac.cc.

References ns3::DynamicCast(), ns3::lorawan::EndDeviceLorawanMac::m_nbTrans, ns3::lorawan::LorawanMac::m_phy, ns3::lorawan::EndDeviceLorawanMac::m_requiredTxCallback, ns3::lorawan::EndDeviceLorawanMac::m_retxParams, NS_ABORT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION_NOARGS, NS_LOG_INFO, ns3::lorawan::EndDeviceLorawanMac::resetRetransmissionParameters(), ns3::lorawan::EndDeviceLoraPhy::RX, ns3::lorawan::EndDeviceLorawanMac::Send(), ns3::lorawan::EndDeviceLoraPhy::SLEEP, ns3::lorawan::EndDeviceLoraPhy::STANDBY, and ns3::lorawan::EndDeviceLoraPhy::TX.

Referenced by OpenSecondReceiveWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FailedReception()

void ns3::lorawan::ClassAEndDeviceLorawanMac::FailedReception ( Ptr< const Packet > packet)
overridevirtual

Function called by lower layers to inform this layer that reception of a packet we were locked on failed.

Parameters
packetThe packet we failed to receive.

Implements ns3::lorawan::LorawanMac.

Definition at line 239 of file class-a-end-device-lorawan-mac.cc.

References ns3::DynamicCast(), ns3::lorawan::EndDeviceLorawanMac::m_nbTrans, ns3::lorawan::LorawanMac::m_phy, ns3::lorawan::EndDeviceLorawanMac::m_requiredTxCallback, ns3::lorawan::EndDeviceLorawanMac::m_retxParams, m_secondReceiveWindow, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::lorawan::EndDeviceLorawanMac::resetRetransmissionParameters(), and ns3::lorawan::EndDeviceLorawanMac::Send().

+ Here is the call graph for this function:

◆ GetFirstReceiveWindowDataRate()

uint8_t ns3::lorawan::ClassAEndDeviceLorawanMac::GetFirstReceiveWindowDataRate ( )

Get the data rate that will be used in the first receive window.

Returns
The data rate.

Definition at line 495 of file class-a-end-device-lorawan-mac.cc.

References ns3::lorawan::EndDeviceLorawanMac::m_dataRate, ns3::lorawan::LorawanMac::m_replyDataRateMatrix, and m_rx1DrOffset.

Referenced by OpenFirstReceiveWindow(), and SendToPhy().

+ Here is the caller graph for this function:

◆ GetNextClassTransmissionDelay()

Time ns3::lorawan::ClassAEndDeviceLorawanMac::GetNextClassTransmissionDelay ( Time waitTime)
overridevirtual

Find the minimum wait time before the next possible transmission based on end device's Class Type.

Parameters
waitTimeThe minimum wait time that has to be respected, irrespective of the class (e.g., because of duty cycle limitations).
Returns
The Time value.

Reimplemented from ns3::lorawan::EndDeviceLorawanMac.

Definition at line 451 of file class-a-end-device-lorawan-mac.cc.

References ns3::Time::As(), ns3::lorawan::LorawanMac::GetBandwidthFromDataRate(), GetSecondReceiveWindowDataRate(), ns3::lorawan::LorawanMac::GetSfFromDataRate(), m_closeFirstWindow, m_closeSecondWindow, ns3::lorawan::EndDeviceLorawanMac::m_receiveWindowDurationInSymbols, ns3::lorawan::EndDeviceLorawanMac::m_retxParams, m_secondReceiveWindow, ns3::lorawan::EndDeviceLorawanMac::m_uniformRV, Max, ns3::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION_NOARGS, NS_LOG_WARN, ns3::Time::S, and ns3::Seconds().

+ Here is the call graph for this function:

◆ GetSecondReceiveWindowDataRate()

uint8_t ns3::lorawan::ClassAEndDeviceLorawanMac::GetSecondReceiveWindowDataRate ( ) const

Get the data rate that will be used in the second receive window.

Returns
The data rate.

Definition at line 507 of file class-a-end-device-lorawan-mac.cc.

References m_secondReceiveWindowDataRate.

Referenced by GetNextClassTransmissionDelay(), and OpenSecondReceiveWindow().

+ Here is the caller graph for this function:

◆ GetSecondReceiveWindowFrequency()

uint32_t ns3::lorawan::ClassAEndDeviceLorawanMac::GetSecondReceiveWindowFrequency ( ) const

Get the frequency that is used for the second receive window.

Returns
The frequency, in Hz.

Definition at line 519 of file class-a-end-device-lorawan-mac.cc.

References m_secondReceiveWindowFrequencyHz.

◆ GetTypeId()

TypeId ns3::lorawan::ClassAEndDeviceLorawanMac::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

Definition at line 31 of file class-a-end-device-lorawan-mac.cc.

References ClassAEndDeviceLorawanMac(), ns3::lorawan::EndDeviceLorawanMac::EndDeviceLorawanMac(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ OnRxParamSetupReq()

void ns3::lorawan::ClassAEndDeviceLorawanMac::OnRxParamSetupReq ( uint8_t rx1DrOffset,
uint8_t rx2DataRate,
double frequencyHz )
overridevirtual

Perform the actions that need to be taken when receiving a RxParamSetupReq command based on the Device's Class Type.

Parameters
rx1DrOffsetThe first reception window data rate offset to set.
rx2DataRateThe data rate to use for the second receive window.
frequencyHzThe frequency [Hz] to use for the second receive window.

Implements ns3::lorawan::EndDeviceLorawanMac.

Definition at line 529 of file class-a-end-device-lorawan-mac.cc.

References ns3::Create(), ns3::lorawan::LorawanMac::GetBandwidthFromDataRate(), ns3::lorawan::LorawanMac::GetSfFromDataRate(), ns3::lorawan::LorawanMac::m_channelHelper, ns3::lorawan::EndDeviceLorawanMac::m_dataRate, ns3::lorawan::EndDeviceLorawanMac::m_macCommandList, ns3::lorawan::LorawanMac::m_replyDataRateMatrix, m_rx1DrOffset, m_secondReceiveWindowDataRate, m_secondReceiveWindowFrequencyHz, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.

+ Here is the call graph for this function:

◆ OpenFirstReceiveWindow()

void ns3::lorawan::ClassAEndDeviceLorawanMac::OpenFirstReceiveWindow ( )

Perform operations needed to open the first receive window.

Definition at line 293 of file class-a-end-device-lorawan-mac.cc.

References CloseFirstReceiveWindow(), ns3::DynamicCast(), ns3::lorawan::LorawanMac::GetBandwidthFromDataRate(), GetFirstReceiveWindowDataRate(), ns3::lorawan::LorawanMac::GetSfFromDataRate(), m_closeFirstWindow, ns3::lorawan::LorawanMac::m_phy, ns3::lorawan::EndDeviceLorawanMac::m_receiveWindowDurationInSymbols, NS_LOG_FUNCTION_NOARGS, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by TxFinished().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OpenSecondReceiveWindow()

void ns3::lorawan::ClassAEndDeviceLorawanMac::OpenSecondReceiveWindow ( )

Perform operations needed to open the second receive window.

Definition at line 342 of file class-a-end-device-lorawan-mac.cc.

References CloseSecondReceiveWindow(), ns3::DynamicCast(), ns3::lorawan::LorawanMac::GetBandwidthFromDataRate(), GetSecondReceiveWindowDataRate(), ns3::lorawan::LorawanMac::GetSfFromDataRate(), m_closeSecondWindow, ns3::lorawan::LorawanMac::m_phy, ns3::lorawan::EndDeviceLorawanMac::m_receiveWindowDurationInSymbols, m_secondReceiveWindowDataRate, m_secondReceiveWindowFrequencyHz, NS_LOG_FUNCTION_NOARGS, NS_LOG_INFO, ns3::lorawan::EndDeviceLoraPhy::RX, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by TxFinished().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Receive()

◆ SendToPhy()

◆ SetSecondReceiveWindowDataRate()

void ns3::lorawan::ClassAEndDeviceLorawanMac::SetSecondReceiveWindowDataRate ( uint8_t dataRate)

Set the data rate to be used in the second receive window.

Parameters
dataRateThe data rate.

Definition at line 501 of file class-a-end-device-lorawan-mac.cc.

References m_secondReceiveWindowDataRate.

◆ SetSecondReceiveWindowFrequency()

void ns3::lorawan::ClassAEndDeviceLorawanMac::SetSecondReceiveWindowFrequency ( uint32_t frequencyHz)

Set the frequency that will be used for the second receive window.

Parameters
frequencyHzThe Frequency.

Definition at line 513 of file class-a-end-device-lorawan-mac.cc.

References m_secondReceiveWindowFrequencyHz.

◆ TxFinished()

void ns3::lorawan::ClassAEndDeviceLorawanMac::TxFinished ( Ptr< const Packet > packet)
overridevirtual

Perform the actions that are required after a packet send.

This function handles opening of the first receive window.

Parameters
packetThe packet that has just been transmitted.

Implements ns3::lorawan::LorawanMac.

Definition at line 268 of file class-a-end-device-lorawan-mac.cc.

References ns3::DynamicCast(), ns3::lorawan::LorawanMac::m_phy, m_receiveDelay1, m_receiveDelay2, m_secondReceiveWindow, NS_LOG_FUNCTION_NOARGS, OpenFirstReceiveWindow(), OpenSecondReceiveWindow(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_closeFirstWindow

EventId ns3::lorawan::ClassAEndDeviceLorawanMac::m_closeFirstWindow
private

The event of the closing the first receive window.

This Event will be canceled if there's a successful reception of a packet.

Definition at line 177 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), GetNextClassTransmissionDelay(), and OpenFirstReceiveWindow().

◆ m_closeSecondWindow

EventId ns3::lorawan::ClassAEndDeviceLorawanMac::m_closeSecondWindow
private

The event of the closing the second receive window.

This Event will be canceled if there's a successful reception of a packet.

Definition at line 184 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), GetNextClassTransmissionDelay(), and OpenSecondReceiveWindow().

◆ m_receiveDelay1

Time ns3::lorawan::ClassAEndDeviceLorawanMac::m_receiveDelay1
private

The interval between when a packet is done sending and when the first receive window is opened.

Definition at line 163 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), and TxFinished().

◆ m_receiveDelay2

Time ns3::lorawan::ClassAEndDeviceLorawanMac::m_receiveDelay2
private

The interval between when a packet is done sending and when the second receive window is opened.

Definition at line 170 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), and TxFinished().

◆ m_rx1DrOffset

uint8_t ns3::lorawan::ClassAEndDeviceLorawanMac::m_rx1DrOffset
private

The RX1DROffset parameter value.

Definition at line 207 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), GetFirstReceiveWindowDataRate(), OnRxParamSetupReq(), and SendToPhy().

◆ m_secondReceiveWindow

EventId ns3::lorawan::ClassAEndDeviceLorawanMac::m_secondReceiveWindow
private

The event of the second receive window opening.

This Event is used to cancel the second window in case the first one is successful.

Definition at line 192 of file class-a-end-device-lorawan-mac.h.

Referenced by ClassAEndDeviceLorawanMac(), FailedReception(), GetNextClassTransmissionDelay(), Receive(), and TxFinished().

◆ m_secondReceiveWindowDataRate

uint8_t ns3::lorawan::ClassAEndDeviceLorawanMac::m_secondReceiveWindowDataRate
private

The data rate to listen for during the second downlink transmission.

Definition at line 202 of file class-a-end-device-lorawan-mac.h.

Referenced by GetSecondReceiveWindowDataRate(), OnRxParamSetupReq(), OpenSecondReceiveWindow(), and SetSecondReceiveWindowDataRate().

◆ m_secondReceiveWindowFrequencyHz

uint32_t ns3::lorawan::ClassAEndDeviceLorawanMac::m_secondReceiveWindowFrequencyHz
private

The frequency [Hz] to listen on for the second receive window.

Definition at line 197 of file class-a-end-device-lorawan-mac.h.

Referenced by GetSecondReceiveWindowFrequency(), OnRxParamSetupReq(), OpenSecondReceiveWindow(), and SetSecondReceiveWindowFrequency().


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