10#include "ns3/rng-seed-manager.h"
11#include <ns3/constant-position-mobility-model.h>
12#include <ns3/core-module.h>
14#include <ns3/lr-wpan-module.h>
15#include <ns3/packet.h>
16#include <ns3/propagation-delay-model.h>
17#include <ns3/propagation-loss-model.h>
18#include <ns3/simulator.h>
19#include <ns3/single-model-spectrum-channel.h>
40 void DoRun()
override;
54 :
TestCase(
"Test the 802.15.4 energie detection")
104 dev0->AssignStreams(0);
105 dev1->AssignStreams(10);
115 channel->AddPropagationLossModel(propModel);
116 channel->SetPropagationDelayModel(delayModel);
118 dev0->SetChannel(channel);
119 dev1->SetChannel(channel);
127 sender0Mobility->SetPosition(Vector(0, 0, 0));
128 dev0->GetPhy()->SetMobility(sender0Mobility);
132 sender1Mobility->SetPosition(Vector(0, 10, 0));
133 dev1->GetPhy()->SetMobility(sender1Mobility);
140 propModel->SetRss(-107.58);
148 params.m_dstPanId = 0;
150 params.m_msduHandle = 0;
162 propModel->SetRss(-106.58);
169 params.m_dstPanId = 0;
171 params.m_msduHandle = 0;
183 propModel->SetRss(-81.58);
190 params.m_dstPanId = 0;
192 params.m_msduHandle = 0;
204 propModel->SetRss(-66.58);
211 params.m_dstPanId = 0;
213 params.m_msduHandle = 0;
230 params.m_dstPanId = 0;
232 params.m_msduHandle = 0;
LrWpan Energy Detection Test.
void PlmeEdConfirm(PhyEnumeration status, uint8_t level)
Function called when PlmeEdConfirm is hit.
void DoRun() override
Implementation to actually run this TestCase.
PhyEnumeration m_status
PHY status.
LrWpan Energy Detection TestSuite.
static std::string LrWpanPhyEnumerationPrinter(lrwpan::PhyEnumeration e)
Transform the LrWpanPhyEnumeration enumeration into a printable string.
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, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p) override
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.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
PhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
@ IEEE_802_15_4_PHY_TX_ON
@ IEEE_802_15_4_PHY_SUCCESS
@ IEEE_802_15_4_PHY_UNSPECIFIED
@ TX_OPTION_NONE
TX_OPTION_NONE.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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.