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)
53 if (!params.m_panDescList.empty())
55 std::cout <<
"Device [" << device->GetMac()->GetShortAddress()
56 <<
"] found the following PANs:\n";
57 for (
long unsigned int i = 0;
i < params.m_panDescList.size();
i++)
59 std::cout <<
"PAN DESCRIPTOR " <<
i <<
":\n"
60 <<
"Pan Id: " << params.m_panDescList[
i].m_coorPanId
61 <<
"\nChannel: " <<
static_cast<uint32_t>(params.m_panDescList[
i].m_logCh)
63 <<
static_cast<uint32_t>(params.m_panDescList[
i].m_linkQuality)
64 <<
"\nCoordinator Short Address: "
65 << params.m_panDescList[
i].m_coorShortAddr <<
"\n\n";
70 std::cout <<
"No PANs found (Could not find any beacons)\n";
75 std::cout <<
"Something went wrong, scan could not be completed\n";
106 coord1NetDevice->SetChannel(channel);
107 endNodeNetDevice->SetChannel(channel);
110 coord1->AddDevice(coord1NetDevice);
111 endNode->AddDevice(endNodeNetDevice);
131 endNodeNetDevice->GetMac()->SetMlmeScanConfirmCallback(
149 coord1NetDevice->GetMac(),
180 endNodeNetDevice->GetMac(),
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...
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void ScanConfirm(Ptr< LrWpanNetDevice > device, MlmeScanConfirmParams params)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
uint32_t m_chPage
The channel page on which to perform scan.
MLME-START.request params.
bool m_panCoor
On true this device will become coordinator.