125 os <<
"LinkCheckReq()";
171 os <<
"LinkCheckAns(";
172 os <<
"Margin=" << unsigned(
m_margin);
173 os <<
", GwCnt=" << unsigned(
m_gwCnt);
215 NS_ASSERT_MSG(!(dataRate & 0xF0),
"dataRate field > 4 bits");
217 NS_ASSERT_MSG(!(chMaskCntl & 0xF8),
"chMaskCntl field > 3 bits");
238 uint8_t firstByte = start.ReadU8();
242 uint8_t fourthByte = start.ReadU8();
254 os <<
", TXPower=" << unsigned(
m_txPower);
255 os <<
", ChMask=" << std::bitset<16>(
m_chMask);
257 os <<
", NbTrans=" << unsigned(
m_nbTrans);
331 uint8_t
byte = start.ReadU8();
384 NS_ASSERT_MSG(!(maxDutyCycle & 0xF0),
"maxDutyCycle > 4 bits");
411 os <<
"DutyCycleReq(";
453 os <<
"DutyCycleAns()";
472 NS_LOG_FUNCTION(
this <<
unsigned(rx1DrOffset) <<
unsigned(rx2DataRate) << frequencyHz);
473 NS_ASSERT_MSG(!(rx1DrOffset & 0xF8),
"rx1DrOffset > 3 bits");
474 NS_ASSERT_MSG(!(rx2DataRate & 0xF0),
"rx2DataRate > 4 bits");
487 start.WriteU8(encodedFrequency);
488 start.WriteU8(encodedFrequency >> 8);
489 start.WriteU8(encodedFrequency >> 16);
497 uint8_t firstByte = start.ReadU8();
502 encodedFrequency += start.ReadU8();
503 encodedFrequency += start.ReadU8() << 8;
504 encodedFrequency += start.ReadU8() << 16;
513 os <<
"RxParamSetupReq(";
557 NS_LOG_FUNCTION(
this << rx1DrOffsetAck << rx2DataRateAck << channelAck);
576 uint8_t
byte = start.ReadU8();
587 os <<
"RxParamSetupAns(";
645 os <<
"DevStatusReq()";
692 os <<
"DevStatusAns(";
694 os <<
", Margin=" << unsigned(
m_margin);
733 NS_ASSERT_MSG(!(minDataRate & 0xF0),
"minDataRate > 4 bits");
734 NS_ASSERT_MSG(!(maxDataRate & 0xF0),
"maxDataRate > 4 bits");
747 start.WriteU8(encodedFrequency);
748 start.WriteU8(encodedFrequency >> 8);
749 start.WriteU8(encodedFrequency >> 16);
761 encodedFrequency += start.ReadU8();
762 encodedFrequency += start.ReadU8() << 8;
763 encodedFrequency += start.ReadU8() << 16;
765 uint8_t dataRateByte = start.ReadU8();
775 os <<
"NewChannelReq(";
844 uint8_t
byte = start.ReadU8();
854 os <<
"NewChannelAns(";
907 m_delay = start.ReadU8() & 0xF;
915 os <<
"RxTimingSetupReq()";
955 os <<
"RxTimingSetupAns()";
988 os <<
"DlChannelAns()";
1021 os <<
"TxParamSetupReq()";
1054 os <<
"TxParamSetupAns()";
iterator in a Buffer instance
Simulation virtual time values and global simulation resolution.
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.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
DevStatusReq()
Default constructor.
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.
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.
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.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
DutyCycleReq()
Default constructor.
uint8_t GetMaxDutyCycle() const
Get the maximum duty cycle prescribed by this Mac command, encoded in 4 bits.
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 m_maxDutyCycle
The MaxDutyCycle field.
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 GetChannelMaskAck() const
Get the ChannelMaskAck field value of the LinkAdrAns command.
bool m_powerAck
The PowerACK field.
bool GetPowerAck() const
Get the PowerAck field value of the LinkAdrAns command.
uint8_t Deserialize(Buffer::Iterator &start) override
Deserialize the buffer into a MAC command.
bool GetDataRateAck() const
Get the DataRateAck field value of the LinkAdrAns 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.
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...
uint8_t GetNbTrans() const
Get the number of repeated transmissions prescribed by this MAC command.
void Print(std::ostream &os) const override
Print the contents of this MAC command in human-readable format.
uint8_t m_nbTrans
The NbTrans field.
LinkAdrReq()
Default constructor.
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.
uint16_t GetChMask() const
Get the 16 bit mask of enabled channels.
uint16_t m_chMask
The ChMask field.
uint8_t m_txPower
The TXPower field, a serializable parameter for setting the transmission power of end devices.
uint8_t GetTxPower() const
Get the transmission power prescribed by this MAC command.
uint8_t GetChMaskCntl() const
Get the ChMaskCntl field, used as an indicator of the 16-channel bank to apply the ChMask to.
uint8_t GetDataRate() const
Return the data rate prescribed by this MAC command.
uint8_t GetGwCnt() const
Get the gateway count value.
LinkCheckAns()
Default constructor.
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.
uint8_t GetMargin() const
Get the demodulation margin value.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
LinkCheckReq()
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.
virtual enum MacCommandType GetCommandType() const
Get the commandType of this MAC command.
virtual uint8_t GetSerializedSize() const
Get serialized length of this MAC command.
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.
MacCommand()
Default constructor.
virtual ~MacCommand()
Destructor.
bool GetDataRateRangeOk() const
Get the DataRateRangOk field of the NewChannelAns 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.
bool GetChannelFrequencyOk() const
Get the ChannelFrequencyOk field of the NewChannelAns command.
uint8_t GetMinDataRate() const
Get the the MinDR field contained in this MAC command.
NewChannelReq()
Default constructor.
uint8_t GetMaxDataRate() const
Get the the MaxDR field contained in this MAC command.
uint8_t m_maxDataRate
The MaxDR field.
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.
uint32_t GetFrequency() const
Get the the Frequency field contained in this MAC command.
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.
uint32_t m_frequencyHz
The Frequency field, in Hz.
RxParamSetupAns()
Default constructor.
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.
bool GetRx1DrOffsetAck() const
Get the Rx1DrOffsetAck field value of the RxParamSetupAns command.
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 GetRx2DataRateAck() const
Get the Rx2DataRateAck field value of the RxParamSetupAns command.
bool m_rx1DrOffsetAck
The RX1DROffsetACK field.
bool GetChannelAck() const
Get the ChannelAck field value of the RxParamSetupAns 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.
uint32_t m_frequencyHz
The Frequency field, in Hz
uint8_t m_rx1DrOffset
The RX1DROffset field.
uint32_t GetFrequency()
Get this command's frequency.
RxParamSetupReq()
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.
void Serialize(Buffer::Iterator &start) const override
Serialize the contents of this MAC command into a buffer, according to the LoRaWAN standard.
RxTimingSetupAns()
Default constructor.
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.
RxTimingSetupReq()
Default constructor.
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 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.
TxParamSetupReq()
Default constructor.
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.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Time Seconds(double value)
Construct a Time in the indicated unit.
MacCommandType
Enum for every possible command type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.