21#include "ns3/rng-seed-manager.h"
22#include <ns3/constant-position-mobility-model.h>
23#include <ns3/core-module.h>
25#include <ns3/lr-wpan-module.h>
26#include <ns3/packet.h>
27#include <ns3/propagation-delay-model.h>
28#include <ns3/propagation-loss-model.h>
29#include <ns3/simulator.h>
30#include <ns3/single-model-spectrum-channel.h>
50 void DoRun()
override;
64 :
TestCase(
"Test the 802.15.4 energie detection")
114 dev0->AssignStreams(0);
115 dev1->AssignStreams(10);
124 CreateObject<ConstantSpeedPropagationDelayModel>();
125 channel->AddPropagationLossModel(propModel);
126 channel->SetPropagationDelayModel(delayModel);
128 dev0->SetChannel(channel);
129 dev1->SetChannel(channel);
136 CreateObject<ConstantPositionMobilityModel>();
137 sender0Mobility->SetPosition(Vector(0, 0, 0));
138 dev0->GetPhy()->SetMobility(sender0Mobility);
140 CreateObject<ConstantPositionMobilityModel>();
142 sender1Mobility->SetPosition(Vector(0, 10, 0));
143 dev1->GetPhy()->SetMobility(sender1Mobility);
150 propModel->SetRss(-107.58);
158 params.m_dstPanId = 0;
160 params.m_msduHandle = 0;
172 propModel->SetRss(-106.58);
179 params.m_dstPanId = 0;
181 params.m_msduHandle = 0;
193 propModel->SetRss(-81.58);
200 params.m_dstPanId = 0;
202 params.m_msduHandle = 0;
214 propModel->SetRss(-66.58);
221 params.m_dstPanId = 0;
223 params.m_msduHandle = 0;
240 params.m_dstPanId = 0;
242 params.m_msduHandle = 0;
269 :
TestSuite(
"lr-wpan-energy-detection", UNIT)
LrWpan Energy Detection Test.
void DoRun() override
Implementation to actually run this TestCase.
LrWpanPhyEnumeration m_status
PHY status.
void PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t level)
Function called when PlmeEdConfirm is hit.
LrWpan Energy Detection TestSuite.
static std::string LrWpanPhyEnumerationPrinter(LrWpanPhyEnumeration e)
Transform the LrWpanPhyEnumeration enumeration into a printable string.
void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p)
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
void PlmeEdRequest()
IEEE 802.15.4-2006 section 6.2.2.3 PLME-ED.request Perform an ED per section 6.9.7.
This class can contain 16 bit addresses.
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
@ IEEE_802_15_4_PHY_SUCCESS
@ IEEE_802_15_4_PHY_UNSPECIFIED
@ IEEE_802_15_4_PHY_TX_ON
@ TX_OPTION_NONE
TX_OPTION_NONE.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
static LrWpanEdTestSuite g_lrWpanEdTestSuite
Static variable for test initialization.
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...
MCPS-DATA.request params.