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> ())
This class can be used to hold variables of floating point type such as 'double' or 'float'.
the interface for Wifi's frame capture models
virtual bool IsInCaptureWindow(Time timePreambleDetected) const
This method returns true if the capture window duration has not elapsed yet, false otherwise.
Smart pointer class similar to boost::intrusive_ptr.
A simple threshold-based model for frame capture effect.
double GetMargin(void) const
Return the frame capture margin (dB).
~SimpleFrameCaptureModel()
SimpleFrameCaptureModel()
static TypeId GetTypeId(void)
Get the type ID.
bool CaptureNewFrame(Ptr< Event > currentEvent, Ptr< Event > newEvent) const override
This method returns whether the reception should be switched to a new incoming frame.
double m_margin
margin for determining if a new frame (dB)
void SetMargin(double margin)
Sets the frame capture margin (dB).
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double WToDbm(double w)
Convert from Watts to dBm.