135 os <<
"LinkCheckReq()";
181 os <<
"LinkCheckAns(";
182 os <<
"Margin=" << unsigned(
m_margin);
183 os <<
", GwCnt=" << unsigned(
m_gwCnt);
218 : m_dataRate(dataRate),
221 m_chMaskCntl(chMaskCntl),
225 NS_ASSERT_MSG(!(dataRate & 0xF0),
"dataRate field > 4 bits");
227 NS_ASSERT_MSG(!(chMaskCntl & 0xF8),
"chMaskCntl field > 3 bits");
248 uint8_t firstByte = start.ReadU8();
252 uint8_t fourthByte = start.ReadU8();
264 os <<
", TXPower=" << unsigned(
m_txPower);
265 os <<
", ChMask=" << std::bitset<16>(
m_chMask);
267 os <<
", NbTrans=" << unsigned(
m_nbTrans);
318 : m_powerAck(powerAck),
319 m_dataRateAck(dataRateAck),
320 m_channelMaskAck(channelMaskAck)
341 uint8_t
byte = start.ReadU8();
394 NS_ASSERT_MSG(!(maxDutyCycle & 0xF0),
"maxDutyCycle > 4 bits");
421 os <<
"DutyCycleReq(";
463 os <<
"DutyCycleAns()";
478 : m_rx1DrOffset(rx1DrOffset),
479 m_rx2DataRate(rx2DataRate),
480 m_frequencyHz(frequencyHz)
482 NS_LOG_FUNCTION(
this <<
unsigned(rx1DrOffset) <<
unsigned(rx2DataRate) << frequencyHz);
483 NS_ASSERT_MSG(!(rx1DrOffset & 0xF8),
"rx1DrOffset > 3 bits");
484 NS_ASSERT_MSG(!(rx2DataRate & 0xF0),
"rx2DataRate > 4 bits");
497 start.WriteU8(encodedFrequency);
498 start.WriteU8(encodedFrequency >> 8);
499 start.WriteU8(encodedFrequency >> 16);
507 uint8_t firstByte = start.ReadU8();
512 encodedFrequency += start.ReadU8();
513 encodedFrequency += start.ReadU8() << 8;
514 encodedFrequency += start.ReadU8() << 16;
523 os <<
"RxParamSetupReq(";
563 : m_rx1DrOffsetAck(rx1DrOffsetAck),
564 m_rx2DataRateAck(rx2DataRateAck),
565 m_channelAck(channelAck)
567 NS_LOG_FUNCTION(
this << rx1DrOffsetAck << rx2DataRateAck << channelAck);
586 uint8_t
byte = start.ReadU8();
597 os <<
"RxParamSetupAns(";
655 os <<
"DevStatusReq()";
670 : m_battery(battery),
702 os <<
"DevStatusAns(";
704 os <<
", Margin=" << unsigned(
m_margin);
737 : m_chIndex(chIndex),
738 m_frequencyHz(frequencyHz),
739 m_minDataRate(minDataRate),
740 m_maxDataRate(maxDataRate)
743 NS_ASSERT_MSG(!(minDataRate & 0xF0),
"minDataRate > 4 bits");
744 NS_ASSERT_MSG(!(maxDataRate & 0xF0),
"maxDataRate > 4 bits");
757 start.WriteU8(encodedFrequency);
758 start.WriteU8(encodedFrequency >> 8);
759 start.WriteU8(encodedFrequency >> 16);
771 encodedFrequency += start.ReadU8();
772 encodedFrequency += start.ReadU8() << 8;
773 encodedFrequency += start.ReadU8() << 16;
775 uint8_t dataRateByte = start.ReadU8();
785 os <<
"NewChannelReq(";
833 : m_dataRateRangeOk(dataRateRangeOk),
834 m_channelFrequencyOk(channelFrequencyOk)
854 uint8_t
byte = start.ReadU8();
864 os <<
"NewChannelAns(";
917 m_delay = start.ReadU8() & 0xF;
925 os <<
"RxTimingSetupReq()";
965 os <<
"RxTimingSetupAns()";
998 os <<
"DlChannelAns()";
1031 os <<
"TxParamSetupReq()";
1064 os <<
"TxParamSetupAns()";
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.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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.
static TypeId GetTypeId()
Register this type.
~MacCommand() override
Destructor.
MacCommand()
Default constructor.
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 ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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.