19 #include <ns3/core-module.h>
20 #include <ns3/spectrum-module.h>
46 void DoRun()
override;
62 if (
Now().GetSeconds() > m_stop)
71 m_dutyCycle(dutyCycle),
84 Ptr<SpectrumValue> txPsd = MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo1();
87 channelHelper.
SetChannel(
"ns3::SingleModelSpectrumChannel");
107 Simulator::Schedule(
Seconds(1.0), &WaveformGenerator::Start, wave);
108 Simulator::Schedule(
Seconds(
m_stop), &WaveformGenerator::Stop, wave);
115 Simulator::Destroy();
130 :
TestSuite(
"waveform-generator", SYSTEM)
132 NS_LOG_INFO(
"creating WaveformGeneratorTestSuite");
This class can be used to hold variables of floating point type such as 'double' or 'float'.
holds a vector of ns3::NetDevice pointers
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
This class implements a device which does not communicate, in the sense that it does not interact wit...
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Ptr< SpectrumChannel > Create() const
void SetChannel(std::string type, Ts &&... args)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...