Make LrWpanPhy a SpectrumPhy so we can enable the eventual modeling of device interference. More...
#include "lr-wpan-phy.h"
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< Object > | GetAntenna () const override |
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception. | |
Ptr< SpectrumChannel > | GetChannel () |
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< NetDevice > | GetDevice () const override |
Get the associated NetDevice instance. | |
Ptr< LrWpanErrorModel > | GetErrorModel () const |
get the error model in use | |
Ptr< MobilityModel > | GetMobility () const override |
Get the associated MobilityModel instance. | |
Ptr< const SpectrumValue > | GetNoisePowerSpectralDensity () |
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 SpectrumModel > | GetRxSpectrumModel () 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 | |
SpectrumPhy & | operator= (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< Object > | GetObject () 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< Object > | GetObject (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. | |
SimpleRefCount & | operator= (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< AntennaModel > | m_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< SpectrumChannel > | m_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< NetDevice > | m_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< LrWpanErrorModel > | m_errorModel |
The error model describing the bit and packet error rates. | |
bool | m_isRxCanceled |
Indicates if the reception of frame has been canceled. | |
Ptr< MobilityModel > | m_mobility |
The mobility model used by the PHY. | |
Ptr< const SpectrumValue > | m_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 >, double > | m_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< ErrorModel > | m_postReceptionErrorModel |
Error model for receive packet events. | |
Ptr< UniformRandomVariable > | m_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< LrWpanInterferenceHelper > | m_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< PhyEnumeration > | m_trxState |
The current transceiver state. | |
TracedCallback< Time, PhyEnumeration, PhyEnumeration > | m_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< SpectrumValue > | m_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. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Make LrWpanPhy a SpectrumPhy so we can enable the eventual modeling of device interference.
Definition at line 262 of file lr-wpan-phy.h.
|
private |
The second is true if the first is flagged as error/invalid.
Definition at line 568 of file lr-wpan-phy.h.
typedef void(* ns3::lrwpan::LrWpanPhy::StateTracedCallback) (Time time, PhyEnumeration oldState, PhyEnumeration newState) |
TracedCallback signature for Trx state change events.
[in] | time | The time of the state change. |
[in] | oldState | The old state. |
[in] | newState | The new state. |
TrxStateValue
. The TrxState
TracedCallback will be removed in a future release. Definition at line 560 of file lr-wpan-phy.h.
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().
|
override |
Definition at line 215 of file lr-wpan-phy.cc.
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.
stream | first stream index to use |
Definition at line 1887 of file lr-wpan-phy.cc.
References m_random, and NS_LOG_FUNCTION.
Calculate the time required for sending the given packet, including preamble, SFD and PHR.
packet | the packet for which the transmission time should be calculated |
Definition at line 1561 of file lr-wpan-phy.cc.
References GetDataOrSymbolRate(), GetPpduHeaderTxTime(), NS_LOG_FUNCTION, and ns3::Seconds().
Referenced by PdDataRequest().
|
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.
state | the 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().
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.
|
private |
Change the PHY state to the given new state, firing the state change trace.
newState | the 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().
|
private |
Check if the given channel is supported by the PHY.
channel | the channel to check |
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().
|
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().
Transforms decibels milliwatts (dBm) to watts (W).
dbm | The DBm that will be converted to Watts. |
Definition at line 1881 of file lr-wpan-phy.cc.
Referenced by SetRxSensitivity().
|
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.
|
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.
|
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().
|
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().
|
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.
params | signal 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().
|
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().
|
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().
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.
Implements ns3::SpectrumPhy.
Definition at line 340 of file lr-wpan-phy.cc.
References m_antenna.
Ptr< SpectrumChannel > ns3::lrwpan::LrWpanPhy::GetChannel | ( | ) |
Get the currently attached channel.
Definition at line 319 of file lr-wpan-phy.cc.
References m_channel, and NS_LOG_FUNCTION.
uint8_t ns3::lrwpan::LrWpanPhy::GetCurrentChannelNum | ( | ) | const |
Get The current channel number in use in this PHY from the PIB attributes.
Definition at line 1580 of file lr-wpan-phy.cc.
References m_phyPIBAttributes, and ns3::lrwpan::PhyPibAttributes::phyCurrentChannel.
uint8_t ns3::lrwpan::LrWpanPhy::GetCurrentPage | ( | ) | const |
Get The current channel page number in use in this PHY from the PIB attributes.
Definition at line 1574 of file lr-wpan-phy.cc.
References m_phyPIBAttributes, and ns3::lrwpan::PhyPibAttributes::phyCurrentPage.
double ns3::lrwpan::LrWpanPhy::GetCurrentSignalPsd | ( | ) |
Get the current accumulated sum of signals in the transceiver including signals considered as interference.
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().
double ns3::lrwpan::LrWpanPhy::GetDataOrSymbolRate | ( | bool | isData | ) |
implement PLME SetAttribute confirm SAP bit rate is in bit/s.
Symbol rate is in symbol/s.
isData | is true for data rate or false for symbol rate |
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().
Get the associated NetDevice instance.
Implements ns3::SpectrumPhy.
Definition at line 286 of file lr-wpan-phy.cc.
References m_device.
Ptr< LrWpanErrorModel > ns3::lrwpan::LrWpanPhy::GetErrorModel | ( | ) | const |
get the error model in use
Definition at line 1818 of file lr-wpan-phy.cc.
References m_errorModel, and NS_LOG_FUNCTION.
|
overridevirtual |
Get the associated MobilityModel instance.
Implements ns3::SpectrumPhy.
Definition at line 292 of file lr-wpan-phy.cc.
References m_mobility.
|
private |
Get the currently configured PHY option.
See IEEE 802.15.4-2006, section 6.1.2, Table 2.
Definition at line 1778 of file lr-wpan-phy.cc.
References m_phyOption, and NS_LOG_FUNCTION.
Ptr< const SpectrumValue > ns3::lrwpan::LrWpanPhy::GetNoisePowerSpectralDensity | ( | ) |
Get the noise power spectral density.
Definition at line 1803 of file lr-wpan-phy.cc.
References m_noise, and NS_LOG_FUNCTION.
|
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
.
phyTransmitPower | the PIB attribute |
Definition at line 1853 of file lr-wpan-phy.cc.
References NS_LOG_FUNCTION, and ns3::lrwpan::phyTransmitPower.
Referenced by PlmeSetAttributeRequest(), and SetRxSensitivity().
uint64_t ns3::lrwpan::LrWpanPhy::GetPhySHRDuration | ( | ) | const |
Get the duration of the SHR (preamble and SFD) in symbols, depending on the currently selected channel.
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().
double ns3::lrwpan::LrWpanPhy::GetPhySymbolsPerOctet | ( | ) | const |
Get the number of symbols per octet, depending on the currently selected channel.
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().
|
private |
Calculate the time required for sending the PPDU header, that is the preamble, SFD and PHR.
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().
double ns3::lrwpan::LrWpanPhy::GetRxSensitivity | ( | ) |
Get 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().
|
overridevirtual |
Implements ns3::SpectrumPhy.
Definition at line 326 of file lr-wpan-phy.cc.
References m_txPsd, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
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().
|
private |
Check if the given page is supported by the PHY.
page | the page to check |
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().
IEEE 802.15.4-2006 section 6.2.1.1 PD-DATA.request Request to transfer MPDU from MAC (transmitting)
psduLength | number of bytes in the PSDU |
p | the 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().
|
private |
Check if the PHY is busy, which is the case if the PHY is currently sending or receiving a frame.
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().
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().
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().
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.
id | the 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.
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.
id | the attributed identifier |
attribute | the 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().
void ns3::lrwpan::LrWpanPhy::PlmeSetTRXStateRequest | ( | PhyEnumeration | state | ) |
IEEE 802.15.4-2006 section 6.2.2.7 PLME-SET-TRX-STATE.request Set PHY state.
state | in RX_ON,TRX_OFF,FORCE_TRX_OFF,TX_ON |
Definition at line 794 of file lr-wpan-phy.cc.
References ns3::lrwpan::aTurnaroundTime, ns3::EventId::Cancel(), CancelEd(), ChangeTrxState(), EndSetTRXState(), 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_BUSY_TX, ns3::lrwpan::IEEE_802_15_4_PHY_FORCE_TRX_OFF, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, 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::EventId::IsExpired(), ns3::Callback< R, UArgs >::IsNull(), m_ccaRequest, m_currentRxPacket, m_currentTxPacket, m_isRxCanceled, m_plmeCcaConfirmCallback, m_plmeSetTRXStateConfirmCallback, m_setTRXState, m_trxState, m_trxStatePending, NS_ABORT_IF, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and ns3::Seconds().
void ns3::lrwpan::LrWpanPhy::SetAntenna | ( | Ptr< AntennaModel > | a | ) |
Set the attached antenna.
a | the antenna |
Definition at line 346 of file lr-wpan-phy.cc.
References m_antenna, and NS_LOG_FUNCTION.
|
overridevirtual |
Set the channel attached to this device.
c | the channel |
Implements ns3::SpectrumPhy.
Definition at line 312 of file lr-wpan-phy.cc.
References m_channel, and NS_LOG_FUNCTION.
Set the associated NetDevice instance.
d | the NetDevice instance |
Implements ns3::SpectrumPhy.
Definition at line 298 of file lr-wpan-phy.cc.
References m_device, and NS_LOG_FUNCTION.
void ns3::lrwpan::LrWpanPhy::SetErrorModel | ( | Ptr< LrWpanErrorModel > | e | ) |
set the error model to use
e | pointer to LrWpanErrorModel to use |
Definition at line 1810 of file lr-wpan-phy.cc.
References m_errorModel, NS_ASSERT, and NS_LOG_FUNCTION.
|
overridevirtual |
Set the mobility model associated with this device.
m | the mobility model |
Implements ns3::SpectrumPhy.
Definition at line 305 of file lr-wpan-phy.cc.
References m_mobility, and NS_LOG_FUNCTION.
void ns3::lrwpan::LrWpanPhy::SetNoisePowerSpectralDensity | ( | Ptr< const SpectrumValue > | noisePsd | ) |
Set the noise power spectral density.
noisePsd | the 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.
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.
c | the callback |
Definition at line 1303 of file lr-wpan-phy.cc.
References m_pdDataConfirmCallback, and NS_LOG_FUNCTION.
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.
c | the callback |
Definition at line 1296 of file lr-wpan-phy.cc.
References m_pdDataIndicationCallback, and NS_LOG_FUNCTION.
void ns3::lrwpan::LrWpanPhy::SetPhyOption | ( | PhyOption | phyOption | ) |
Set the modulation option used by this PHY.
See IEEE 802.15.4-2011, section 8, Table 66.
phyOption | The phy modulation option used by the model. |
Definition at line 1622 of file lr-wpan-phy.cc.
References ns3::lrwpan::EdPower::averagePower, 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_INVALID_PHY_OPTION, ns3::lrwpan::EdPower::lastUpdate, m_currentRxPacket, m_currentTxPacket, m_edPower, m_errorModel, m_phyOption, m_phyPIBAttributes, m_rxLastUpdate, ns3::lrwpan::EdPower::measurementLength, NS_ABORT_MSG_UNLESS, NS_ASSERT, NS_LOG_FUNCTION, ns3::lrwpan::PhyPibAttributes::phyChannelsSupported, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::lrwpan::PhyPibAttributes::phyCurrentPage, ns3::Seconds(), and SetRxSensitivity().
Referenced by LrWpanPhy().
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
c | the callback |
Definition at line 1310 of file lr-wpan-phy.cc.
References m_plmeCcaConfirmCallback, and NS_LOG_FUNCTION.
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
c | the callback |
Definition at line 1317 of file lr-wpan-phy.cc.
References m_plmeEdConfirmCallback, and NS_LOG_FUNCTION.
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
c | the callback |
Definition at line 1324 of file lr-wpan-phy.cc.
References m_plmeGetAttributeConfirmCallback, and NS_LOG_FUNCTION.
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
c | the callback |
Definition at line 1338 of file lr-wpan-phy.cc.
References m_plmeSetAttributeConfirmCallback, and NS_LOG_FUNCTION.
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
c | the callback |
Definition at line 1331 of file lr-wpan-phy.cc.
References m_plmeSetTRXStateConfirmCallback, and NS_LOG_FUNCTION.
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.
em | Pointer to the ErrorModel. |
Definition at line 1895 of file lr-wpan-phy.cc.
References m_postReceptionErrorModel, and NS_LOG_FUNCTION.
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.
dbmSensitivity | The 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().
void ns3::lrwpan::LrWpanPhy::SetTxPowerSpectralDensity | ( | Ptr< SpectrumValue > | txPsd | ) |
Set the Power Spectral Density of outgoing signals in W/Hz.
txPsd | the 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.
|
overridevirtual |
Notify the SpectrumPhy instance of an incoming waveform.
params | the SpectrumSignalParameters associated with the incoming waveform |
Implements ns3::SpectrumPhy.
Definition at line 353 of file lr-wpan-phy.cc.
References ns3::lrwpan::EdPower::averagePower, ChangeTrxState(), CheckInterference(), ns3::DynamicCast(), EndRx(), ns3::Time::GetTimeStep(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY_RX, ns3::lrwpan::IEEE_802_15_4_PHY_RX_ON, ns3::EventId::IsExpired(), ns3::EventId::IsPending(), ns3::lrwpan::EdPower::lastUpdate, m_ccaPeakPower, m_ccaRequest, m_currentRxPacket, m_edPower, m_edRequest, m_noise, m_phyPIBAttributes, m_phyRxBeginTrace, m_phyRxDropTrace, m_rxLastUpdate, m_setTRXState, m_signal, m_trxState, ns3::lrwpan::EdPower::measurementLength, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::lrwpan::PhyPibAttributes::phyCurrentChannel, ns3::Simulator::Schedule(), and ns3::lrwpan::LrWpanSpectrumValueHelper::TotalAvgPower().
Transform watts (W) to decibels milliwatts (dBm).
watt | The Watts that will be converted to dBm. |
Definition at line 1875 of file lr-wpan-phy.cc.
Referenced by GetCurrentSignalPsd(), GetRxSensitivity(), and PlmeSetAttributeRequest().
|
private |
The antenna used by the transceiver.
Definition at line 797 of file lr-wpan-phy.h.
Referenced by DoDispose(), GetAntenna(), PdDataRequest(), and SetAntenna().
|
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().
|
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().
|
private |
The channel attached to this transceiver.
Definition at line 792 of file lr-wpan-phy.h.
Referenced by DoDispose(), GetChannel(), PdDataRequest(), and SetChannel().
|
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().
|
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().
The configured net device.
Definition at line 787 of file lr-wpan-phy.h.
Referenced by DoDispose(), DoInitialize(), EndRx(), GetDevice(), and SetDevice().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
The currently configured PHY type.
Definition at line 877 of file lr-wpan-phy.h.
Referenced by GetDataOrSymbolRate(), GetMyPhyOption(), GetPhySHRDuration(), GetPhySymbolsPerOctet(), GetPpduHeaderTxTime(), PlmeSetAttributeRequest(), SetPhyOption(), and SetRxSensitivity().
|
private |
The current PHY PIB attributes.
Definition at line 817 of file lr-wpan-phy.h.
Referenced by LrWpanPhy(), ChannelSupported(), CheckInterference(), EndCca(), EndEd(), EndRx(), GetCurrentChannelNum(), GetCurrentPage(), GetCurrentSignalPsd(), PageSupported(), PlmeGetAttributeRequest(), PlmeSetAttributeRequest(), SetPhyOption(), SetRxSensitivity(), and StartRx().
|
private |
The trace source fired when a packet begins the reception process from the medium.
Definition at line 712 of file lr-wpan-phy.h.
Referenced by GetTypeId(), and StartRx().
|
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)
Definition at line 732 of file lr-wpan-phy.h.
Referenced by EndRx(), GetTypeId(), and StartRx().
|
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).
Definition at line 723 of file lr-wpan-phy.h.
Referenced by EndRx(), and GetTypeId().
|
private |
The trace source fired when a packet begins the transmission process on the medium.
Definition at line 688 of file lr-wpan-phy.h.
Referenced by GetTypeId(), and PdDataRequest().
|
private |
The trace source fired when the phy layer drops a packet as it tries to transmit it.
Definition at line 704 of file lr-wpan-phy.h.
Referenced by EndTx(), GetTypeId(), and PdDataRequest().
|
private |
The trace source fired when a packet ends the transmission process on the medium.
Definition at line 696 of file lr-wpan-phy.h.
Referenced by EndTx(), and GetTypeId().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
Error model for receive packet events.
Definition at line 952 of file lr-wpan-phy.h.
Referenced by DoDispose(), EndRx(), GetTypeId(), and SetPostReceptionErrorModel().
|
private |
Uniform random variable stream.
Definition at line 950 of file lr-wpan-phy.h.
Referenced by LrWpanPhy(), AssignStreams(), CheckInterference(), and DoDispose().
|
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().
|
private |
The receiver sensitivity.
Definition at line 892 of file lr-wpan-phy.h.
Referenced by EndCca(), EndEd(), GetRxSensitivity(), PlmeSetAttributeRequest(), and SetRxSensitivity().
|
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().
|
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().
|
private |
The current transceiver state.
Definition at line 823 of file lr-wpan-phy.h.
Referenced by LrWpanPhy(), ChangeTrxState(), CheckInterference(), DoDispose(), EndCca(), EndSetTRXState(), EndTx(), GetTypeId(), PdDataRequest(), PhyIsBusy(), PlmeCcaRequest(), PlmeEdRequest(), PlmeSetAttributeRequest(), PlmeSetTRXStateRequest(), and StartRx().
|
private |
The trace source fired when the phy layer changes the transceiver state.
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().
|
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().
|
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().