14#include "ns3/mobility-model.h"
15#include "ns3/net-device.h"
41std::ostream&
operator<<(std::ostream& os,
const IQPolarity& iqPolarity);
59std::ostream&
operator<<(std::ostream& os,
const CodingRate& codingRate);
64std::istream&
operator>>(std::istream& is, CodingRate& codingRate);
172 double txPowerDbm) = 0;
190 uint8_t spreadingFactor,
Object()
Caller graph was not generated because of its size.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
a unique identifier for an interface.
The class that delivers packets among PHY layers.
Helper for LoraPhy that manages interference calculations.
Ptr< LoraChannel > GetChannel() const
Get the channel instance associated to this PHY.
~LoraPhy() override
Destructor.
virtual bool IsOnFrequency(uint32_t frequencyHz) const =0
Whether this device is listening on the specified frequency or not.
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet reception ends.
LoraInterferenceHelper m_interference
The LoraInterferenceHelper associated to this PHY.
Callback< void, Ptr< const Packet > > RxFailedCallback
Type definition for a callback for when a packet reception fails.
void SetReceiveOkCallback(RxOkCallback callback)
Set the callback to call upon successful reception of a packet.
TracedCallback< Ptr< const Packet >, uint32_t > m_interferedPacket
The trace source fired when a packet cannot be correctly received because of interference.
RxFailedCallback m_rxFailedCallback
The callback to perform upon failed reception of a packet we were locked on.
Callback< void, Ptr< const Packet > > TxFinishedCallback
Type definition for a callback to call when a packet has finished sending.
virtual void TxFinished(Ptr< const Packet > packet)=0
Internal call when transmission of a packet finishes.
virtual void StartReceive(Ptr< Packet > packet, uint32_t frequencyHz, IQPolarity iqPolarity, uint8_t spreadingFactor, double rxPowerDbm, Time duration)=0
Start receiving a packet.
static Time GetTimeOnAir(uint32_t phyPayloadLen, const LoraTxParameters &txParams)
Compute the total transmission time for a physical packet based on modulation parameters.
TxFinishedCallback m_txFinishedCallback
The callback to perform upon the end of a transmission.
virtual void Send(Ptr< Packet > packet, uint32_t frequencyHz, IQPolarity iqPolarity, const LoraTxParameters &txParams, double txPowerDbm)=0
Instruct the PHY to send a packet according to some parameters.
virtual void EndReceive(Ptr< Packet > packet, Ptr< LoraInterferenceHelper::Event > event)=0
Finish reception of a packet.
void SetMobility(Ptr< MobilityModel > mobility)
Set the mobility model associated to this PHY.
void SetReceiveFailedCallback(RxFailedCallback callback)
Set the callback to call upon failed reception of a packet we were previously locked on.
void SetDevice(Ptr< NetDevice > device)
Set the NetDevice that owns this PHY.
TracedCallback< Ptr< const Packet >, uint32_t > m_successfullyReceivedPacket
The trace source fired when a packet was correctly received.
TracedCallback< Ptr< const Packet >, uint32_t > m_startSending
The trace source fired when a packet is sent.
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated to this PHY.
static Time GetTSym(uint8_t spreadingFactor, uint32_t bandwidthHz)
Compute the symbol time from spreading factor and bandwidth.
static TypeId GetTypeId()
Register this type.
TracedCallback< Ptr< const Packet >, uint32_t > m_underSensitivity
The trace source fired when a packet cannot be received because its power is below the sensitivity th...
Ptr< MobilityModel > m_mobility
The mobility model associated to this PHY.
void SetChannel(Ptr< LoraChannel > channel)
Set the LoraChannel instance PHY transmits on.
Ptr< NetDevice > m_device
The net device this PHY is attached to.
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Ptr< MobilityModel > GetMobility()
Get the mobility model associated to this PHY.
LoraPhy()
Default constructor.
Callback< void, Ptr< const Packet > > RxOkCallback
Type definition for a callback for when a packet is correctly received.
void SetTxFinishedCallback(TxFinishedCallback callback)
Set the callback to call after transmission of a packet.
virtual bool IsTransmitting() const =0
Whether this device is transmitting or not.
Ptr< LoraChannel > m_channel
The channel this PHY transmits on.
RxOkCallback m_rxOkCallback
The callback to perform upon correct reception of a packet.
CodingRate
Enumeration of the LoRa supported coding rates.
IQPolarity
I/Q Polarity of LoRa transmission symbols.
@ DOWN
Downlink / Downchirp / Inverted polarity.
@ UP
Uplink / Upchirp / Normal polarity.
std::ostream & operator<<(std::ostream &os, const EndDeviceLoraPhy::State &state)
Overloaded operator to print the value of a EndDeviceLoraPhy::State.
std::istream & operator>>(std::istream &is, CodingRate &codingRate)
Allow parsing of CodingRate from CommandLine.
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...
CodingRate codingRate
Transmission coding rate.
uint32_t bandwidthHz
Transmission bandwidth in Hz.
bool implicitHeader
Whether to use implicit header mode.
uint8_t spreadingFactor
Symbol Spreading Factor (SF).
bool crcEnabled
Whether Cyclic Redundancy Check (CRC) is enabled.
bool lowDataRateOptimize
Low Data Rate Optimization (mandated for SF11 and SF12).
uint16_t preambleLenSymb
Number of symbols in the packet preamble.