73 NS_LOG_INFO(
"LoraFrameHeader serialized size: " << size);
91 fCtrl |= uint8_t(
m_adr << 7 & 0b10000000);
93 fCtrl |= uint8_t(
m_ack << 5 & 0b100000);
105 (*it)->Serialize(start);
133 uint8_t fCtrl = start.ReadU8();
134 m_adr = (fCtrl >> 7) & 0b1;
136 m_ack = (fCtrl >> 5) & 0b1;
151 NS_LOG_DEBUG(
"Starting deserialization of MAC commands");
152 for (uint8_t byteNumber = 0; byteNumber <
m_fOptsLen;)
154 uint8_t cid = start.PeekU8();
170 byteNumber += command->Deserialize(start);
177 byteNumber += command->Deserialize(start);
184 byteNumber += command->Deserialize(start);
191 byteNumber += command->Deserialize(start);
198 byteNumber += command->Deserialize(start);
205 byteNumber += command->Deserialize(start);
212 byteNumber += command->Deserialize(start);
219 byteNumber += command->Deserialize(start);
226 byteNumber += command->Deserialize(start);
231 NS_LOG_ERROR(
"CID not recognized during deserialization");
244 byteNumber += command->Deserialize(start);
251 byteNumber += command->Deserialize(start);
258 byteNumber += command->Deserialize(start);
265 byteNumber += command->Deserialize(start);
272 byteNumber += command->Deserialize(start);
279 byteNumber += command->Deserialize(start);
286 byteNumber += command->Deserialize(start);
293 byteNumber += command->Deserialize(start);
298 NS_LOG_ERROR(
"CID not recognized during deserialization");
304 m_fPort = uint8_t(start.ReadU8());
315 os <<
"ADR=" <<
m_adr << std::endl;
317 os <<
"ACK=" <<
m_ack << std::endl;
319 os <<
"FOptsLen=" << unsigned(
m_fOptsLen) << std::endl;
320 os <<
"FCnt=" << unsigned(
m_fCnt) << std::endl;
327 os <<
"FPort=" << unsigned(
m_fPort) << std::endl;
424 uint8_t fOptsLen = 0;
425 std::list<Ptr<MacCommand>>::const_iterator it;
428 fOptsLen = fOptsLen + (*it)->GetSerializedSize();
453 NS_LOG_DEBUG(
"Command SerializedSize: " <<
unsigned(command->GetSerializedSize()));
471 std::list<int> enabledChannels,
476 uint16_t channelMask = 0;
477 for (
auto it = enabledChannels.begin(); it != enabledChannels.end(); it++)
481 channelMask |= 0b1 << (*it);
486 NS_LOG_DEBUG(
"Creating LinkAdrReq with: DR = " <<
unsigned(dataRate)
487 <<
" and txPower = " <<
unsigned(txPower));
489 Ptr<LinkAdrReq> command = Create<LinkAdrReq>(dataRate, txPower, channelMask, 0, repetitions);
500 Ptr<LinkAdrAns> command = Create<LinkAdrAns>(powerAck, dataRateAck, channelMaskAck);
533 NS_LOG_FUNCTION(
this <<
unsigned(rx1DrOffset) <<
unsigned(rx2DataRate) << frequency);
536 NS_ASSERT(0 <= rx1DrOffset && rx1DrOffset <= 5);
578 Create<NewChannelReq>(chIndex, frequency, minDataRate, maxDataRate);
585std::list<Ptr<MacCommand>>
599 m_fOptsLen += macCommand->GetSerializedSize();
iterator in a Buffer instance
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class represents the device address of a LoraWAN end device.
uint32_t Get() const
Get the address in 32-bit integer form.
void Set(uint32_t address)
Set the address as a 32 bit integer.
std::string Print() const
Print the address bit-by-bit to a human-readable string.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Every class exported by the ns3 library is enclosed in the ns3 namespace.