11#ifndef END_DEVICE_LORA_PHY_H
12#define END_DEVICE_LORA_PHY_H
16#include "ns3/mobility-model.h"
17#include "ns3/net-device.h"
19#include "ns3/nstime.h"
20#include "ns3/object.h"
21#include "ns3/traced-value.h"
149 double frequencyMHz)
override = 0;
158 double txPowerDbm)
override = 0;
273 typedef std::vector<EndDeviceLoraPhyListener*>
Listeners;
277 typedef std::vector<EndDeviceLoraPhyListener*>::iterator
ListenersI;
Smart pointer class similar to boost::intrusive_ptr.
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.
Class representing a LoRa transceiver.
bool IsOnFrequency(double frequencyMHz) override
Whether this device is listening on the specified frequency or not.
void SwitchToSleep()
Switch to the SLEEP state.
EndDeviceLoraPhy::State GetState()
Return the state this end device is currently in.
void Send(Ptr< Packet > packet, LoraTxParameters txParams, double frequencyMHz, double txPowerDbm) override=0
Instruct the PHY to send a packet according to some parameters.
void SetFrequency(double frequencyMHz)
Set the frequency this end device will listen on.
uint8_t GetSpreadingFactor() const
Get the Spreading Factor this end device is listening for.
static const double sensitivity[6]
The sensitivity vector of this device to different SFs.
std::vector< EndDeviceLoraPhyListener * >::iterator ListenersI
typedef for a list of EndDeviceLoraPhyListener iterator.
Listeners m_listeners
PHY listeners.
void RegisterListener(EndDeviceLoraPhyListener *listener)
Add the input listener to the list of objects to be notified of PHY-level events.
bool IsTransmitting() override
Whether this device is transmitting or not.
uint8_t m_sf
The Spreading Factor this device is listening for.
static TypeId GetTypeId()
Register this type.
void SwitchToRx()
Switch to the RX state.
void EndReceive(Ptr< Packet > packet, Ptr< LoraInterferenceHelper::Event > event) override=0
Finish reception of a packet.
std::vector< EndDeviceLoraPhyListener * > Listeners
typedef for a list of EndDeviceLoraPhyListener.
void SwitchToStandby()
Switch to the STANDBY state.
EndDeviceLoraPhy()
Default constructor.
~EndDeviceLoraPhy() override
Destructor.
void SetSpreadingFactor(uint8_t sf)
Set the Spreading Factor this end device will listen for.
TracedValue< State > m_state
The state this PHY is currently in.
TracedCallback< Ptr< const Packet >, uint32_t > m_wrongSf
Trace source for when a packet is lost because it was using a spreading factor different from the one...
void SwitchToTx(double txPowerDbm)
Switch to the TX state.
void UnregisterListener(EndDeviceLoraPhyListener *listener)
Remove the input listener from the list of objects to be notified of PHY-level events.
State
An enumeration of the possible states of an EndDeviceLoraPhy.
@ RX
The PHY layer is receiving a packet.
@ TX
The PHY layer is sending a packet.
@ SLEEP
The PHY layer is sleeping.
@ STANDBY
The PHY layer is in STANDBY.
void TxFinished(Ptr< const Packet > packet) override
Signals the end of a transmission by the EndDeviceLoraPhy.
double m_frequency
The frequency this device is listening on.
void StartReceive(Ptr< Packet > packet, double rxPowerDbm, uint8_t sf, Time duration, double frequencyMHz) override=0
Start receiving a packet.
TracedCallback< Ptr< const Packet >, uint32_t > m_wrongFrequency
Trace source for when a packet is lost because it was transmitted on a frequency different from the o...
Receive notifications about PHY events.
virtual ~EndDeviceLoraPhyListener()
Destructor.
virtual void NotifyStandby()=0
Notify listeners that we woke up.
virtual void NotifyTxStart(double txPowerDbm)=0
We are about to send the first bit of the packet.
virtual void NotifyRxStart()=0
We have received the first bit of a packet.
virtual void NotifySleep()=0
Notify listeners that we went to sleep.
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...