12#include "ns3/buffer.h"
13#include "ns3/nstime.h"
14#include "ns3/object.h"
89 virtual void Print(std::ostream& os)
const = 0;
132 void Print(std::ostream& os)
const override;
158 void Print(std::ostream& os)
const override;
228 uint16_t channelMask,
234 void Print(std::ostream& os)
const override;
298 LinkAdrAns(
bool powerAck,
bool dataRateAck,
bool channelMaskAck);
302 void Print(std::ostream& os)
const override;
332 void Print(std::ostream& os)
const override;
359 void Print(std::ostream& os)
const override;
382 RxParamSetupReq(uint8_t rx1DrOffset, uint8_t rx2DataRate,
double frequency);
386 void Print(std::ostream& os)
const override;
431 RxParamSetupAns(
bool rx1DrOffsetAck,
bool rx2DataRateAck,
bool channelAck);
435 void Print(std::ostream& os)
const override;
455 void Print(std::ostream& os)
const override;
478 void Print(std::ostream& os)
const override;
520 NewChannelReq(uint8_t chIndex,
double frequency, uint8_t minDataRate, uint8_t maxDataRate);
524 void Print(std::ostream& os)
const override;
576 NewChannelAns(
bool dataRateRangeOk,
bool channelFrequencyOk);
580 void Print(std::ostream& os)
const override;
606 void Print(std::ostream& os)
const override;
633 void Print(std::ostream& os)
const override;
650 void Print(std::ostream& os)
const override;
667 void Print(std::ostream& os)
const override;
684 void Print(std::ostream& os)
const override;
iterator in a Buffer instance
A base class which provides memory management and object aggregation.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Implementation of the DevStatusAns LoRaWAN MAC command.
uint8_t GetMargin() const
Get the demodulation margin contained in this MAC command.
DevStatusAns()
Default constructor.
uint8_t m_battery
The Battery field.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t GetBattery() const
Get the battery information contained in this MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
uint8_t m_margin
The RadioStatus field.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
Implementation of the DevStatusReq LoRaWAN MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
Implementation of the DlChannelAns LoRaWAN MAC command.
DlChannelAns()
Default constructor.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
Implementation of the DutyCycleAns LoRaWAN MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
DutyCycleAns()
Default constructor.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
Implementation of the DutyCycleReq LoRaWAN MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
double GetMaximumAllowedDutyCycle() const
Get the maximum duty cycle prescribed by this Mac command, in fraction form.
uint8_t m_maxDCycle
The MaxDutyCycle field.
Implementation of the LinkAdrAns LoRaWAN MAC command.
LinkAdrAns()
Default constructor.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
bool m_channelMaskAck
The ChannelMaskACK field.
bool m_powerAck
The PowerACK field.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
bool m_dataRateAck
The DataRateACK field.
Implementation of the LinkAdrReq LoRaWAN MAC command.
uint8_t m_nbRep
The NbTrans field.
std::list< int > GetEnabledChannelsList()
Get the list of enabled channels.
uint8_t m_chMaskCntl
The ChMaskCntl field.
uint8_t m_dataRate
The DataRate field, a serializable parameter for setting the spreading factor and bandwidth of end de...
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t GetDataRate()
Return the data rate prescribed by this MAC command.
int GetRepetitions()
Get the number of repetitions prescribed by this MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
uint16_t m_channelMask
The ChMask field.
uint8_t GetTxPower()
Get the transmission power prescribed by this MAC command.
uint8_t m_txPower
The TXPower field, a serializable parameter for setting the transmission power of end devices.
Implementation of the LinkCheckAns LoRaWAN MAC command.
uint8_t GetGwCnt() const
Get the gateway count value.
LinkCheckAns()
Default constructor.
void IncrementGwCnt()
Increment this MacCommand's gwCnt value.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t m_gwCnt
This MAC command's gateway count value.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t m_margin
This MAC command's demodulation margin value.
void SetMargin(uint8_t margin)
Set the demodulation margin value.
void SetGwCnt(uint8_t gwCnt)
Set the gateway count value.
uint8_t GetMargin() const
Get the demodulation margin value.
Implementation of the LinkCheckReq LoRaWAN MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
~LinkCheckReq() override
Destructor.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
This base class is used to represent a general MAC command.
virtual enum MacCommandType GetCommandType() const
Get the commandType of this MAC command.
virtual void Serialize(Buffer::Iterator &start) const =0
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
virtual uint8_t GetSerializedSize() const
Get serialized length of this MAC command.
virtual void Print(std::ostream &os) const =0
Print the contents of this MAC command in human-readable format.
uint8_t m_serializedSize
This MAC command's serialized size.
enum MacCommandType m_commandType
The type of this command.
static uint8_t GetCIDFromMacCommand(enum MacCommandType commandType)
Get the CID that corresponds to a type of MAC command.
static TypeId GetTypeId()
Register this type.
~MacCommand() override
Destructor.
MacCommand()
Default constructor.
virtual uint8_t Deserialize(Buffer::Iterator &start)=0
Deserialize the buffer into a MAC command.
Implementation of the NewChannelAns LoRaWAN MAC command.
bool m_channelFrequencyOk
The Channel frequency ok field.
NewChannelAns()
Default constructor.
bool m_dataRateRangeOk
The Data-rate range ok field.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
Implementation of the NewChannelReq LoRaWAN MAC command.
double m_frequency
The Frequency field, in Hz.
uint8_t GetMinDataRate() const
Get the the MinDR field contained in this MAC command.
uint8_t GetMaxDataRate() const
Get the the MaxDR field contained in this MAC command.
uint8_t m_maxDataRate
The MaxDR field.
double GetFrequency() const
Get the the Frequency field contained in this MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
uint8_t m_minDataRate
The MinDR field.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t GetChannelIndex() const
Get the the ChIndex field contained in this MAC command.
uint8_t m_chIndex
The ChIndex field.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
Implementation of the RxParamSetupAns LoRaWAN MAC command.
bool m_rx2DataRateAck
The RX2DataRateACK field.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
bool m_channelAck
The ChannelACK field.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
bool m_rx1DrOffsetAck
The RX1DROffsetACK field.
Implementation of the RxParamSetupReq LoRaWAN MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t GetRx1DrOffset()
Get this command's Rx1DrOffset parameter.
uint8_t m_rx2DataRate
The RX2DataRate field.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t GetRx2DataRate()
Get this command's Rx2DataRate parameter.
double GetFrequency()
Get this command's frequency.
uint8_t m_rx1DrOffset
The RX1DROffset field.
double m_frequency
The Frequency field, in Hz
Implementation of the RxTimingSetupAns LoRaWAN MAC command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
Implementation of the RxTimingSetupReq LoRaWAN MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t m_delay
The Del field.
Time GetDelay()
Get the first window delay as a Time instance.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
Implementation of the TxParamSetupAns LoRaWAN MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
TxParamSetupAns()
Default constructor.
Implementation of the TxParamSetupReq LoRaWAN MAC command.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
MacCommandType
Enum for every possible command type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.