A Discrete-Event Network Simulator
API
lr-wpan-helper.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 The Boeing Company
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors:
19  * Gary Pei <guangyu.pei@boeing.com>
20  * Tom Henderson <thomas.r.henderson@boeing.com>
21  */
22 #ifndef LR_WPAN_HELPER_H
23 #define LR_WPAN_HELPER_H
24 
25 #include <ns3/node-container.h>
26 #include <ns3/lr-wpan-phy.h>
27 #include <ns3/lr-wpan-mac.h>
28 #include <ns3/trace-helper.h>
29 
30 namespace ns3 {
31 
32 class SpectrumChannel;
33 class MobilityModel;
34 
51 {
52 public:
61  LrWpanHelper (void);
62 
71  LrWpanHelper (bool useMultiModelSpectrumChannel);
72 
73  virtual ~LrWpanHelper (void);
74 
80 
86 
91  void SetChannel (std::string channelName);
92 
99 
106 
113  void AssociateToPan (NetDeviceContainer c, uint16_t panId);
114 
126  void AssociateToBeaconPan (NetDeviceContainer c, uint16_t panId, Mac16Address coor, uint8_t bcnOrd, uint8_t sfrmOrd);
127 
131  void EnableLogComponents (void);
132 
138  static std::string LrWpanPhyEnumerationPrinter (LrWpanPhyEnumeration e);
139 
145  static std::string LrWpanMacStatePrinter (LrWpanMacState e);
146 
158  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
159 
160 private:
161  // Disable implicit constructors
165  LrWpanHelper (LrWpanHelper const &);
182  virtual void EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename);
183 
195  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
196  std::string prefix,
197  Ptr<NetDevice> nd,
198  bool explicitFilename);
199 
200 private:
202 
203 };
204 
205 }
206 
207 #endif /* LR_WPAN_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:641
NetDeviceContainer Install(NodeContainer c)
Install a LrWpanNetDevice and the associated structures (e.g., channel) in the nodes.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
static std::string LrWpanPhyEnumerationPrinter(LrWpanPhyEnumeration e)
Transform the LrWpanPhyEnumeration enumeration into a printable string.
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:552
static std::string LrWpanMacStatePrinter(LrWpanMacState e)
Transform the LrWpanMacState enumeration into a printable string.
LrWpanHelper & operator=(LrWpanHelper const &)
Copy constructor - defined and not implemented.
void AssociateToPan(NetDeviceContainer c, uint16_t panId)
Associate the nodes to the same PAN.
channel
Definition: third.py:92
phy
Definition: third.py:93
holds a vector of ns3::NetDevice pointers
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output on the indicated net device.
Ptr< SpectrumChannel > m_channel
channel to be used for the devices
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
LrWpanHelper(void)
Create a LrWpan helper in an empty state.
This class can contain 16 bit addresses.
Definition: mac16-address.h:41
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel associated to this helper.
void AssociateToBeaconPan(NetDeviceContainer c, uint16_t panId, Mac16Address coor, uint8_t bcnOrd, uint8_t sfrmOrd)
Associate the nodes to the same PAN and initiate beacon enabled mode.
LrWpanMacState
MAC states.
Definition: lr-wpan-mac.h:69
Ptr< SpectrumChannel > GetChannel(void)
Get the channel associated to this helper.
void AddMobility(Ptr< LrWpanPhy > phy, Ptr< MobilityModel > m)
Add mobility model to a physical device.
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
Definition: lr-wpan-phy.h:105
helps to manage and create IEEE 802.15.4 NetDevice objects
virtual ~LrWpanHelper(void)
void EnableLogComponents(void)
Helper to enable all LrWpan log components with one statement.