Add constructor for channls wih params for constellations

This commit is contained in:
Tim Schubert 2020-08-10 14:03:59 +02:00
parent 27ee6a3697
commit bb3bcb627c
7 changed files with 132 additions and 6 deletions

View file

@ -70,6 +70,11 @@ MockNetDevice::GetTypeId (void)
TimeValue (Seconds (0.0)),
MakeTimeAccessor (&MockNetDevice::m_tInterframeGap),
MakeTimeChecker ())
.AddAttribute ("RxThreshold",
"Receive threshold in dBm",
DoubleValue (0.0),
MakeDoubleAccessor (&MockNetDevice::m_rxThreshold),
MakeDoubleChecker<double> ())
.AddAttribute ("TxPower",
"Transmit power in dBm",
DoubleValue (1.0),
@ -410,7 +415,9 @@ MockNetDevice::SetReceiveErrorModel (Ptr<ErrorModel> em)
}
void
MockNetDevice::Receive (Ptr<Packet> packet, Ptr<MockNetDevice> senderDevice)
MockNetDevice::Receive (Ptr<Packet> packet,
Ptr<MockNetDevice> senderDevice,
double rxPower)
{
NS_LOG_FUNCTION (this << packet << senderDevice);
@ -421,6 +428,13 @@ MockNetDevice::Receive (Ptr<Packet> packet, Ptr<MockNetDevice> senderDevice)
m_phyRxEndTrace (packet);
if (rxPower < m_rxThreshold)
{
// Received power is below threshold
m_phyRxDropTrace (packet);
return;
}
if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) )
{
//
@ -783,4 +797,16 @@ MockNetDevice::SetTxPower (double txPower)
m_txPower = txPower;
}
double
MockNetDevice::GetRxTreshold () const
{
return m_rxThreshold;
}
void
MockNetDevice::SetRxThreshold (double rxThresh)
{
m_rxThreshold = rxThresh;
}
} // namespace ns3