A Discrete-Event Network Simulator
API
ns3::LrWpanPhy Class Reference

Make LrWpanPhy a SpectrumPhy so we can enable the eventual modeling of device interference. More...

#include "lr-wpan-phy.h"

+ Inheritance diagram for ns3::LrWpanPhy:
+ Collaboration diagram for ns3::LrWpanPhy:

Public Types

typedef void(* StateTracedCallback) (Time time, LrWpanPhyEnumeration oldState, LrWpanPhyEnumeration newState)
 TracedCallback signature for Trx state change events. More...
 

Public Member Functions

 LrWpanPhy ()
 Default constructor. More...
 
 ~LrWpanPhy () override
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
void CcaCancel ()
 Cancel an ongoing CCA request. More...
 
Ptr< ObjectGetAntenna () const override
 Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception. More...
 
Ptr< SpectrumChannelGetChannel ()
 Get the currently attached channel. More...
 
uint8_t GetCurrentChannelNum () const
 Get The current channel number in use in this PHY from the PIB attributes. More...
 
uint8_t GetCurrentPage () const
 Get The current channel page number in use in this PHY from the PIB attributes. More...
 
double GetCurrentSignalPsd ()
 Get the current accumulated sum of signals in the transceiver including signals considered as interference. More...
 
double GetDataOrSymbolRate (bool isData)
 implement PLME SetAttribute confirm SAP bit rate is in bit/s. More...
 
Ptr< NetDeviceGetDevice () const override
 Get the associated NetDevice instance. More...
 
Ptr< LrWpanErrorModelGetErrorModel () const
 get the error model in use More...
 
Ptr< MobilityModelGetMobility () const override
 Get the associated MobilityModel instance. More...
 
Ptr< const SpectrumValueGetNoisePowerSpectralDensity ()
 Get the noise power spectral density. More...
 
uint64_t GetPhySHRDuration () const
 Get the duration of the SHR (preamble and SFD) in symbols, depending on the currently selected channel. More...
 
double GetPhySymbolsPerOctet () const
 Get the number of symbols per octet, depending on the currently selected channel. More...
 
double GetRxSensitivity ()
 Get the receiver power sensitivity used by this device in dBm. More...
 
Ptr< const SpectrumModelGetRxSpectrumModel () const override
 
void PdDataRequest (const uint32_t psduLength, Ptr< Packet > p)
 IEEE 802.15.4-2006 section 6.2.1.1 PD-DATA.request Request to transfer MPDU from MAC (transmitting) More...
 
void PlmeCcaRequest ()
 IEEE 802.15.4-2006 section 6.2.2.1 PLME-CCA.request Perform a CCA per section 6.9.9. More...
 
void PlmeEdRequest ()
 IEEE 802.15.4-2006 section 6.2.2.3 PLME-ED.request Perform an ED per section 6.9.7. More...
 
void PlmeGetAttributeRequest (LrWpanPibAttributeIdentifier id)
 IEEE 802.15.4-2006 section 6.2.2.5 PLME-GET.request Get attributes per definition from Table 23 in section 6.4.2. More...
 
void PlmeSetAttributeRequest (LrWpanPibAttributeIdentifier id, Ptr< LrWpanPhyPibAttributes > attribute)
 IEEE 802.15.4-2006 section 6.2.2.9 PLME-SET.request Set attributes per definition from Table 23 in section 6.4.2. More...
 
void PlmeSetTRXStateRequest (LrWpanPhyEnumeration state)
 IEEE 802.15.4-2006 section 6.2.2.7 PLME-SET-TRX-STATE.request Set PHY state. More...
 
void SetAntenna (Ptr< AntennaModel > a)
 Set the attached antenna. More...
 
void SetChannel (Ptr< SpectrumChannel > c) override
 Set the channel attached to this device. More...
 
void SetDevice (Ptr< NetDevice > d) override
 Set the associated NetDevice instance. More...
 
void SetErrorModel (Ptr< LrWpanErrorModel > e)
 set the error model to use More...
 
void SetMobility (Ptr< MobilityModel > m) override
 Set the mobility model associated with this device. More...
 
void SetNoisePowerSpectralDensity (Ptr< const SpectrumValue > noisePsd)
 Set the noise power spectral density. More...
 
void SetPdDataConfirmCallback (PdDataConfirmCallback c)
 set the callback for the end of a TX, as part of the interconnections between the PHY and the MAC. More...
 
void SetPdDataIndicationCallback (PdDataIndicationCallback c)
 set the callback for the end of a RX, as part of the interconnections between the PHY and the MAC. More...
 
void SetPhyOption (LrWpanPhyOption phyOption)
 Set the modulation option used by this PHY. More...
 
void SetPlmeCcaConfirmCallback (PlmeCcaConfirmCallback c)
 set the callback for the end of a CCA, as part of the interconnections between the PHY and the MAC. More...
 
void SetPlmeEdConfirmCallback (PlmeEdConfirmCallback c)
 set the callback for the end of an ED, as part of the interconnections between the PHY and the MAC. More...
 
void SetPlmeGetAttributeConfirmCallback (PlmeGetAttributeConfirmCallback c)
 set the callback for the end of an GetAttribute, as part of the interconnections between the PHY and the MAC. More...
 
void SetPlmeSetAttributeConfirmCallback (PlmeSetAttributeConfirmCallback c)
 set the callback for the end of an SetAttribute, as part of the interconnections between the PHY and the MAC. More...
 
void SetPlmeSetTRXStateConfirmCallback (PlmeSetTRXStateConfirmCallback c)
 set the callback for the end of an SetTRXState, as part of the interconnections between the PHY and the MAC. More...
 
void SetPostReceptionErrorModel (const Ptr< ErrorModel > em)
 Attach a receive ErrorModel to the LrWpanPhy. More...
 
void SetRxSensitivity (double dbmSensitivity)
 Set the receiver power sensitivity used by this device in dBm. More...
 
void SetTxPowerSpectralDensity (Ptr< SpectrumValue > txPsd)
 Set the Power Spectral Density of outgoing signals in W/Hz. More...
 
void StartRx (Ptr< SpectrumSignalParameters > params) override
 Notify the SpectrumPhy instance of an incoming waveform. More...
 
- Public Member Functions inherited from ns3::SpectrumPhy
 SpectrumPhy ()
 
 SpectrumPhy (const SpectrumPhy &)=delete
 
 ~SpectrumPhy () override
 
SpectrumPhyoperator= (const SpectrumPhy &)=delete
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::SpectrumPhy
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Types

typedef std::pair< Ptr< Packet >, bool > PacketAndStatus
 The second is true if the first is flagged as error/invalid. More...
 

Private Member Functions

Time CalculateTxTime (Ptr< const Packet > packet)
 Calculate the time required for sending the given packet, including preamble, SFD and PHR. More...
 
void CancelEd (LrWpanPhyEnumeration state)
 Cancel an ongoing ED procedure. More...
 
void ChangeTrxState (LrWpanPhyEnumeration newState)
 Change the PHY state to the given new state, firing the state change trace. More...
 
bool ChannelSupported (uint8_t channel)
 Check if the given channel is supported by the PHY. More...
 
void CheckInterference ()
 Check if the interference destroys a frame currently received. More...
 
double DbmToW (double dbm)
 Transforms decibels milliwatts (dBm) to watts (W). More...
 
void DoDispose () override
 Destructor implementation. More...
 
void DoInitialize () override
 Initialize() implementation. More...
 
void EndCca ()
 Called at the end of the CCA. More...
 
void EndEd ()
 Called at the end of the ED procedure. More...
 
void EndRx (Ptr< SpectrumSignalParameters > params)
 Finish the reception of a frame. More...
 
void EndSetTRXState ()
 Called after applying a deferred transceiver state switch. More...
 
void EndTx ()
 Finish the transmission of a frame. More...
 
LrWpanPhyOption GetMyPhyOption ()
 Get the currently configured PHY option. More...
 
int8_t GetNominalTxPowerFromPib (uint8_t phyTransmitPower)
 Calculates the nominal transmit power of the device in decibels relative to 1 mW according to the representation of the PIB attribute phyTransmitPower. More...
 
Time GetPpduHeaderTxTime ()
 Calculate the time required for sending the PPDU header, that is the preamble, SFD and PHR. More...
 
bool PageSupported (uint8_t page)
 Check if the given page is supported by the PHY. More...
 
bool PhyIsBusy () const
 Check if the PHY is busy, which is the case if the PHY is currently sending or receiving a frame. More...
 
double WToDbm (double watt)
 Transform watts (W) to decibels milliwatts (dBm). More...
 

Private Attributes

Ptr< AntennaModelm_antenna
 The antenna used by the transceiver. More...
 
double m_ccaPeakPower
 Helper value for the peak power value during CCA. More...
 
EventId m_ccaRequest
 Scheduler event of a currently running CCA request. More...
 
Ptr< SpectrumChannelm_channel
 The channel attached to this transceiver. More...
 
std::pair< Ptr< LrWpanSpectrumSignalParameters >, bool > m_currentRxPacket
 Status information of the currently received packet. More...
 
PacketAndStatus m_currentTxPacket
 Status information of the currently transmitted packet. More...
 
Ptr< NetDevicem_device
 The configured net device. More...
 
LrWpanEdPower m_edPower
 Helper value for tracking the average power during ED. More...
 
EventId m_edRequest
 Scheduler event of a currently running ED request. More...
 
Ptr< LrWpanErrorModelm_errorModel
 The error model describing the bit and packet error rates. More...
 
bool m_isRxCanceled
 Indicates if the reception of frame has been canceled. More...
 
Ptr< MobilityModelm_mobility
 The mobility model used by the PHY. More...
 
Ptr< const SpectrumValuem_noise
 The spectral density for for the noise. More...
 
PdDataConfirmCallback m_pdDataConfirmCallback
 This callback is used to report packet transmission status to the MAC layer. More...
 
PdDataIndicationCallback m_pdDataIndicationCallback
 This callback is used to notify incoming packets to the MAC layer. More...
 
EventId m_pdDataRequest
 Scheduler event of a currently running data transmission request. More...
 
LrWpanPhyOption m_phyOption
 The currently configured PHY type. More...
 
LrWpanPhyPibAttributes m_phyPIBAttributes
 The current PHY PIB attributes. More...
 
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
 The trace source fired when a packet begins the reception process from the medium. More...
 
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
 The trace source fired when the phy layer drops a packet it has received. More...
 
TracedCallback< Ptr< const Packet >, double > m_phyRxEndTrace
 The trace source fired when a packet ends the reception process from the medium. More...
 
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
 The trace source fired when a packet begins the transmission process on the medium. More...
 
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
 The trace source fired when the phy layer drops a packet as it tries to transmit it. More...
 
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
 The trace source fired when a packet ends the transmission process on the medium. More...
 
PlmeCcaConfirmCallback m_plmeCcaConfirmCallback
 This callback is used to report CCA status to the MAC or CSMA/CA. More...
 
PlmeEdConfirmCallback m_plmeEdConfirmCallback
 This callback is used to report ED status to the MAC. More...
 
PlmeGetAttributeConfirmCallback m_plmeGetAttributeConfirmCallback
 This callback is used to report requested attribute values back to the MAC. More...
 
PlmeSetAttributeConfirmCallback m_plmeSetAttributeConfirmCallback
 This callback is used to report attribute set results back to the MAC. More...
 
PlmeSetTRXStateConfirmCallback m_plmeSetTRXStateConfirmCallback
 This callback is used to report transceiver state change status to the MAC. More...
 
Ptr< ErrorModelm_postReceptionErrorModel
 Error model for receive packet events. More...
 
Ptr< UniformRandomVariablem_random
 Uniform random variable stream. More...
 
Time m_rxLastUpdate
 Timestamp of the last calculation of the PER of a packet currently received. More...
 
double m_rxSensitivity
 The receiver sensitivity. More...
 
EventId m_setTRXState
 Scheduler event of a currently running deferred transceiver state switch. More...
 
Ptr< LrWpanInterferenceHelperm_signal
 The accumulated signals currently received by the transceiver, including the signal of a possibly received packet, as well as all signals considered noise. More...
 
TracedValue< LrWpanPhyEnumerationm_trxState
 The current transceiver state. More...
 
TracedCallback< Time, LrWpanPhyEnumeration, LrWpanPhyEnumerationm_trxStateLogger
 The trace source fired when the phy layer changes the transceiver state. More...
 
LrWpanPhyEnumeration m_trxStatePending
 The next pending state to applied after the current action of the PHY is completed. More...
 
Ptr< SpectrumValuem_txPsd
 The transmit power spectral density. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

Make LrWpanPhy a SpectrumPhy so we can enable the eventual modeling of device interference.

Definition at line 273 of file lr-wpan-phy.h.

Member Typedef Documentation

◆ PacketAndStatus

typedef std::pair<Ptr<Packet>, bool> ns3::LrWpanPhy::PacketAndStatus
private

The second is true if the first is flagged as error/invalid.

Definition at line 579 of file lr-wpan-phy.h.

◆ StateTracedCallback

typedef void(* ns3::LrWpanPhy::StateTracedCallback) (Time time, LrWpanPhyEnumeration oldState, LrWpanPhyEnumeration newState)

TracedCallback signature for Trx state change events.

Parameters
[in]timeThe time of the state change.
[in]oldStateThe old state.
[in]newStateThe new state.
Deprecated:
The LrWpanPhyEnumeration state is now accessible as the TracedValue TrxStateValue. The TrxState TracedCallback will be removed in a future release.

Definition at line 571 of file lr-wpan-phy.h.

Constructor & Destructor Documentation

◆ LrWpanPhy()

◆ ~LrWpanPhy()

ns3::LrWpanPhy::~LrWpanPhy ( )
override

Definition at line 224 of file lr-wpan-phy.cc.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::LrWpanPhy::AssignStreams ( int64_t  stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 1899 of file lr-wpan-phy.cc.

References m_random, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

◆ CalculateTxTime()

Time ns3::LrWpanPhy::CalculateTxTime ( Ptr< const Packet packet)
private

Calculate the time required for sending the given packet, including preamble, SFD and PHR.

Parameters
packetthe packet for which the transmission time should be calculated
Returns
the time required for transmitting the packet

Definition at line 1573 of file lr-wpan-phy.cc.

References GetDataOrSymbolRate(), GetPpduHeaderTxTime(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by PdDataRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CancelEd()

void ns3::LrWpanPhy::CancelEd ( LrWpanPhyEnumeration  state)
private

Cancel an ongoing ED procedure.

This is called when the transceiver is switched off or set to TX mode. This calls the appropriate confirm callback of the MAC.

Parameters
statethe new state which is the cause for canceling ED

Definition at line 1374 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ns3::IEEE_802_15_4_PHY_TRX_OFF, ns3::IEEE_802_15_4_PHY_TX_ON, ns3::EventId::IsExpired(), ns3::Callback< R, UArgs >::IsNull(), m_edRequest, m_plmeEdConfirmCallback, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by PlmeSetTRXStateRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CcaCancel()

void ns3::LrWpanPhy::CcaCancel ( )

Cancel an ongoing CCA request.

Definition at line 738 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), m_ccaRequest, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ChangeTrxState()

void ns3::LrWpanPhy::ChangeTrxState ( LrWpanPhyEnumeration  newState)
private

Change the PHY state to the given new state, firing the state change trace.

Parameters
newStatethe new state

Definition at line 1357 of file lr-wpan-phy.cc.

References m_trxState, m_trxStateLogger, ns3::Simulator::Now(), and NS_LOG_LOGIC.

Referenced by LrWpanPhy(), EndRx(), EndSetTRXState(), EndTx(), PdDataRequest(), PlmeSetTRXStateRequest(), and StartRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ChannelSupported()

bool ns3::LrWpanPhy::ChannelSupported ( uint8_t  channel)
private

Check if the given channel is supported by the PHY.

Parameters
channelthe channel to check
Returns
true, if the channel is supported, false otherwise

Definition at line 993 of file lr-wpan-phy.cc.

References third::channel, m_phyPIBAttributes, NS_LOG_FUNCTION, ns3::LrWpanPhyPibAttributes::phyChannelsSupported, and ns3::LrWpanPhyPibAttributes::phyCurrentPage.

Referenced by PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

◆ CheckInterference()

void ns3::LrWpanPhy::CheckInterference ( )
private

Check if the interference destroys a frame currently received.

Called whenever a change in interference is detected.

Definition at line 500 of file lr-wpan-phy.cc.

References ns3::LrWpanLqiTag::Get(), GetDataOrSymbolRate(), ns3::UniformRandomVariable::GetValue(), ns3::IEEE_802_15_4_PHY_BUSY_RX, m_currentRxPacket, m_errorModel, m_noise, m_phyPIBAttributes, m_random, m_rxLastUpdate, m_signal, m_trxState, max, ns3::Time::MS, ns3::Simulator::Now(), NS_LOG_WARN, ns3::Packet::PeekPacketTag(), ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::Packet::ReplacePacketTag(), ns3::LrWpanLqiTag::Set(), and ns3::LrWpanSpectrumValueHelper::TotalAvgPower().

Referenced by EndRx(), and StartRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DbmToW()

double ns3::LrWpanPhy::DbmToW ( double  dbm)
private

Transforms decibels milliwatts (dBm) to watts (W).

Parameters
dbmThe DBm that will be converted to Watts.
Returns
The value of DBm in Watts.

Definition at line 1893 of file lr-wpan-phy.cc.

Referenced by SetRxSensitivity().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::LrWpanPhy::DoDispose ( void  )
overrideprivatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 254 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), ns3::IEEE_802_15_4_PHY_IDLE, ns3::IEEE_802_15_4_PHY_TRX_OFF, m_antenna, m_ccaRequest, m_channel, m_currentRxPacket, m_currentTxPacket, m_device, m_edRequest, m_errorModel, m_mobility, m_noise, m_pdDataConfirmCallback, m_pdDataIndicationCallback, m_pdDataRequest, m_plmeCcaConfirmCallback, m_plmeEdConfirmCallback, m_plmeGetAttributeConfirmCallback, m_plmeSetAttributeConfirmCallback, m_plmeSetTRXStateConfirmCallback, m_postReceptionErrorModel, m_random, m_setTRXState, m_signal, m_trxState, m_trxStatePending, m_txPsd, ns3::MakeNullCallback(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::LrWpanPhy::DoInitialize ( void  )
overrideprivatevirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 229 of file lr-wpan-phy.cc.

References m_device, m_mobility, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, and NS_LOG_WARN.

◆ EndCca()

void ns3::LrWpanPhy::EndCca ( )
private

◆ EndEd()

void ns3::LrWpanPhy::EndEd ( )
private

◆ EndRx()

void ns3::LrWpanPhy::EndRx ( Ptr< SpectrumSignalParameters params)
private

Finish the reception of a frame.

This is called at the end of a frame reception, applying possibly pending PHY state changes and fireing the appropriate trace sources and indication callbacks to the MAC. A frame destroyed by noise/interference is dropped here, but not during reception. This method is also called for every packet which only contributes to interference.

Parameters
paramssignal parameters of the packet

Definition at line 550 of file lr-wpan-phy.cc.

References ns3::LrWpanEdPower::averagePower, ChangeTrxState(), CheckInterference(), ns3::Packet::Copy(), ns3::LrWpanLqiTag::Get(), ns3::Packet::GetSize(), ns3::Time::GetTimeStep(), ns3::IEEE_802_15_4_PHY_RX_ON, ns3::EventId::IsExpired(), ns3::Callback< R, UArgs >::IsNull(), ns3::LrWpanEdPower::lastUpdate, m_currentRxPacket, m_device, m_edPower, m_edRequest, m_isRxCanceled, m_pdDataIndicationCallback, m_phyPIBAttributes, m_phyRxDropTrace, m_phyRxEndTrace, m_postReceptionErrorModel, m_signal, max, ns3::LrWpanEdPower::measurementLength, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, two-ray-to-three-gpp-ch-calibration::params, ns3::Packet::PeekPacketTag(), ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::SpectrumSignalParameters::psd, and ns3::LrWpanSpectrumValueHelper::TotalAvgPower().

Referenced by StartRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndSetTRXState()

void ns3::LrWpanPhy::EndSetTRXState ( )
private

Called after applying a deferred transceiver state switch.

The result of the state switch is reported to the MAC.

Definition at line 1501 of file lr-wpan-phy.cc.

References ChangeTrxState(), ns3::IEEE_802_15_4_PHY_IDLE, ns3::IEEE_802_15_4_PHY_RX_ON, ns3::IEEE_802_15_4_PHY_TX_ON, ns3::Callback< R, UArgs >::IsNull(), m_plmeSetTRXStateConfirmCallback, m_trxState, m_trxStatePending, NS_ABORT_IF, and NS_LOG_FUNCTION.

Referenced by PlmeSetTRXStateRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndTx()

void ns3::LrWpanPhy::EndTx ( )
private

Finish the transmission of a frame.

This is called at the end of a frame transmission, applying possibly pending PHY state changes and fireing the appropriate trace sources and confirm callbacks to the MAC.

Definition at line 1517 of file lr-wpan-phy.cc.

References ChangeTrxState(), ns3::IEEE_802_15_4_PHY_BUSY_TX, ns3::IEEE_802_15_4_PHY_IDLE, ns3::IEEE_802_15_4_PHY_SUCCESS, ns3::IEEE_802_15_4_PHY_TRX_OFF, ns3::IEEE_802_15_4_PHY_TX_ON, ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsRunning(), m_currentTxPacket, m_pdDataConfirmCallback, m_phyTxDropTrace, m_phyTxEndTrace, m_plmeSetTRXStateConfirmCallback, m_setTRXState, m_trxState, m_trxStatePending, NS_ABORT_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by PdDataRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAntenna()

Ptr< Object > ns3::LrWpanPhy::GetAntenna ( ) const
overridevirtual

Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.

Note that in general and depending on each module design, there can be multiple SpectrumPhy instances per NetDevice.

Returns
a Ptr to the AntennaModel used by this SpectrumPhy instance for transmission and/or reception

Implements ns3::SpectrumPhy.

Definition at line 351 of file lr-wpan-phy.cc.

References m_antenna.

◆ GetChannel()

Ptr< SpectrumChannel > ns3::LrWpanPhy::GetChannel ( )

Get the currently attached channel.

Returns
the channel

Definition at line 330 of file lr-wpan-phy.cc.

References m_channel, and NS_LOG_FUNCTION.

◆ GetCurrentChannelNum()

uint8_t ns3::LrWpanPhy::GetCurrentChannelNum ( ) const

Get The current channel number in use in this PHY from the PIB attributes.

Returns
The current channel number

Definition at line 1592 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, and ns3::LrWpanPhyPibAttributes::phyCurrentChannel.

◆ GetCurrentPage()

uint8_t ns3::LrWpanPhy::GetCurrentPage ( ) const

Get The current channel page number in use in this PHY from the PIB attributes.

Returns
The current page number

Definition at line 1586 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, and ns3::LrWpanPhyPibAttributes::phyCurrentPage.

◆ GetCurrentSignalPsd()

double ns3::LrWpanPhy::GetCurrentSignalPsd ( )

Get the current accumulated sum of signals in the transceiver including signals considered as interference.

Returns
the accumulated signal power spectral density value in Dbm.

Definition at line 1856 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, m_signal, ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::LrWpanSpectrumValueHelper::TotalAvgPower(), and WToDbm().

+ Here is the call graph for this function:

◆ GetDataOrSymbolRate()

double ns3::LrWpanPhy::GetDataOrSymbolRate ( bool  isData)

implement PLME SetAttribute confirm SAP bit rate is in bit/s.

Symbol rate is in symbol/s.

Parameters
isDatais true for data rate or false for symbol rate
Returns
the rate value of this PHY

Definition at line 1598 of file lr-wpan-phy.cc.

References ns3::LrWpanPhyDataAndSymbolRates::bitRate, ns3::dataSymbolRates, ns3::IEEE_802_15_4_INVALID_PHY_OPTION, m_phyOption, NS_ASSERT, and ns3::LrWpanPhyDataAndSymbolRates::symbolRate.

Referenced by CalculateTxTime(), CheckInterference(), GetPpduHeaderTxTime(), PlmeCcaRequest(), PlmeEdRequest(), and PlmeSetTRXStateRequest().

+ Here is the caller graph for this function:

◆ GetDevice()

Ptr< NetDevice > ns3::LrWpanPhy::GetDevice ( ) const
overridevirtual

Get the associated NetDevice instance.

Returns
a Ptr to the associated NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 297 of file lr-wpan-phy.cc.

References m_device.

◆ GetErrorModel()

Ptr< LrWpanErrorModel > ns3::LrWpanPhy::GetErrorModel ( ) const

get the error model in use

Returns
pointer to LrWpanErrorModel in use

Definition at line 1830 of file lr-wpan-phy.cc.

References m_errorModel, and NS_LOG_FUNCTION.

◆ GetMobility()

Ptr< MobilityModel > ns3::LrWpanPhy::GetMobility ( ) const
overridevirtual

Get the associated MobilityModel instance.

Returns
a Ptr to the associated MobilityModel instance

Implements ns3::SpectrumPhy.

Definition at line 303 of file lr-wpan-phy.cc.

References m_mobility.

◆ GetMyPhyOption()

LrWpanPhyOption ns3::LrWpanPhy::GetMyPhyOption ( )
private

Get the currently configured PHY option.

See IEEE 802.15.4-2006, section 6.1.2, Table 2.

Returns
the PHY option

Definition at line 1790 of file lr-wpan-phy.cc.

References m_phyOption, and NS_LOG_FUNCTION.

◆ GetNoisePowerSpectralDensity()

Ptr< const SpectrumValue > ns3::LrWpanPhy::GetNoisePowerSpectralDensity ( )

Get the noise power spectral density.

Returns
the Noise Power Spectral Density

Definition at line 1815 of file lr-wpan-phy.cc.

References m_noise, and NS_LOG_FUNCTION.

◆ GetNominalTxPowerFromPib()

int8_t ns3::LrWpanPhy::GetNominalTxPowerFromPib ( uint8_t  phyTransmitPower)
private

Calculates the nominal transmit power of the device in decibels relative to 1 mW according to the representation of the PIB attribute phyTransmitPower.

The phyTransmitPower (table 23 of IEEE 802.15.4-2006) is a 8-bit bitmap, stored as a uint8_t. The bitmap has the following meaning: The 2 MSBs represent the tolerance on the transmit power. The 6 LSBs represent a signed integer in twos-complement format, corresponding to the nominal transmit power of the device in decibels relative to 1 mW.

This function extracts the 6 LSBs corresponding to the nominal transmit power and converts it to a int8_t.

Parameters
phyTransmitPowerthe PIB attribute
Returns
The nominal transmit power in dBm.

Definition at line 1865 of file lr-wpan-phy.cc.

References NS_LOG_FUNCTION, and ns3::phyTransmitPower.

Referenced by PlmeSetAttributeRequest(), and SetRxSensitivity().

+ Here is the caller graph for this function:

◆ GetPhySHRDuration()

uint64_t ns3::LrWpanPhy::GetPhySHRDuration ( ) const

Get the duration of the SHR (preamble and SFD) in symbols, depending on the currently selected channel.

Returns
the SHR duration in symbols

Definition at line 1837 of file lr-wpan-phy.cc.

References ns3::IEEE_802_15_4_INVALID_PHY_OPTION, m_phyOption, NS_ASSERT, NS_LOG_FUNCTION, ns3::ppduHeaderSymbolNumbers, ns3::LrWpanPhyPpduHeaderSymbolNumber::shrPreamble, and ns3::LrWpanPhyPpduHeaderSymbolNumber::shrSfd.

Referenced by PlmeGetAttributeRequest().

+ Here is the caller graph for this function:

◆ GetPhySymbolsPerOctet()

double ns3::LrWpanPhy::GetPhySymbolsPerOctet ( ) const

Get the number of symbols per octet, depending on the currently selected channel.

Returns
the number of symbols per octet

Definition at line 1847 of file lr-wpan-phy.cc.

References ns3::LrWpanPhyDataAndSymbolRates::bitRate, ns3::dataSymbolRates, ns3::IEEE_802_15_4_INVALID_PHY_OPTION, m_phyOption, NS_ASSERT, NS_LOG_FUNCTION, and ns3::LrWpanPhyDataAndSymbolRates::symbolRate.

Referenced by PlmeGetAttributeRequest().

+ Here is the caller graph for this function:

◆ GetPpduHeaderTxTime()

Time ns3::LrWpanPhy::GetPpduHeaderTxTime ( )
private

Calculate the time required for sending the PPDU header, that is the preamble, SFD and PHR.

Returns
The time required for sending the PPDU header.

Definition at line 1617 of file lr-wpan-phy.cc.

References GetDataOrSymbolRate(), ns3::IEEE_802_15_4_INVALID_PHY_OPTION, m_phyOption, NS_ASSERT, NS_LOG_FUNCTION, ns3::LrWpanPhyPpduHeaderSymbolNumber::phr, ns3::ppduHeaderSymbolNumbers, ns3::Seconds(), ns3::LrWpanPhyPpduHeaderSymbolNumber::shrPreamble, and ns3::LrWpanPhyPpduHeaderSymbolNumber::shrSfd.

Referenced by CalculateTxTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRxSensitivity()

double ns3::LrWpanPhy::GetRxSensitivity ( )

Get the receiver power sensitivity used by this device in dBm.

Returns
The receiver power sensitivity used by this device in dBm.

Definition at line 1782 of file lr-wpan-phy.cc.

References m_rxSensitivity, NS_LOG_FUNCTION, and WToDbm().

+ Here is the call graph for this function:

◆ GetRxSpectrumModel()

Ptr< const SpectrumModel > ns3::LrWpanPhy::GetRxSpectrumModel ( ) const
overridevirtual
Returns
returns the SpectrumModel that this SpectrumPhy expects to be used for all SpectrumValues that are passed to StartRx. If 0 is returned, it means that any model will be accepted.

Implements ns3::SpectrumPhy.

Definition at line 337 of file lr-wpan-phy.cc.

References ns3::SpectrumValue::GetSpectrumModel(), m_txPsd, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::LrWpanPhy::GetTypeId ( void  )
static

◆ PageSupported()

bool ns3::LrWpanPhy::PageSupported ( uint8_t  page)
private

Check if the given page is supported by the PHY.

Parameters
pagethe page to check
Returns
true, if the page is supported, false otherwise

Definition at line 1011 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, anonymous_namespace{print-introspected-doxygen.cc}::page, and ns3::LrWpanPhyPibAttributes::phyChannelsSupported.

Referenced by PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

◆ PdDataRequest()

void ns3::LrWpanPhy::PdDataRequest ( const uint32_t  psduLength,
Ptr< Packet p 
)

◆ PhyIsBusy()

bool ns3::LrWpanPhy::PhyIsBusy ( ) const
private

Check if the PHY is busy, which is the case if the PHY is currently sending or receiving a frame.

Returns
true, if the PHY is busy, false otherwise

Definition at line 1366 of file lr-wpan-phy.cc.

References ns3::IEEE_802_15_4_PHY_BUSY, ns3::IEEE_802_15_4_PHY_BUSY_RX, ns3::IEEE_802_15_4_PHY_BUSY_TX, m_trxState, and NS_LOG_FUNCTION.

Referenced by EndCca(), and PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

◆ PlmeCcaRequest()

void ns3::LrWpanPhy::PlmeCcaRequest ( )

◆ PlmeEdRequest()

◆ PlmeGetAttributeRequest()

void ns3::LrWpanPhy::PlmeGetAttributeRequest ( LrWpanPibAttributeIdentifier  id)

◆ PlmeSetAttributeRequest()

void ns3::LrWpanPhy::PlmeSetAttributeRequest ( LrWpanPibAttributeIdentifier  id,
Ptr< LrWpanPhyPibAttributes attribute 
)

IEEE 802.15.4-2006 section 6.2.2.9 PLME-SET.request Set attributes per definition from Table 23 in section 6.4.2.

Parameters
idthe attributed identifier
attributethe attribute value

Definition at line 1034 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ChannelSupported(), ns3::LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity(), GetNominalTxPowerFromPib(), ns3::IEEE_802_15_4_2_4GHZ_OQPSK, ns3::IEEE_802_15_4_780MHZ_OQPSK, ns3::IEEE_802_15_4_868MHZ_ASK, ns3::IEEE_802_15_4_868MHZ_BPSK, ns3::IEEE_802_15_4_868MHZ_OQPSK, ns3::IEEE_802_15_4_915MHZ_ASK, ns3::IEEE_802_15_4_915MHZ_BPSK, ns3::IEEE_802_15_4_915MHZ_OQPSK, ns3::IEEE_802_15_4_950MHZ_BPSK, ns3::IEEE_802_15_4_PHY_IDLE, ns3::IEEE_802_15_4_PHY_INVALID_PARAMETER, ns3::IEEE_802_15_4_PHY_SUCCESS, ns3::IEEE_802_15_4_PHY_TRX_OFF, ns3::IEEE_802_15_4_PHY_UNSUPPORTED_ATTRIBUTE, ns3::Callback< R, UArgs >::IsNull(), m_currentRxPacket, m_currentTxPacket, m_pdDataConfirmCallback, m_pdDataRequest, m_phyOption, m_phyPIBAttributes, m_plmeSetAttributeConfirmCallback, m_plmeSetTRXStateConfirmCallback, m_rxSensitivity, m_setTRXState, m_trxState, m_trxStatePending, m_txPsd, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, PageSupported(), ns3::phyCCAMode, ns3::LrWpanPhyPibAttributes::phyCCAMode, ns3::phyChannelsSupported, ns3::LrWpanPhyPibAttributes::phyChannelsSupported, ns3::phyCurrentChannel, ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::phyCurrentPage, ns3::LrWpanPhyPibAttributes::phyCurrentPage, PhyIsBusy(), ns3::phyTransmitPower, ns3::LrWpanPhyPibAttributes::phyTransmitPower, SetRxSensitivity(), and WToDbm().

+ Here is the call graph for this function:

◆ PlmeSetTRXStateRequest()

◆ SetAntenna()

void ns3::LrWpanPhy::SetAntenna ( Ptr< AntennaModel a)

Set the attached antenna.

Parameters
athe antenna

Definition at line 357 of file lr-wpan-phy.cc.

References m_antenna, and NS_LOG_FUNCTION.

◆ SetChannel()

void ns3::LrWpanPhy::SetChannel ( Ptr< SpectrumChannel c)
overridevirtual

Set the channel attached to this device.

Parameters
cthe channel

Implements ns3::SpectrumPhy.

Definition at line 323 of file lr-wpan-phy.cc.

References m_channel, and NS_LOG_FUNCTION.

◆ SetDevice()

void ns3::LrWpanPhy::SetDevice ( Ptr< NetDevice d)
overridevirtual

Set the associated NetDevice instance.

Parameters
dthe NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 309 of file lr-wpan-phy.cc.

References m_device, and NS_LOG_FUNCTION.

◆ SetErrorModel()

void ns3::LrWpanPhy::SetErrorModel ( Ptr< LrWpanErrorModel e)

set the error model to use

Parameters
epointer to LrWpanErrorModel to use

Definition at line 1822 of file lr-wpan-phy.cc.

References m_errorModel, NS_ASSERT, and NS_LOG_FUNCTION.

◆ SetMobility()

void ns3::LrWpanPhy::SetMobility ( Ptr< MobilityModel m)
overridevirtual

Set the mobility model associated with this device.

Parameters
mthe mobility model

Implements ns3::SpectrumPhy.

Definition at line 316 of file lr-wpan-phy.cc.

References two-ray-to-three-gpp-ch-calibration::m, m_mobility, and NS_LOG_FUNCTION.

◆ SetNoisePowerSpectralDensity()

void ns3::LrWpanPhy::SetNoisePowerSpectralDensity ( Ptr< const SpectrumValue noisePsd)

Set the noise power spectral density.

Parameters
noisePsdthe Noise Power Spectral Density in power units (Watt, Pascal...) per Hz.

Definition at line 1806 of file lr-wpan-phy.cc.

References m_noise, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

◆ SetPdDataConfirmCallback()

void ns3::LrWpanPhy::SetPdDataConfirmCallback ( PdDataConfirmCallback  c)

set the callback for the end of a TX, as part of the interconnections between the PHY and the MAC.

The callback implements PD SAP.

Parameters
cthe callback

Definition at line 1315 of file lr-wpan-phy.cc.

References m_pdDataConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPdDataIndicationCallback()

void ns3::LrWpanPhy::SetPdDataIndicationCallback ( PdDataIndicationCallback  c)

set the callback for the end of a RX, as part of the interconnections between the PHY and the MAC.

The callback implements PD Indication SAP.

Parameters
cthe callback

Definition at line 1308 of file lr-wpan-phy.cc.

References m_pdDataIndicationCallback, and NS_LOG_FUNCTION.

◆ SetPhyOption()

◆ SetPlmeCcaConfirmCallback()

void ns3::LrWpanPhy::SetPlmeCcaConfirmCallback ( PlmeCcaConfirmCallback  c)

set the callback for the end of a CCA, as part of the interconnections between the PHY and the MAC.

The callback implement PLME CCA confirm SAP

Parameters
cthe callback

Definition at line 1322 of file lr-wpan-phy.cc.

References m_plmeCcaConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeEdConfirmCallback()

void ns3::LrWpanPhy::SetPlmeEdConfirmCallback ( PlmeEdConfirmCallback  c)

set the callback for the end of an ED, as part of the interconnections between the PHY and the MAC.

The callback implement PLME ED confirm SAP

Parameters
cthe callback

Definition at line 1329 of file lr-wpan-phy.cc.

References m_plmeEdConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeGetAttributeConfirmCallback()

void ns3::LrWpanPhy::SetPlmeGetAttributeConfirmCallback ( PlmeGetAttributeConfirmCallback  c)

set the callback for the end of an GetAttribute, as part of the interconnections between the PHY and the MAC.

The callback implement PLME GetAttribute confirm SAP

Parameters
cthe callback

Definition at line 1336 of file lr-wpan-phy.cc.

References m_plmeGetAttributeConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeSetAttributeConfirmCallback()

void ns3::LrWpanPhy::SetPlmeSetAttributeConfirmCallback ( PlmeSetAttributeConfirmCallback  c)

set the callback for the end of an SetAttribute, as part of the interconnections between the PHY and the MAC.

The callback implement PLME SetAttribute confirm SAP

Parameters
cthe callback

Definition at line 1350 of file lr-wpan-phy.cc.

References m_plmeSetAttributeConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeSetTRXStateConfirmCallback()

void ns3::LrWpanPhy::SetPlmeSetTRXStateConfirmCallback ( PlmeSetTRXStateConfirmCallback  c)

set the callback for the end of an SetTRXState, as part of the interconnections between the PHY and the MAC.

The callback implement PLME SetTRXState confirm SAP

Parameters
cthe callback

Definition at line 1343 of file lr-wpan-phy.cc.

References m_plmeSetTRXStateConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPostReceptionErrorModel()

void ns3::LrWpanPhy::SetPostReceptionErrorModel ( const Ptr< ErrorModel em)

Attach a receive ErrorModel to the LrWpanPhy.

The LrWpanPhy may optionally include an ErrorModel in the packet receive chain. The error model is additive to any modulation-based error model based on SNR, and is typically used to force specific packet losses or for testing purposes.

Parameters
emPointer to the ErrorModel.

Definition at line 1907 of file lr-wpan-phy.cc.

References m_postReceptionErrorModel, and NS_LOG_FUNCTION.

◆ SetRxSensitivity()

void ns3::LrWpanPhy::SetRxSensitivity ( double  dbmSensitivity)

Set the receiver power sensitivity used by this device in dBm.

In ns-3 , rx sensitivity is only checked to be at least what is specified by the standard (-85dBm or -92dBm for BPSK bands). Most vendors provide better sensitivity options and exceed the minimum values proposed by the standard. Default sensitivity is -106.58 dBm (This does not include any noise figure). A sensitivity of -95dBm or less is considered by many vendors a high sensitivity.

Parameters
dbmSensitivityThe receiver power sensitivity to set in dBm.

Definition at line 1735 of file lr-wpan-phy.cc.

References ns3::LrWpanSpectrumValueHelper::CreateNoisePowerSpectralDensity(), ns3::LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity(), DbmToW(), GetNominalTxPowerFromPib(), ns3::IEEE_802_15_4_915MHZ_BPSK, ns3::IEEE_802_15_4_950MHZ_BPSK, m_noise, m_phyOption, m_phyPIBAttributes, m_rxSensitivity, m_signal, m_txPsd, NS_ABORT_MSG, NS_LOG_FUNCTION, ns3::LrWpanPhyPibAttributes::phyCurrentChannel, ns3::LrWpanPhyPibAttributes::phyTransmitPower, and ns3::LrWpanSpectrumValueHelper::SetNoiseFactor().

Referenced by PlmeSetAttributeRequest(), and SetPhyOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTxPowerSpectralDensity()

void ns3::LrWpanPhy::SetTxPowerSpectralDensity ( Ptr< SpectrumValue txPsd)

Set the Power Spectral Density of outgoing signals in W/Hz.

Parameters
txPsdthe Power Spectral Density value

Definition at line 1797 of file lr-wpan-phy.cc.

References m_txPsd, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

◆ StartRx()

◆ WToDbm()

double ns3::LrWpanPhy::WToDbm ( double  watt)
private

Transform watts (W) to decibels milliwatts (dBm).

Parameters
wattThe Watts that will be converted to dBm.
Returns
The value of Watts in dBm.

Definition at line 1887 of file lr-wpan-phy.cc.

Referenced by GetCurrentSignalPsd(), GetRxSensitivity(), and PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_antenna

Ptr<AntennaModel> ns3::LrWpanPhy::m_antenna
private

The antenna used by the transceiver.

Definition at line 807 of file lr-wpan-phy.h.

Referenced by DoDispose(), GetAntenna(), PdDataRequest(), and SetAntenna().

◆ m_ccaPeakPower

double ns3::LrWpanPhy::m_ccaPeakPower
private

Helper value for the peak power value during CCA.

Definition at line 897 of file lr-wpan-phy.h.

Referenced by EndCca(), PlmeCcaRequest(), and StartRx().

◆ m_ccaRequest

EventId ns3::LrWpanPhy::m_ccaRequest
private

Scheduler event of a currently running CCA request.

Definition at line 940 of file lr-wpan-phy.h.

Referenced by CcaCancel(), DoDispose(), PlmeCcaRequest(), PlmeSetTRXStateRequest(), and StartRx().

◆ m_channel

Ptr<SpectrumChannel> ns3::LrWpanPhy::m_channel
private

The channel attached to this transceiver.

Definition at line 802 of file lr-wpan-phy.h.

Referenced by DoDispose(), GetChannel(), PdDataRequest(), and SetChannel().

◆ m_currentRxPacket

std::pair<Ptr<LrWpanSpectrumSignalParameters>, bool> ns3::LrWpanPhy::m_currentRxPacket
private

Status information of the currently received packet.

The first parameter contains the frame, as well the signal power of the frame. If the second parameter is set to true, the frame is either invalid, destroyed due to interference or cancelled.

Definition at line 927 of file lr-wpan-phy.h.

Referenced by CheckInterference(), DoDispose(), EndRx(), PlmeSetAttributeRequest(), PlmeSetTRXStateRequest(), SetPhyOption(), and StartRx().

◆ m_currentTxPacket

PacketAndStatus ns3::LrWpanPhy::m_currentTxPacket
private

Status information of the currently transmitted packet.

The first parameter contains the frame. If the second parameter is set to true, the frame has not been completely transmitted (in the event of a force transceiver switch, for example).

Definition at line 935 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndTx(), PdDataRequest(), PlmeSetAttributeRequest(), PlmeSetTRXStateRequest(), and SetPhyOption().

◆ m_device

Ptr<NetDevice> ns3::LrWpanPhy::m_device
private

The configured net device.

Definition at line 797 of file lr-wpan-phy.h.

Referenced by DoDispose(), DoInitialize(), EndRx(), GetDevice(), and SetDevice().

◆ m_edPower

LrWpanEdPower ns3::LrWpanPhy::m_edPower
private

Helper value for tracking the average power during ED.

Definition at line 892 of file lr-wpan-phy.h.

Referenced by EndEd(), EndRx(), PlmeEdRequest(), SetPhyOption(), and StartRx().

◆ m_edRequest

EventId ns3::LrWpanPhy::m_edRequest
private

Scheduler event of a currently running ED request.

Definition at line 945 of file lr-wpan-phy.h.

Referenced by CancelEd(), DoDispose(), EndRx(), PlmeEdRequest(), and StartRx().

◆ m_errorModel

Ptr<LrWpanErrorModel> ns3::LrWpanPhy::m_errorModel
private

The error model describing the bit and packet error rates.

Definition at line 822 of file lr-wpan-phy.h.

Referenced by CheckInterference(), DoDispose(), GetErrorModel(), SetErrorModel(), and SetPhyOption().

◆ m_isRxCanceled

bool ns3::LrWpanPhy::m_isRxCanceled
private

Indicates if the reception of frame has been canceled.

Definition at line 907 of file lr-wpan-phy.h.

Referenced by LrWpanPhy(), EndRx(), and PlmeSetTRXStateRequest().

◆ m_mobility

Ptr<MobilityModel> ns3::LrWpanPhy::m_mobility
private

The mobility model used by the PHY.

Definition at line 792 of file lr-wpan-phy.h.

Referenced by DoDispose(), DoInitialize(), GetMobility(), and SetMobility().

◆ m_noise

Ptr<const SpectrumValue> ns3::LrWpanPhy::m_noise
private

The spectral density for for the noise.

Definition at line 817 of file lr-wpan-phy.h.

Referenced by CheckInterference(), DoDispose(), GetNoisePowerSpectralDensity(), SetNoisePowerSpectralDensity(), SetRxSensitivity(), and StartRx().

◆ m_pdDataConfirmCallback

PdDataConfirmCallback ns3::LrWpanPhy::m_pdDataConfirmCallback
private

This callback is used to report packet transmission status to the MAC layer.

See IEEE 802.15.4-2006, section 6.2.1.2.

Definition at line 852 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndTx(), PdDataRequest(), PlmeSetAttributeRequest(), and SetPdDataConfirmCallback().

◆ m_pdDataIndicationCallback

PdDataIndicationCallback ns3::LrWpanPhy::m_pdDataIndicationCallback
private

This callback is used to notify incoming packets to the MAC layer.

See IEEE 802.15.4-2006, section 6.2.1.3.

Definition at line 846 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndRx(), and SetPdDataIndicationCallback().

◆ m_pdDataRequest

EventId ns3::LrWpanPhy::m_pdDataRequest
private

Scheduler event of a currently running data transmission request.

Definition at line 955 of file lr-wpan-phy.h.

Referenced by DoDispose(), PdDataRequest(), and PlmeSetAttributeRequest().

◆ m_phyOption

LrWpanPhyOption ns3::LrWpanPhy::m_phyOption
private

◆ m_phyPIBAttributes

◆ m_phyRxBeginTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanPhy::m_phyRxBeginTrace
private

The trace source fired when a packet begins the reception process from the medium.

See also
class CallBackTraceSource

Definition at line 723 of file lr-wpan-phy.h.

Referenced by GetTypeId(), and StartRx().

◆ m_phyRxDropTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanPhy::m_phyRxDropTrace
private

The trace source fired when the phy layer drops a packet it has received.

(Destruction of a packet due to interference, post-rx corruption or cancellation of packet rx)

See also
class CallBackTraceSource

Definition at line 743 of file lr-wpan-phy.h.

Referenced by EndRx(), GetTypeId(), and StartRx().

◆ m_phyRxEndTrace

TracedCallback<Ptr<const Packet>, double> ns3::LrWpanPhy::m_phyRxEndTrace
private

The trace source fired when a packet ends the reception process from the medium.

In essence, the notional event of receiving all the energy of a signal is traced. The received completed signal might represent a complete packet or a packet that is later on dropped because of interference, cancellation or post-rx corruption. Second quantity is the received SINR (LQI).

See also
class CallBackTraceSource

Definition at line 734 of file lr-wpan-phy.h.

Referenced by EndRx(), and GetTypeId().

◆ m_phyTxBeginTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanPhy::m_phyTxBeginTrace
private

The trace source fired when a packet begins the transmission process on the medium.

See also
class CallBackTraceSource

Definition at line 699 of file lr-wpan-phy.h.

Referenced by GetTypeId(), and PdDataRequest().

◆ m_phyTxDropTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanPhy::m_phyTxDropTrace
private

The trace source fired when the phy layer drops a packet as it tries to transmit it.

See also
class CallBackTraceSource

Definition at line 715 of file lr-wpan-phy.h.

Referenced by EndTx(), GetTypeId(), and PdDataRequest().

◆ m_phyTxEndTrace

TracedCallback<Ptr<const Packet> > ns3::LrWpanPhy::m_phyTxEndTrace
private

The trace source fired when a packet ends the transmission process on the medium.

See also
class CallBackTraceSource

Definition at line 707 of file lr-wpan-phy.h.

Referenced by EndTx(), and GetTypeId().

◆ m_plmeCcaConfirmCallback

PlmeCcaConfirmCallback ns3::LrWpanPhy::m_plmeCcaConfirmCallback
private

This callback is used to report CCA status to the MAC or CSMA/CA.

See IEEE 802.15.4-2006, section 6.2.2.2.

Definition at line 858 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndCca(), PlmeCcaRequest(), PlmeSetTRXStateRequest(), and SetPlmeCcaConfirmCallback().

◆ m_plmeEdConfirmCallback

PlmeEdConfirmCallback ns3::LrWpanPhy::m_plmeEdConfirmCallback
private

This callback is used to report ED status to the MAC.

See IEEE 802.15.4-2006, section 6.2.2.4.

Definition at line 864 of file lr-wpan-phy.h.

Referenced by CancelEd(), DoDispose(), EndEd(), PlmeEdRequest(), and SetPlmeEdConfirmCallback().

◆ m_plmeGetAttributeConfirmCallback

PlmeGetAttributeConfirmCallback ns3::LrWpanPhy::m_plmeGetAttributeConfirmCallback
private

This callback is used to report requested attribute values back to the MAC.

See IEEE 802.15.4-2006, section 6.2.2.6.

Definition at line 870 of file lr-wpan-phy.h.

Referenced by DoDispose(), PlmeGetAttributeRequest(), and SetPlmeGetAttributeConfirmCallback().

◆ m_plmeSetAttributeConfirmCallback

PlmeSetAttributeConfirmCallback ns3::LrWpanPhy::m_plmeSetAttributeConfirmCallback
private

This callback is used to report attribute set results back to the MAC.

See IEEE 802.15.4-2006, section 6.2.2.10.

Definition at line 882 of file lr-wpan-phy.h.

Referenced by DoDispose(), PlmeSetAttributeRequest(), and SetPlmeSetAttributeConfirmCallback().

◆ m_plmeSetTRXStateConfirmCallback

PlmeSetTRXStateConfirmCallback ns3::LrWpanPhy::m_plmeSetTRXStateConfirmCallback
private

This callback is used to report transceiver state change status to the MAC.

See IEEE 802.15.4-2006, section 6.2.2.8.

Definition at line 876 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndSetTRXState(), EndTx(), PlmeSetAttributeRequest(), PlmeSetTRXStateRequest(), and SetPlmeSetTRXStateConfirmCallback().

◆ m_postReceptionErrorModel

Ptr<ErrorModel> ns3::LrWpanPhy::m_postReceptionErrorModel
private

Error model for receive packet events.

Definition at line 962 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndRx(), GetTypeId(), and SetPostReceptionErrorModel().

◆ m_random

Ptr<UniformRandomVariable> ns3::LrWpanPhy::m_random
private

Uniform random variable stream.

Definition at line 960 of file lr-wpan-phy.h.

Referenced by LrWpanPhy(), AssignStreams(), CheckInterference(), and DoDispose().

◆ m_rxLastUpdate

Time ns3::LrWpanPhy::m_rxLastUpdate
private

Timestamp of the last calculation of the PER of a packet currently received.

Definition at line 919 of file lr-wpan-phy.h.

Referenced by CheckInterference(), SetPhyOption(), and StartRx().

◆ m_rxSensitivity

double ns3::LrWpanPhy::m_rxSensitivity
private

The receiver sensitivity.

Definition at line 902 of file lr-wpan-phy.h.

Referenced by EndCca(), EndEd(), GetRxSensitivity(), PlmeSetAttributeRequest(), and SetRxSensitivity().

◆ m_setTRXState

EventId ns3::LrWpanPhy::m_setTRXState
private

Scheduler event of a currently running deferred transceiver state switch.

Definition at line 950 of file lr-wpan-phy.h.

Referenced by DoDispose(), EndTx(), PdDataRequest(), PlmeSetAttributeRequest(), PlmeSetTRXStateRequest(), and StartRx().

◆ m_signal

Ptr<LrWpanInterferenceHelper> ns3::LrWpanPhy::m_signal
private

The accumulated signals currently received by the transceiver, including the signal of a possibly received packet, as well as all signals considered noise.

Definition at line 914 of file lr-wpan-phy.h.

Referenced by CheckInterference(), DoDispose(), EndCca(), EndEd(), EndRx(), GetCurrentSignalPsd(), SetRxSensitivity(), and StartRx().

◆ m_trxState

◆ m_trxStateLogger

TracedCallback<Time, LrWpanPhyEnumeration, LrWpanPhyEnumeration> ns3::LrWpanPhy::m_trxStateLogger
private

The trace source fired when the phy layer changes the transceiver state.

See also
class CallBackTraceSource
Deprecated:
The LrWpanPhyEnumeration state is now accessible as the TracedValue TrxStateValue. This TracedCallback will be removed in a future release.

Definition at line 753 of file lr-wpan-phy.h.

Referenced by ChangeTrxState(), and GetTypeId().

◆ m_trxStatePending

LrWpanPhyEnumeration ns3::LrWpanPhy::m_trxStatePending
private

The next pending state to applied after the current action of the PHY is completed.

Definition at line 839 of file lr-wpan-phy.h.

Referenced by LrWpanPhy(), DoDispose(), EndSetTRXState(), EndTx(), PlmeSetAttributeRequest(), and PlmeSetTRXStateRequest().

◆ m_txPsd

Ptr<SpectrumValue> ns3::LrWpanPhy::m_txPsd
private

The transmit power spectral density.

Definition at line 812 of file lr-wpan-phy.h.

Referenced by DoDispose(), GetRxSpectrumModel(), PdDataRequest(), PlmeSetAttributeRequest(), SetRxSensitivity(), and SetTxPowerSpectralDensity().


The documentation for this class was generated from the following files: