Add link params to model with attributes

This commit is contained in:
Tim Schubert 2020-08-10 13:31:01 +02:00
parent 1224169ff5
commit 27ee6a3697
8 changed files with 77 additions and 12 deletions

View file

@ -28,6 +28,7 @@
#include "ns3/net-device-queue-interface.h"
#include "ns3/ethernet-header.h"
#include "ns3/ethernet-trailer.h"
#include "ns3/double.h"
#include "mock-channel.h"
#include "mock-net-device.h"
@ -69,6 +70,11 @@ MockNetDevice::GetTypeId (void)
TimeValue (Seconds (0.0)),
MakeTimeAccessor (&MockNetDevice::m_tInterframeGap),
MakeTimeChecker ())
.AddAttribute ("TxPower",
"Transmit power in dBm",
DoubleValue (1.0),
MakeDoubleAccessor (&MockNetDevice::m_txPower),
MakeDoubleChecker<double> ())
//
// Transmit queueing discipline for the device which includes its own set
@ -765,4 +771,16 @@ MockNetDevice::IsPointToPoint() const
return false;
}
double
MockNetDevice::GetTxPower () const
{
return m_txPower;
}
void
MockNetDevice::SetTxPower (double txPower)
{
m_txPower = txPower;
}
} // namespace ns3