13#include "ns3/double.h"
14#include "ns3/forwarder.h"
16#include "ns3/lora-net-device.h"
17#include "ns3/random-variable-stream.h"
18#include "ns3/simulator.h"
19#include "ns3/string.h"
20#include "ns3/trace-source-accessor.h"
54 for (
auto i = c.
Begin(); i != c.
End(); ++i)
67 "NDevices != 2, the node must have a LoraNetDevice and a PointToPointNetDevice");
72 node->AddApplication(app);
75 for (
uint32_t i = 0; i < node->GetNDevices(); i++)
80 app->SetLoraNetDevice(loraNetDev);
85 app->SetPointToPointNetDevice(p2pNetDev);
90 NS_LOG_ERROR(
"Potential error: NetDevice is neither Lora nor PointToPoint");
holds a vector of ns3::Application pointers.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container.
Hold a value for an Attribute.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Smart pointer class similar to boost::intrusive_ptr.
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
ObjectFactory m_factory
The object factory.
ApplicationContainer Install(NodeContainer c) const
Install a Forwarder application on each node of the input container configured with all the attribute...
ForwarderHelper()
Default constructor.
~ForwarderHelper()
Destructor.
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install a Forwarder application on the input Node configured with all the attributes set with SetAttr...
This application forwards packets between NetDevices: LoraNetDevice -> PointToPointNetDevice and vice...
bool ReceiveFromPointToPoint(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the PointToPointNetDevice.
bool ReceiveFromLora(Ptr< NetDevice > loraNetDevice, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the LoraNetDevice.
#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_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_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.