9#ifndef GATEWAY_LORA_PHY_H
10#define GATEWAY_LORA_PHY_H
14#include "ns3/mobility-model.h"
15#include "ns3/net-device.h"
17#include "ns3/nstime.h"
18#include "ns3/object.h"
19#include "ns3/traced-value.h"
58 double frequencyMHz)
override = 0;
65 double txPowerDbm)
override = 0;
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
Trace classes with value semantics.
a unique identifier for an interface.
This class represents a configurable reception path.
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.
void AddFrequency(double frequencyMHz)
Add a frequency to the list of frequencies we are listening to.
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.
std::list< double > m_frequencies
List of frequencies the GatewayLoraPhy is listening to.
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(double frequencyMHz) override
Check whether the GatewayLoraPhy is currently listening to the specified frequency.
~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.
void StartReceive(Ptr< Packet > packet, double rxPowerDbm, uint8_t sf, Time duration, double frequencyMHz) override=0
Start receiving a packet.
void EndReceive(Ptr< Packet > packet, Ptr< LoraInterferenceHelper::Event > event) override=0
Finish reception of a packet.
std::list< Ptr< ReceptionPath > > m_receptionPaths
A list containing the various parallel receivers that are managed by this gateway.
void Send(Ptr< Packet > packet, LoraTxParameters txParams, double frequencyMHz, double txPowerDbm) override=0
Instruct the PHY to send a packet according to some parameters.
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.
Base class for PHY layers implementing the LoRa modulation scheme.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Structure to collect all parameters that are used to compute the duration of a packet (excluding payl...