21 #include "ns3/simulator.h" 23 #include "ns3/double.h" 37 static TypeId tid =
TypeId (
"ns3::SimpleFrameCaptureModel")
39 .SetGroupName (
"Wifi")
41 .AddAttribute (
"Margin",
42 "Reception is switched if the newly arrived frame has a power higher than " 43 "this value above the frame currently being received (expressed in dB).",
47 MakeDoubleChecker<double> ())
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
A simple threshold-based model for frame capture effect.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static TypeId GetTypeId(void)
Get the type ID.
the interface for Wifi's frame capture models
SimpleFrameCaptureModel()
static Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector)
double GetMargin(void) const
Return the frame capture margin (dB).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double WToDbm(double w)
Convert from Watts to dBm.
static Time Now(void)
Return the current simulation virtual time.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool CaptureNewFrame(Ptr< Event > currentEvent, Ptr< Event > newEvent) const
This method returns whether the reception should be switched to a new incoming frame.
~SimpleFrameCaptureModel()
void SetMargin(double margin)
Sets the frame capture margin (dB).
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double m_margin
margin for determining if a new frame