30 NS_LOG_COMPONENT_DEFINE(
"LoraNetworkControllerComponent");
32 NS_OBJECT_ENSURE_REGISTERED(LoraNetworkControllerComponent);
37 static TypeId tid = TypeId(
"ns3::LoraNetworkControllerComponent").SetParent<Object>();
56 static TypeId tid = TypeId(
"ns3::LoraConfirmedMessagesComponent")
58 .AddConstructor<LoraConfirmedMessagesComponent>();
72 Ptr<LoraEndDeviceStatus> status,
73 Ptr<LoraNetworkStatus> networkStatus)
75 NS_LOG_FUNCTION(this->
GetTypeId() << packet << networkStatus);
81 Ptr<Packet> myPacket = packet->Copy();
82 myPacket->RemoveHeader(mHdr);
83 myPacket->RemoveHeader(fHdr);
85 NS_LOG_INFO(
"Received packet Mac Header: " << mHdr);
86 NS_LOG_INFO(
"Received packet Frame Header: " << fHdr);
90 NS_LOG_INFO(
"Packet requires confirmation");
93 status->m_reply.frameHeader.SetAsDownlink();
94 status->m_reply.frameHeader.SetAck(
true);
95 status->m_reply.frameHeader.SetAddress(fHdr.
GetAddress());
97 status->m_reply.needsReply =
true;
111 Ptr<LoraNetworkStatus> networkStatus)
113 NS_LOG_FUNCTION(
this << status << networkStatus);
119 Ptr<LoraNetworkStatus> networkStatus)
121 NS_LOG_FUNCTION(
this << networkStatus);
124 status->m_reply.frameHeader.SetAck(
false);
133 static TypeId tid = TypeId(
"ns3::LoraLinkCheckComponent")
135 .AddConstructor<LoraLinkCheckComponent>();
149 Ptr<LoraEndDeviceStatus> status,
150 Ptr<LoraNetworkStatus> networkStatus)
152 NS_LOG_FUNCTION(this->
GetTypeId() << packet << networkStatus);
160 Ptr<LoraNetworkStatus> networkStatus)
162 NS_LOG_FUNCTION(
this << status << networkStatus);
164 Ptr<Packet> myPacket = status->GetLastPacketReceivedFromDevice()->Copy();
168 myPacket->RemoveHeader(mHdr);
169 myPacket->RemoveHeader(fHdr);
176 status->m_reply.needsReply =
true;
180 uint8_t gwCount = status->GetLastReceivedPacketInfo().gwList.size();
182 Ptr<LinkCheckAns> replyCommand = Create<LinkCheckAns>();
183 replyCommand->SetGwCnt(gwCount);
184 status->m_reply.frameHeader.SetAsDownlink();
185 status->m_reply.frameHeader.AddCommand(replyCommand);
196 Ptr<LoraNetworkStatus> networkStatus)
198 NS_LOG_FUNCTION(this->
GetTypeId() << networkStatus);
Implementation of the LinkCheckReq LoRaWAN MAC command.
void OnFailedReply(Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
Method that is called when a packet cannot be sent in the downlink.
void BeforeSendingReply(Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
static TypeId GetTypeId(void)
LoraConfirmedMessagesComponent()
void OnReceivedPacket(Ptr< const Packet > packet, Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
This method checks whether the received packet requires an acknowledgment and sets up the appropriate...
virtual ~LoraConfirmedMessagesComponent()
virtual ~LoraLinkCheckComponent()
void OnReceivedPacket(Ptr< const Packet > packet, Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
This method checks whether the received packet requires an acknowledgment and sets up the appropriate...
static TypeId GetTypeId(void)
void OnFailedReply(Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
Method that is called when a packet cannot be sent in the downlink.
void BeforeSendingReply(Ptr< LoraEndDeviceStatus > status, Ptr< LoraNetworkStatus > networkStatus)
Generic class describing a component of the NetworkController.
static TypeId GetTypeId(void)
virtual ~LoraNetworkControllerComponent()
LoraNetworkControllerComponent()
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.