A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lrwpan::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::lrwpan::LrWpanPhy:
+ Collaboration diagram for ns3::lrwpan::LrWpanPhy:

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Private Types

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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

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

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

Member Typedef Documentation

◆ PacketAndStatus

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

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

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

◆ StateTracedCallback

typedef void(* ns3::lrwpan::LrWpanPhy::StateTracedCallback) (Time time, PhyEnumeration oldState, PhyEnumeration 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 560 of file lr-wpan-phy.h.

Constructor & Destructor Documentation

◆ LrWpanPhy()

ns3::lrwpan::LrWpanPhy::LrWpanPhy ( )

Default constructor.

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

References ChangeTrxState(), ns3::CreateObject(), ns3::lrwpan::IEEE_802_15_4_2_4GHZ_OQPSK, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, m_isRxCanceled, m_phyPIBAttributes, m_random, m_trxState, m_trxStatePending, ns3::lrwpan::PhyPibAttributes::phyCCAMode, ns3::lrwpan::PhyPibAttributes::phyTransmitPower, and SetPhyOption().

+ Here is the call graph for this function:

◆ ~LrWpanPhy()

ns3::lrwpan::LrWpanPhy::~LrWpanPhy ( )
override

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

Member Function Documentation

◆ AssignStreams()

int64_t ns3::lrwpan::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 1887 of file lr-wpan-phy.cc.

References m_random, and NS_LOG_FUNCTION.

◆ CalculateTxTime()

Time ns3::lrwpan::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 1561 of file lr-wpan-phy.cc.

References GetDataOrSymbolRate(), GetPpduHeaderTxTime(), 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::lrwpan::LrWpanPhy::CancelEd ( PhyEnumeration 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 1362 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, ns3::lrwpan::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::lrwpan::LrWpanPhy::CcaCancel ( )

Cancel an ongoing CCA request.

Definition at line 727 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::lrwpan::LrWpanPhy::ChangeTrxState ( PhyEnumeration newState)
private

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

Parameters
newStatethe new state

Definition at line 1345 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::lrwpan::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 982 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, NS_LOG_FUNCTION, ns3::lrwpan::PhyPibAttributes::phyChannelsSupported, and ns3::lrwpan::PhyPibAttributes::phyCurrentPage.

Referenced by PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

◆ CheckInterference()

void ns3::lrwpan::LrWpanPhy::CheckInterference ( )
private

Check if the interference destroys a frame currently received.

Called whenever a change in interference is detected.

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

References ns3::lrwpan::LrWpanLqiTag::Get(), GetDataOrSymbolRate(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, m_currentRxPacket, m_errorModel, m_noise, m_phyPIBAttributes, m_random, m_rxLastUpdate, m_signal, m_trxState, ns3::Time::MS, ns3::Simulator::Now(), NS_LOG_WARN, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::lrwpan::LrWpanLqiTag::Set(), and ns3::lrwpan::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::lrwpan::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 1881 of file lr-wpan-phy.cc.

Referenced by SetRxSensitivity().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::lrwpan::LrWpanPhy::DoDispose ( )
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 245 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::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::lrwpan::LrWpanPhy::DoInitialize ( )
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 220 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::lrwpan::LrWpanPhy::EndCca ( )
private

Called at the end of the CCA.

The channel condition (busy or idle) is reported to the MAC or CSMA/CA.

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

References ns3::lrwpan::IEEE_802_15_4_PHY_BUSY, ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_UNSPECIFIED, ns3::Callback< R, UArgs >::IsNull(), m_ccaPeakPower, m_phyPIBAttributes, m_plmeCcaConfirmCallback, m_rxSensitivity, m_signal, m_trxState, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::lrwpan::PhyPibAttributes::phyCCAMode, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, PhyIsBusy(), and ns3::lrwpan::LrWpanSpectrumValueHelper::TotalAvgPower().

Referenced by PlmeCcaRequest().

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

◆ EndEd()

void ns3::lrwpan::LrWpanPhy::EndEd ( )
private

Called at the end of the ED procedure.

The average energy detected is reported to the MAC.

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

References ns3::lrwpan::EdPower::averagePower, ns3::Time::GetTimeStep(), ns3::lrwpan::IEEE_802_15_4_PHY_SUCCESS, ns3::Callback< R, UArgs >::IsNull(), ns3::lrwpan::EdPower::lastUpdate, m_edPower, m_phyPIBAttributes, m_plmeEdConfirmCallback, m_rxSensitivity, m_signal, ns3::lrwpan::EdPower::measurementLength, ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, and ns3::lrwpan::LrWpanSpectrumValueHelper::TotalAvgPower().

Referenced by PlmeEdRequest().

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

◆ EndRx()

void ns3::lrwpan::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 firing 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 539 of file lr-wpan-phy.cc.

References ns3::lrwpan::EdPower::averagePower, ChangeTrxState(), CheckInterference(), ns3::DynamicCast(), ns3::lrwpan::LrWpanLqiTag::Get(), ns3::Time::GetTimeStep(), ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::EventId::IsExpired(), ns3::Callback< R, UArgs >::IsNull(), ns3::lrwpan::EdPower::lastUpdate, m_currentRxPacket, m_device, m_edPower, m_edRequest, m_isRxCanceled, m_pdDataIndicationCallback, m_phyPIBAttributes, m_phyRxDropTrace, m_phyRxEndTrace, m_postReceptionErrorModel, m_signal, ns3::lrwpan::EdPower::measurementLength, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, and ns3::lrwpan::LrWpanSpectrumValueHelper::TotalAvgPower().

Referenced by StartRx().

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

◆ EndSetTRXState()

void ns3::lrwpan::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 1489 of file lr-wpan-phy.cc.

References ChangeTrxState(), ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::lrwpan::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::lrwpan::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 firing the appropriate trace sources and confirm callbacks to the MAC.

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

References ChangeTrxState(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_TX, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_SUCCESS, ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, ns3::lrwpan::IEEE_802_15_4_PHY_TX_ON, ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsPending(), 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::lrwpan::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 340 of file lr-wpan-phy.cc.

References m_antenna.

◆ GetChannel()

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

Get the currently attached channel.

Returns
the channel

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

References m_channel, and NS_LOG_FUNCTION.

◆ GetCurrentChannelNum()

uint8_t ns3::lrwpan::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 1580 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, and ns3::lrwpan::PhyPibAttributes::phyCurrentChannel.

◆ GetCurrentPage()

uint8_t ns3::lrwpan::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 1574 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, and ns3::lrwpan::PhyPibAttributes::phyCurrentPage.

◆ GetCurrentSignalPsd()

double ns3::lrwpan::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 1844 of file lr-wpan-phy.cc.

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

+ Here is the call graph for this function:

◆ GetDataOrSymbolRate()

double ns3::lrwpan::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 1586 of file lr-wpan-phy.cc.

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

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

+ Here is the caller graph for this function:

◆ GetDevice()

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

Get the associated NetDevice instance.

Returns
a Ptr to the associated NetDevice instance

Implements ns3::SpectrumPhy.

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

References m_device.

◆ GetErrorModel()

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

get the error model in use

Returns
pointer to LrWpanErrorModel in use

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

References m_errorModel, and NS_LOG_FUNCTION.

◆ GetMobility()

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

Get the associated MobilityModel instance.

Returns
a Ptr to the associated MobilityModel instance

Implements ns3::SpectrumPhy.

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

References m_mobility.

◆ GetMyPhyOption()

PhyOption ns3::lrwpan::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 1778 of file lr-wpan-phy.cc.

References m_phyOption, and NS_LOG_FUNCTION.

◆ GetNoisePowerSpectralDensity()

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

Get the noise power spectral density.

Returns
the Noise Power Spectral Density

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

References m_noise, and NS_LOG_FUNCTION.

◆ GetNominalTxPowerFromPib()

int8_t ns3::lrwpan::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 1853 of file lr-wpan-phy.cc.

References NS_LOG_FUNCTION, and ns3::lrwpan::phyTransmitPower.

Referenced by PlmeSetAttributeRequest(), and SetRxSensitivity().

+ Here is the caller graph for this function:

◆ GetPhySHRDuration()

uint64_t ns3::lrwpan::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 1825 of file lr-wpan-phy.cc.

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

Referenced by PlmeGetAttributeRequest().

+ Here is the caller graph for this function:

◆ GetPhySymbolsPerOctet()

double ns3::lrwpan::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 1835 of file lr-wpan-phy.cc.

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

Referenced by PlmeGetAttributeRequest().

+ Here is the caller graph for this function:

◆ GetPpduHeaderTxTime()

Time ns3::lrwpan::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 1605 of file lr-wpan-phy.cc.

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

Referenced by CalculateTxTime().

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

◆ GetRxSensitivity()

double ns3::lrwpan::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 1770 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::lrwpan::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 326 of file lr-wpan-phy.cc.

References m_txPsd, and NS_LOG_FUNCTION.

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

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

References ns3::TypeId::AddDeprecatedName(), m_phyRxBeginTrace, m_phyRxDropTrace, m_phyRxEndTrace, m_phyTxBeginTrace, m_phyTxDropTrace, m_phyTxEndTrace, m_postReceptionErrorModel, m_trxState, m_trxStateLogger, ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ PageSupported()

bool ns3::lrwpan::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 1000 of file lr-wpan-phy.cc.

References m_phyPIBAttributes, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, and ns3::lrwpan::PhyPibAttributes::phyChannelsSupported.

Referenced by PlmeSetAttributeRequest().

+ Here is the caller graph for this function:

◆ PdDataRequest()

void ns3::lrwpan::LrWpanPhy::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)

Parameters
psduLengthnumber of bytes in the PSDU
pthe packet to be transmitted

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

References ns3::lrwpan::aMaxPhyPacketSize, CalculateTxTime(), ChangeTrxState(), ns3::Create(), ns3::CreateObject(), EndTx(), ns3::Object::GetObject(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_TX, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, ns3::lrwpan::IEEE_802_15_4_PHY_TX_ON, ns3::lrwpan::IEEE_802_15_4_PHY_UNSPECIFIED, ns3::Callback< R, UArgs >::IsNull(), ns3::EventId::IsPending(), m_antenna, m_channel, m_currentTxPacket, m_pdDataConfirmCallback, m_pdDataRequest, m_phyTxBeginTrace, m_phyTxDropTrace, m_setTRXState, m_trxState, m_txPsd, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ PhyIsBusy()

bool ns3::lrwpan::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 1354 of file lr-wpan-phy.cc.

References ns3::lrwpan::IEEE_802_15_4_PHY_BUSY, ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, ns3::lrwpan::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::lrwpan::LrWpanPhy::PlmeCcaRequest ( )

IEEE 802.15.4-2006 section 6.2.2.1 PLME-CCA.request Perform a CCA per section 6.9.9.

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

References EndCca(), GetDataOrSymbolRate(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY, ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, ns3::Callback< R, UArgs >::IsNull(), m_ccaPeakPower, m_ccaRequest, m_plmeCcaConfirmCallback, m_trxState, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Seconds().

+ Here is the call graph for this function:

◆ PlmeEdRequest()

void ns3::lrwpan::LrWpanPhy::PlmeEdRequest ( )

IEEE 802.15.4-2006 section 6.2.2.3 PLME-ED.request Perform an ED per section 6.9.7.

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

References ns3::lrwpan::EdPower::averagePower, EndEd(), GetDataOrSymbolRate(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_TX, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::lrwpan::IEEE_802_15_4_PHY_TX_ON, ns3::Callback< R, UArgs >::IsNull(), ns3::lrwpan::EdPower::lastUpdate, m_edPower, m_edRequest, m_plmeEdConfirmCallback, m_trxState, ns3::lrwpan::EdPower::measurementLength, ns3::Simulator::Now(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and ns3::Seconds().

Referenced by LrWpanEdTestCase::DoRun().

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

◆ PlmeGetAttributeRequest()

void ns3::lrwpan::LrWpanPhy::PlmeGetAttributeRequest ( PhyPibAttributeIdentifier 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.

Parameters
idthe attributed identifier

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

References ns3::Create(), GetPhySHRDuration(), GetPhySymbolsPerOctet(), ns3::lrwpan::IEEE_802_15_4_PHY_SUCCESS, ns3::lrwpan::IEEE_802_15_4_PHY_UNSUPPORTED_ATTRIBUTE, ns3::Callback< R, UArgs >::IsNull(), m_phyPIBAttributes, m_plmeGetAttributeConfirmCallback, NS_LOG_FUNCTION, ns3::lrwpan::phyCurrentChannel, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::lrwpan::phyCurrentPage, ns3::lrwpan::PhyPibAttributes::phyCurrentPage, ns3::lrwpan::phySHRDuration, and ns3::lrwpan::phySymbolsPerOctet.

+ Here is the call graph for this function:

◆ PlmeSetAttributeRequest()

void ns3::lrwpan::LrWpanPhy::PlmeSetAttributeRequest ( PhyPibAttributeIdentifier id,
Ptr< PhyPibAttributes > 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 1023 of file lr-wpan-phy.cc.

References ns3::EventId::Cancel(), ChannelSupported(), ns3::lrwpan::LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity(), GetNominalTxPowerFromPib(), ns3::lrwpan::IEEE_802_15_4_2_4GHZ_OQPSK, ns3::lrwpan::IEEE_802_15_4_780MHZ_OQPSK, ns3::lrwpan::IEEE_802_15_4_868MHZ_ASK, ns3::lrwpan::IEEE_802_15_4_868MHZ_BPSK, ns3::lrwpan::IEEE_802_15_4_868MHZ_OQPSK, ns3::lrwpan::IEEE_802_15_4_915MHZ_ASK, ns3::lrwpan::IEEE_802_15_4_915MHZ_BPSK, ns3::lrwpan::IEEE_802_15_4_915MHZ_OQPSK, ns3::lrwpan::IEEE_802_15_4_950MHZ_BPSK, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_INVALID_PARAMETER, ns3::lrwpan::IEEE_802_15_4_PHY_SUCCESS, ns3::lrwpan::IEEE_802_15_4_PHY_TRX_OFF, ns3::lrwpan::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::lrwpan::phyCCAMode, ns3::lrwpan::PhyPibAttributes::phyCCAMode, ns3::lrwpan::phyChannelsSupported, ns3::lrwpan::PhyPibAttributes::phyChannelsSupported, ns3::lrwpan::phyCurrentChannel, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::lrwpan::phyCurrentPage, ns3::lrwpan::PhyPibAttributes::phyCurrentPage, PhyIsBusy(), ns3::lrwpan::PhyPibAttributes::phyTransmitPower, ns3::lrwpan::phyTransmitPower, SetRxSensitivity(), and WToDbm().

+ Here is the call graph for this function:

◆ PlmeSetTRXStateRequest()

◆ SetAntenna()

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

Set the attached antenna.

Parameters
athe antenna

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

References m_antenna, and NS_LOG_FUNCTION.

◆ SetChannel()

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

Set the channel attached to this device.

Parameters
cthe channel

Implements ns3::SpectrumPhy.

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

References m_channel, and NS_LOG_FUNCTION.

◆ SetDevice()

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

Set the associated NetDevice instance.

Parameters
dthe NetDevice instance

Implements ns3::SpectrumPhy.

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

References m_device, and NS_LOG_FUNCTION.

◆ SetErrorModel()

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

set the error model to use

Parameters
epointer to LrWpanErrorModel to use

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

References m_errorModel, NS_ASSERT, and NS_LOG_FUNCTION.

◆ SetMobility()

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

Set the mobility model associated with this device.

Parameters
mthe mobility model

Implements ns3::SpectrumPhy.

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

References m_mobility, and NS_LOG_FUNCTION.

◆ SetNoisePowerSpectralDensity()

void ns3::lrwpan::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 1794 of file lr-wpan-phy.cc.

References m_noise, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

◆ SetPdDataConfirmCallback()

void ns3::lrwpan::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 1303 of file lr-wpan-phy.cc.

References m_pdDataConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPdDataIndicationCallback()

void ns3::lrwpan::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 1296 of file lr-wpan-phy.cc.

References m_pdDataIndicationCallback, and NS_LOG_FUNCTION.

◆ SetPhyOption()

void ns3::lrwpan::LrWpanPhy::SetPhyOption ( PhyOption phyOption)

◆ SetPlmeCcaConfirmCallback()

void ns3::lrwpan::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 1310 of file lr-wpan-phy.cc.

References m_plmeCcaConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeEdConfirmCallback()

void ns3::lrwpan::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 1317 of file lr-wpan-phy.cc.

References m_plmeEdConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeGetAttributeConfirmCallback()

void ns3::lrwpan::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 1324 of file lr-wpan-phy.cc.

References m_plmeGetAttributeConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeSetAttributeConfirmCallback()

void ns3::lrwpan::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 1338 of file lr-wpan-phy.cc.

References m_plmeSetAttributeConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPlmeSetTRXStateConfirmCallback()

void ns3::lrwpan::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 1331 of file lr-wpan-phy.cc.

References m_plmeSetTRXStateConfirmCallback, and NS_LOG_FUNCTION.

◆ SetPostReceptionErrorModel()

void ns3::lrwpan::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 1895 of file lr-wpan-phy.cc.

References m_postReceptionErrorModel, and NS_LOG_FUNCTION.

◆ SetRxSensitivity()

void ns3::lrwpan::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 1723 of file lr-wpan-phy.cc.

References ns3::Create(), ns3::lrwpan::LrWpanSpectrumValueHelper::CreateNoisePowerSpectralDensity(), ns3::lrwpan::LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity(), DbmToW(), GetNominalTxPowerFromPib(), ns3::lrwpan::IEEE_802_15_4_915MHZ_BPSK, ns3::lrwpan::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::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::lrwpan::PhyPibAttributes::phyTransmitPower, and ns3::lrwpan::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::lrwpan::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 1785 of file lr-wpan-phy.cc.

References m_txPsd, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.

◆ StartRx()

◆ WToDbm()

double ns3::lrwpan::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 1875 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::lrwpan::LrWpanPhy::m_antenna
private

The antenna used by the transceiver.

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

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

◆ m_ccaPeakPower

double ns3::lrwpan::LrWpanPhy::m_ccaPeakPower
private

Helper value for the peak power value during CCA.

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

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

◆ m_ccaRequest

EventId ns3::lrwpan::LrWpanPhy::m_ccaRequest
private

Scheduler event of a currently running CCA request.

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

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

◆ m_channel

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

The channel attached to this transceiver.

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

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

◆ m_currentRxPacket

std::pair<Ptr<LrWpanSpectrumSignalParameters>, bool> ns3::lrwpan::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 917 of file lr-wpan-phy.h.

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

◆ m_currentTxPacket

PacketAndStatus ns3::lrwpan::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 925 of file lr-wpan-phy.h.

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

◆ m_device

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

The configured net device.

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

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

◆ m_edPower

EdPower ns3::lrwpan::LrWpanPhy::m_edPower
private

Helper value for tracking the average power during ED.

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

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

◆ m_edRequest

EventId ns3::lrwpan::LrWpanPhy::m_edRequest
private

Scheduler event of a currently running ED request.

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

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

◆ m_errorModel

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

The error model describing the bit and packet error rates.

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

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

◆ m_isRxCanceled

bool ns3::lrwpan::LrWpanPhy::m_isRxCanceled
private

Indicates if the reception of frame has been canceled.

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

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

◆ m_mobility

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

The mobility model used by the PHY.

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

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

◆ m_noise

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

The spectral density for for the noise.

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

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

◆ m_pdDataConfirmCallback

PdDataConfirmCallback ns3::lrwpan::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 842 of file lr-wpan-phy.h.

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

◆ m_pdDataIndicationCallback

PdDataIndicationCallback ns3::lrwpan::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 836 of file lr-wpan-phy.h.

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

◆ m_pdDataRequest

EventId ns3::lrwpan::LrWpanPhy::m_pdDataRequest
private

Scheduler event of a currently running data transmission request.

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

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

◆ m_phyOption

PhyOption ns3::lrwpan::LrWpanPhy::m_phyOption
private

◆ m_phyPIBAttributes

◆ m_phyRxBeginTrace

TracedCallback<Ptr<const Packet> > ns3::lrwpan::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 712 of file lr-wpan-phy.h.

Referenced by GetTypeId(), and StartRx().

◆ m_phyRxDropTrace

TracedCallback<Ptr<const Packet> > ns3::lrwpan::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 732 of file lr-wpan-phy.h.

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

◆ m_phyRxEndTrace

TracedCallback<Ptr<const Packet>, double> ns3::lrwpan::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 723 of file lr-wpan-phy.h.

Referenced by EndRx(), and GetTypeId().

◆ m_phyTxBeginTrace

TracedCallback<Ptr<const Packet> > ns3::lrwpan::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 688 of file lr-wpan-phy.h.

Referenced by GetTypeId(), and PdDataRequest().

◆ m_phyTxDropTrace

TracedCallback<Ptr<const Packet> > ns3::lrwpan::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 704 of file lr-wpan-phy.h.

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

◆ m_phyTxEndTrace

TracedCallback<Ptr<const Packet> > ns3::lrwpan::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 696 of file lr-wpan-phy.h.

Referenced by EndTx(), and GetTypeId().

◆ m_plmeCcaConfirmCallback

PlmeCcaConfirmCallback ns3::lrwpan::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 848 of file lr-wpan-phy.h.

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

◆ m_plmeEdConfirmCallback

PlmeEdConfirmCallback ns3::lrwpan::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 854 of file lr-wpan-phy.h.

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

◆ m_plmeGetAttributeConfirmCallback

PlmeGetAttributeConfirmCallback ns3::lrwpan::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 860 of file lr-wpan-phy.h.

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

◆ m_plmeSetAttributeConfirmCallback

PlmeSetAttributeConfirmCallback ns3::lrwpan::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 872 of file lr-wpan-phy.h.

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

◆ m_plmeSetTRXStateConfirmCallback

PlmeSetTRXStateConfirmCallback ns3::lrwpan::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 866 of file lr-wpan-phy.h.

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

◆ m_postReceptionErrorModel

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

Error model for receive packet events.

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

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

◆ m_random

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

Uniform random variable stream.

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

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

◆ m_rxLastUpdate

Time ns3::lrwpan::LrWpanPhy::m_rxLastUpdate
private

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

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

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

◆ m_rxSensitivity

double ns3::lrwpan::LrWpanPhy::m_rxSensitivity
private

The receiver sensitivity.

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

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

◆ m_setTRXState

EventId ns3::lrwpan::LrWpanPhy::m_setTRXState
private

Scheduler event of a currently running deferred transceiver state switch.

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

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

◆ m_signal

Ptr<LrWpanInterferenceHelper> ns3::lrwpan::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 904 of file lr-wpan-phy.h.

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

◆ m_trxState

◆ m_trxStateLogger

TracedCallback<Time, PhyEnumeration, PhyEnumeration> ns3::lrwpan::LrWpanPhy::m_trxStateLogger
private

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

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

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

Referenced by ChangeTrxState(), and GetTypeId().

◆ m_trxStatePending

PhyEnumeration ns3::lrwpan::LrWpanPhy::m_trxStatePending
private

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

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

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

◆ m_txPsd

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

The transmit power spectral density.

Definition at line 802 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: