25 #include <ns3/double.h>
27 #include <ns3/lora-forwarder.h>
28 #include <ns3/random-variable-stream.h>
29 #include <ns3/simulator.h>
30 #include <ns3/string.h>
31 #include <ns3/trace-source-accessor.h>
33 NS_LOG_COMPONENT_DEFINE(
"LoraForwarderHelper");
38 NS_OBJECT_ENSURE_REGISTERED(LoraForwarderHelper);
43 static TypeId tid = TypeId(
"ns3::LoraForwarderHelper")
45 .AddConstructor<LoraForwarderHelper>();
51 m_factory.SetTypeId(
"ns3::LoraForwarder");
73 ApplicationContainer apps;
74 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i)
85 NS_LOG_FUNCTION(
this << node);
90 node->AddApplication(app);
93 for (uint32_t i = 0; i < node->GetNDevices(); i++)
95 Ptr<NetDevice> currentNetDevice = node->GetDevice(i);
98 Ptr<SatLorawanNetDevice> loraNetDevice =
100 uint8_t beamId = loraNetDevice->
GetLorawanMac()->GetBeamId();
101 app->SetLoraNetDevice(beamId, loraNetDevice);
102 loraNetDevice->SetReceiveNetworkServerCallback(
105 else if (currentNetDevice->GetObject<PointToPointNetDevice>() !=
nullptr)
107 Ptr<PointToPointNetDevice> pointToPointNetDevice =
108 currentNetDevice->GetObject<PointToPointNetDevice>();
109 app->SetPointToPointNetDevice(pointToPointNetDevice);
110 pointToPointNetDevice->SetReceiveCallback(
void SetAttribute(std::string name, const AttributeValue &value)
ApplicationContainer Install(NodeContainer c) const
static TypeId GetTypeId(void)
Get the type ID.
Ptr< Application > InstallPriv(Ptr< Node > node) const
This application forwards packets between NetDevices: SatLorawanNetDevice -> PointToPointNetDevice an...
bool ReceiveFromLora(Ptr< SatLorawanNetDevice > loraNetDevice, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the LoraNetDevice.
bool ReceiveFromPointToPoint(Ptr< NetDevice > pointToPointNetDevice, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the PointToPointNetDevice.
SatLorawanNetDevice to be utilized in the UT and GW nodes for IoT configuration.
Ptr< LorawanMac > GetLorawanMac()
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.