A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::LrWpanHelper Class Reference

helps to manage and create IEEE 802.15.4 NetDevice objects More...

#include <lr-wpan-helper.h>

+ Inheritance diagram for ns3::LrWpanHelper:
+ Collaboration diagram for ns3::LrWpanHelper:

Public Member Functions

 LrWpanHelper (void)
 Create a LrWpan helper in an empty state. More...
 
virtual ~LrWpanHelper (void)
 
void AddMobility (Ptr< LrWpanPhy > phy, Ptr< MobilityModel > m)
 Add mobility model to a physical device. More...
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
void AssociateToPan (NetDeviceContainer c, uint16_t panId)
 Associate the nodes to the same PAN. More...
 
void EnableLogComponents (void)
 Helper to enable all LrWpan log components with one statement. More...
 
NetDeviceContainer Install (NodeContainer c)
 
- Public Member Functions inherited from ns3::PcapHelperForDevice
 PcapHelperForDevice ()
 Construct a PcapHelperForDevice. More...
 
virtual ~PcapHelperForDevice ()
 Destroy a PcapHelperForDevice. More...
 
void EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device. More...
 
void EnablePcap (std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous=false)
 Enable pcap output on each device in the container which is of the appropriate type. More...
 
void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false)
 Enable pcap output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnablePcapAll (std::string prefix, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForDevice
 AsciiTraceHelperForDevice ()
 Construct an AsciiTraceHelperForDevice. More...
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice. More...
 
void EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (std::string prefix, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAsciiAll (std::string prefix)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
void EnableAsciiAll (Ptr< OutputStreamWrapper > stream)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 

Static Public Member Functions

static std::string LrWpanMacStatePrinter (LrWpanMacState e)
 
static std::string LrWpanPhyEnumerationPrinter (LrWpanPhyEnumeration)
 

Private Member Functions

 LrWpanHelper (LrWpanHelper const &)
 
virtual void EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
 Enable ascii trace output on the indicated net device. More...
 
virtual void EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
 Enable pcap output on the indicated net device. More...
 
LrWpanHelperoperator= (LrWpanHelper const &)
 

Private Attributes

Ptr< SingleModelSpectrumChannelm_channel
 

Detailed Description

helps to manage and create IEEE 802.15.4 NetDevice objects

This class can help to create IEEE 802.15.4 NetDevice objects and to configure their attributes during creation. It also contains additional helper functions used by client code.

Definition at line 45 of file lr-wpan-helper.h.

Constructor & Destructor Documentation

ns3::LrWpanHelper::LrWpanHelper ( void  )

Create a LrWpan helper in an empty state.

Definition at line 52 of file lr-wpan-helper.cc.

References m_channel.

ns3::LrWpanHelper::~LrWpanHelper ( void  )
virtual

Definition at line 59 of file lr-wpan-helper.cc.

References m_channel.

ns3::LrWpanHelper::LrWpanHelper ( LrWpanHelper const &  )
private

Member Function Documentation

void ns3::LrWpanHelper::AddMobility ( Ptr< LrWpanPhy phy,
Ptr< MobilityModel m 
)

Add mobility model to a physical device.

Parameters
phythe physical device
mthe mobility model

Definition at line 135 of file lr-wpan-helper.cc.

int64_t ns3::LrWpanHelper::AssignStreams ( NetDeviceContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams that have been assigned. The Install() method should have previously been called by the user.

Parameters
cNetDeviceContainer of the set of net devices for which the CsmaNetDevice should be modified to use a fixed stream
streamfirst stream index to use
Returns
the number of stream indices assigned by this helper

Definition at line 160 of file lr-wpan-helper.cc.

References ns3::NetDeviceContainer::Begin(), and ns3::NetDeviceContainer::End().

+ Here is the call graph for this function:

void ns3::LrWpanHelper::AssociateToPan ( NetDeviceContainer  c,
uint16_t  panId 
)

Associate the nodes to the same PAN.

Parameters
ca set of nodes
panIdthe PAN Id

Definition at line 177 of file lr-wpan-helper.cc.

References first::address, ns3::NetDeviceContainer::Begin(), ns3::Mac16Address::CopyFrom(), first::devices, and ns3::NetDeviceContainer::End().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LrWpanHelper::EnableAsciiInternal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename 
)
privatevirtual
void ns3::LrWpanHelper::EnableLogComponents ( void  )

Helper to enable all LrWpan log components with one statement.

Definition at line 66 of file lr-wpan-helper.cc.

References ns3::LOG_LEVEL_ALL, ns3::LOG_PREFIX_FUNC, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), and ns3::LogComponentEnableAll().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LrWpanHelper::EnablePcapInternal ( std::string  prefix,
Ptr< NetDevice nd,
bool  promiscuous,
bool  explicitFilename 
)
privatevirtual

Enable pcap output on the indicated net device.

Internal:
Internal:

NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.

Parameters
prefixFilename prefix to use for pcap files.
ndNet device for which you want to enable tracing.
promiscuousIf true capture all possible packets available at the device.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::PcapHelperForDevice.

Definition at line 208 of file lr-wpan-helper.cc.

References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_IEEE802_15_4, ns3::PcapHelper::GetFilenameFromDevice(), ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::PcapSniffLrWpan().

+ Here is the call graph for this function:

NetDeviceContainer ns3::LrWpanHelper::Install ( NodeContainer  c)
Parameters
ca set of nodes

Definition at line 141 of file lr-wpan-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::Node::AddDevice(), ns3::NodeContainer::Begin(), first::devices, ns3::NodeContainer::End(), and m_channel.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string ns3::LrWpanHelper::LrWpanMacStatePrinter ( LrWpanMacState  e)
static
LrWpanHelper& ns3::LrWpanHelper::operator= ( LrWpanHelper const &  )
private

Member Data Documentation

Ptr<SingleModelSpectrumChannel> ns3::LrWpanHelper::m_channel
private

Definition at line 133 of file lr-wpan-helper.h.

Referenced by Install(), LrWpanHelper(), and ~LrWpanHelper().


The documentation for this class was generated from the following files: