31#include <ns3/constant-position-mobility-model.h>
32#include <ns3/core-module.h>
34#include <ns3/lr-wpan-module.h>
35#include <ns3/packet.h>
36#include <ns3/propagation-delay-model.h>
37#include <ns3/propagation-loss-model.h>
38#include <ns3/simulator.h>
39#include <ns3/single-model-spectrum-channel.h>
49 if (params.m_status == MacStatus::SUCCESS && params.m_scanType ==
MLMESCAN_ED)
52 std::cout <<
"Results for Energy Scan:"
53 <<
"\nPage: " << params.m_chPage <<
"\n";
54 for (std::size_t i = 0; i < params.m_energyDetList.size(); i++)
56 std::cout <<
"Channel " <<
static_cast<uint32_t>(i + 11) <<
": "
57 << +params.m_energyDetList[i] <<
"\n";
63main(
int argc,
char* argv[])
86 channel->AddPropagationLossModel(propModel);
87 channel->SetPropagationDelayModel(delayModel);
89 dev0->SetChannel(channel);
90 dev1->SetChannel(channel);
91 dev2->SetChannel(channel);
100 dev1->GetMac()->SetMlmeScanConfirmCallback(scb);
104 PanCoordinatorN0Mobility->SetPosition(Vector(0, 0, 0));
105 dev0->GetPhy()->SetMobility(PanCoordinatorN0Mobility);
109 endDeviceN1Mobility->SetPosition(Vector(10, 0, 0));
110 dev1->GetPhy()->SetMobility(endDeviceN1Mobility);
114 PanCoordinatorN2Mobility->SetPosition(Vector(40, 0, 0));
115 dev2->GetPhy()->SetMobility(PanCoordinatorN2Mobility);
This class can contain 16 bit addresses.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
void MlmeStartRequest(MlmeStartRequestParams params) override
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
void MlmeScanRequest(MlmeScanRequestParams params) override
IEEE 802.15.4-2011, section 6.2.10.1 MLME-SCAN.request Request primitive used to initiate a channel s...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void ScanConfirm(MlmeScanConfirmParams params)
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...
LogLevel
Logging severity classes and levels.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
MLME-SCAN.confirm params.
MLME-SCAN.request params.
MlmeScanType m_scanType
Indicates the type of scan performed as described in IEEE 802.15.4-2011 (5.1.2.1).
uint32_t m_scanChannels
The channel numbers to be scanned.
uint8_t m_scanDuration
The factor (0-14) used to calculate the length of time to spend scanning.
uint32_t m_chPage
The channel page on which to perform scan.
MLME-START.request params.
uint8_t m_logCh
Logical channel on which to start using the new superframe configuration.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
bool m_panCoor
On true this device will become coordinator.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
uint16_t m_PanId
Pan Identifier used by the device.