wifi: Set default attributes for wifi-phy-reception tests

This commit is contained in:
Sébastien Deronne
2019-01-02 10:48:50 +01:00
parent c998480b2c
commit 549a162b4b

View File

@@ -20,6 +20,7 @@
#include "ns3/log.h"
#include "ns3/test.h"
#include "ns3/double.h"
#include "ns3/pointer.h"
#include "ns3/rng-seed-manager.h"
#include "ns3/spectrum-wifi-helper.h"
@@ -182,6 +183,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoSetup (void)
m_phy->SetReceiveErrorCallback (MakeCallback (&TestThresholdPreambleDetectionWithoutFrameCapture::RxFailure, this));
Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel> ();
preambleDetectionModel->SetAttribute ("Threshold", DoubleValue (2));
m_phy->SetPreambleDetectionModel (preambleDetectionModel);
}
@@ -380,9 +382,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoSetup (void)
m_phy->SetReceiveErrorCallback (MakeCallback (&TestThresholdPreambleDetectionWithFrameCapture::RxFailure, this));
Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel> ();
preambleDetectionModel->SetAttribute ("Threshold", DoubleValue (2));
m_phy->SetPreambleDetectionModel (preambleDetectionModel);
Ptr<SimpleFrameCaptureModel> frameCaptureModel = CreateObject<SimpleFrameCaptureModel> ();
frameCaptureModel->SetAttribute ("Margin", DoubleValue (5));
frameCaptureModel->SetAttribute ("CaptureWindow", TimeValue (MicroSeconds (16)));
m_phy->SetFrameCaptureModel (frameCaptureModel);
}
@@ -615,9 +620,12 @@ TestSimpleFrameCaptureModel::DoSetup (void)
m_phy->TraceConnectWithoutContext ("PhyRxDrop", MakeCallback (&TestSimpleFrameCaptureModel::RxDropped, this));
Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel> ();
preambleDetectionModel->SetAttribute ("Threshold", DoubleValue (2));
m_phy->SetPreambleDetectionModel (preambleDetectionModel);
Ptr<SimpleFrameCaptureModel> frameCaptureModel = CreateObject<SimpleFrameCaptureModel> ();
frameCaptureModel->SetAttribute ("Margin", DoubleValue (5));
frameCaptureModel->SetAttribute ("CaptureWindow", TimeValue (MicroSeconds (16)));
m_phy->SetFrameCaptureModel (frameCaptureModel);
}
@@ -988,9 +996,12 @@ TestAmpduReception::DoSetup (void)
m_phy->TraceConnectWithoutContext ("PhyRxDrop", MakeCallback (&TestAmpduReception::RxDropped, this));
Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel> ();
preambleDetectionModel->SetAttribute ("Threshold", DoubleValue (2));
m_phy->SetPreambleDetectionModel (preambleDetectionModel);
Ptr<SimpleFrameCaptureModel> frameCaptureModel = CreateObject<SimpleFrameCaptureModel> ();
frameCaptureModel->SetAttribute ("Margin", DoubleValue (5));
frameCaptureModel->SetAttribute ("CaptureWindow", TimeValue (MicroSeconds (16)));
m_phy->SetFrameCaptureModel (frameCaptureModel);
}