28 NS_LOG_COMPONENT_DEFINE(
"LoraNetworkControllerComponent");
30 NS_OBJECT_ENSURE_REGISTERED(LoraNetworkControllerComponent);
35 static TypeId tid = TypeId(
"ns3::LoraNetworkControllerComponent").SetParent<Object>();
54 static TypeId tid = TypeId(
"ns3::LoraConfirmedMessagesComponent")
56 .AddConstructor<LoraConfirmedMessagesComponent>();
70 Ptr<LoraEndDeviceStatus> status,
71 Ptr<LoraNetworkStatus> networkStatus)
73 NS_LOG_FUNCTION(this->
GetTypeId() << packet << networkStatus);
79 Ptr<Packet> myPacket = packet->Copy();
80 myPacket->RemoveHeader(mHdr);
81 myPacket->RemoveHeader(fHdr);
83 NS_LOG_INFO(
"Received packet Mac Header: " << mHdr);
84 NS_LOG_INFO(
"Received packet Frame Header: " << fHdr);
88 NS_LOG_INFO(
"Packet requires confirmation");
91 status->m_reply.frameHeader.SetAsDownlink();
92 status->m_reply.frameHeader.SetAck(
true);
93 status->m_reply.frameHeader.SetAddress(fHdr.
GetAddress());
95 status->m_reply.needsReply =
true;
109 Ptr<LoraNetworkStatus> networkStatus)
111 NS_LOG_FUNCTION(
this << status << networkStatus);
117 Ptr<LoraNetworkStatus> networkStatus)
119 NS_LOG_FUNCTION(
this << networkStatus);
122 status->m_reply.frameHeader.SetAck(
false);
131 static TypeId tid = TypeId(
"ns3::LoraLinkCheckComponent")
133 .AddConstructor<LoraLinkCheckComponent>();
147 Ptr<LoraEndDeviceStatus> status,
148 Ptr<LoraNetworkStatus> networkStatus)
150 NS_LOG_FUNCTION(this->
GetTypeId() << packet << networkStatus);
158 Ptr<LoraNetworkStatus> networkStatus)
160 NS_LOG_FUNCTION(
this << status << networkStatus);
162 Ptr<Packet> myPacket = status->GetLastPacketReceivedFromDevice()->Copy();
166 myPacket->RemoveHeader(mHdr);
167 myPacket->RemoveHeader(fHdr);
174 status->m_reply.needsReply =
true;
178 uint8_t gwCount = status->GetLastReceivedPacketInfo().gwList.size();
180 Ptr<LinkCheckAns> replyCommand = Create<LinkCheckAns>();
181 replyCommand->SetGwCnt(gwCount);
182 status->m_reply.frameHeader.SetAsDownlink();
183 status->m_reply.frameHeader.AddCommand(replyCommand);
194 Ptr<LoraNetworkStatus> networkStatus)
196 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.