13#include "ns3/log-macros-enabled.h"
15#include "ns3/simulator.h"
95 TypeId(
"ns3::GatewayLoraPhy")
97 .SetGroupName(
"lorawan")
99 "NoReceptionBecauseTransmitting",
100 "Trace source indicating a packet "
101 "could not be correctly received because"
102 "the gateway is in transmission mode",
104 "ns3::Packet::TracedCallback")
105 .AddTraceSource(
"LostPacketBecauseNoMoreReceivers",
106 "Trace source indicating a packet "
107 "could not be correctly received because"
108 "there are no more demodulators available",
110 "ns3::Packet::TracedCallback")
111 .AddTraceSource(
"OccupiedReceptionPaths",
112 "Number of currently occupied reception paths",
114 "ns3::TracedValueCallback::Int");
179 if (f == frequencyHz)
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
EventId GetEndReceive()
Get the EventId of the EndReceive call associated to this ReceptionPath's packet.
Ptr< LoraInterferenceHelper::Event > m_event
The event this reception path is currently locked on.
~ReceptionPath()
Destructor.
void SetEvent(Ptr< LoraInterferenceHelper::Event > event)
Set the event this reception path is currently on.
Ptr< LoraInterferenceHelper::Event > GetEvent()
Get the event this reception path is currently on.
EventId m_endReceiveEventId
The EventId associated of the call to EndReceive that is scheduled to happen when the packet this Rec...
bool m_available
Whether this reception path is available to lock on a signal or not.
void Free()
Set this reception path as available.
void SetEndReceive(EventId endReceiveEventId)
Set the EventId of the EndReceive call associated to this ReceptionPath's packet.
ReceptionPath()
Constructor.
void LockOnEvent(Ptr< LoraInterferenceHelper::Event > event)
Set this reception path as not available and lock it on the provided event.
bool IsAvailable() const
Query whether this reception path is available to lock on a signal.
Class modeling a Lora SX1301 chip.
GatewayLoraPhy()
Default constructor.
bool m_isTransmitting
Flag indicating whether a transmission is going on.
TracedValue< int > m_occupiedReceptionPaths
The number of occupied reception paths.
bool IsTransmitting() override
Whether this device is transmitting or not.
static const double sensitivity[6]
A vector containing the sensitivities required to correctly decode different spreading factors.
TracedCallback< Ptr< const Packet >, uint32_t > m_noReceptionBecauseTransmitting
Trace source fired when a packet cannot be received because the gateway is in transmission state.
bool IsOnFrequency(uint32_t frequencyHz) override
Check whether the GatewayLoraPhy is currently listening to the specified frequency.
void AddFrequency(uint32_t frequencyHz)
Add a frequency to the list of frequencies we are listening to.
~GatewayLoraPhy() override
Destructor.
void ResetReceptionPaths()
Reset the list of reception paths.
static TypeId GetTypeId()
Register this type.
void TxFinished(Ptr< const Packet > packet) override
Signals the end of a transmission by the GatewayLoraPhy.
std::list< Ptr< ReceptionPath > > m_receptionPaths
A list containing the various parallel receivers that are managed by this gateway.
std::list< uint32_t > m_frequenciesHz
List of frequencies [Hz] the GatewayLoraPhy is listening to.
TracedCallback< Ptr< const Packet >, uint32_t > m_noMoreDemodulators
Trace source fired when a packet cannot be received because all available ReceivePath instances are b...
void AddReceptionPath()
Add a reception path, locked on a specific frequency.
LoraPhy()
Default constructor.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.