helps to manage and create BLE NetDevice objects and work with a group of device at once. More...
#include "ble-helper.h"
Public Member Functions | |
BleHelper (void) | |
Create a Ble Helper in an empty state. More... | |
virtual | ~BleHelper (void) |
void | AddMobility (Ptr< BlePhy > phy, Ptr< MobilityModel > m) |
Add MobilityModel to a physical device. More... | |
void | AllocateAddress (NetDeviceContainer c, Mac48Address addr) |
Allocate address to all Nodes. More... | |
void | EnableLogComponents (void) |
Helper to enable all BLE log components with one statement. More... | |
Ptr< SpectrumChannel > | GetChannel (void) |
Get the channel associated to this helper. More... | |
NetDeviceContainer | Install (NodeContainer c, BleLinkLayer::BleLinkLayerDeviceTypes type) |
Install a BleNetdevice and the assocuiated structures (e.g. More... | |
void | SetChannel (Ptr< SpectrumChannel > channel) |
Set the channel associated to this helper. More... | |
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 | BleLinkLayerRolePrinter (BleLinkLayer::BleLinkLayerRole e) |
static std::string | BlePhyStatePrinter (BlePhy::BlePhyState e) |
Transform the BlePhy States into a printable strings. More... | |
Private Member Functions | |
BleHelper (BleHelper const &) | |
Copy Constructor - defined and not implemented. More... | |
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 promiscous, bool explicitFilename) |
Enable pcap output on the indicated netdevice. More... | |
BleHelper & | operator= (BleHelper const &) |
Copy Constructor - defined and not implemented. More... | |
Private Attributes | |
Ptr< SpectrumChannel > | m_channel |
channel to be used for the devices More... | |
helps to manage and create BLE NetDevice objects and work with a group of device at once.
This class can help to create BLE NetDevice objects and configure their attributes during the creation. It also contains additional helper functions that can be used by user.
Definition at line 44 of file ble-helper.h.
ns3::BleHelper::BleHelper | ( | void | ) |
Create a Ble Helper in an empty state.
Output an ascii line representing the Transmit event (with context)
By default, a SingleModelSpectrumChannel is created with a log distance propagation loss model and a ConstantPositionPropagationDelayModel. To change the channel models, loss models, or delay model,the Get/Set Channel methods may be used.
stream | the output stream |
context | the context |
p | the packet Output an ascii line representing the Transmit event (without context) |
stream | the output stream |
p | the packet |
Definition at line 60 of file ble-helper.cc.
References m_channel, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 71 of file ble-helper.cc.
References m_channel, and NS_LOG_FUNCTION.
|
private |
Copy Constructor - defined and not implemented.
void ns3::BleHelper::AddMobility | ( | Ptr< BlePhy > | phy, |
Ptr< MobilityModel > | m | ||
) |
Add MobilityModel to a physical device.
phy | the physical device |
m | the mobility model |
Definition at line 150 of file ble-helper.cc.
void ns3::BleHelper::AllocateAddress | ( | NetDeviceContainer | c, |
Mac48Address | addr | ||
) |
Allocate address to all Nodes.
c | NetDevice Container |
addr | Object of Mac48Address class User same addr object to allocate addresses on same system. |
Definition at line 211 of file ble-helper.cc.
References ns3::Mac48Address::Allocate(), ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), and NS_LOG_FUNCTION.
|
static |
Definition at line 128 of file ble-helper.cc.
References ns3::BleLinkLayer::ADVERTISER, ns3::BleLinkLayer::CONN_MASTER, ns3::BleLinkLayer::CONN_SLAVE, ns3::BleLinkLayer::SCANNER_ACT, ns3::BleLinkLayer::SCANNER_PASS, and ns3::BleLinkLayer::STANDBY.
|
static |
Transform the BlePhy States into a printable strings.
e | the BlePhyState |
Definition at line 106 of file ble-helper.cc.
References ns3::BlePhy::BUSY_RX, ns3::BlePhy::BUSY_TX, ns3::BlePhy::IDLE, ns3::BlePhy::LISTEN, ns3::BlePhy::OFF, and ns3::BlePhy::TRANS.
|
privatevirtual |
Enable ascii trace output on the indicated net device.
Net Device specific implementation mechanism for hooking the trace and writing to the trace file.
stream | The output stream object to use when logging ascii traces. |
prefix | Filename prefix to use for ascii trace files. |
nd | Net device for which you want to enable tracing |
Implements ns3::AsciiTraceHelperForDevice.
Definition at line 253 of file ble-helper.cc.
References ns3::AsciiBleLinkLayerTransmitSinkWithContext(), ns3::AsciiBleLinkLayerTransmitSinkWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::AsciiTraceHelper::DefaultDropSinkWithContext(), ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(), ns3::Packet::EnablePrinting(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::AsciiTraceHelper::HookDefaultDropSinkWithoutContext(), ns3::AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext(), ns3::MakeBoundCallback(), NS_LOG_FUNCTION, and NS_LOG_INFO.
void ns3::BleHelper::EnableLogComponents | ( | void | ) |
Helper to enable all BLE log components with one statement.
Definition at line 93 of file ble-helper.cc.
References ns3::LOG_LEVEL_ALL, ns3::LOG_PREFIX_FUNC, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), and ns3::LogComponentEnableAll().
|
privatevirtual |
Enable pcap output on the indicated netdevice.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
prefix | Filename prefix to use for pcap files. |
nd | NetDevice for which you want to use for pcap files. |
promiscous | If tru capture all possible packets available at the device. |
Implements ns3::PcapHelperForDevice.
Definition at line 345 of file ble-helper.cc.
References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_BLUETOOTH_LE_LL, ns3::PcapHelper::GetFilenameFromDevice(), ns3::MakeBoundCallback(), NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::PcapSniffBle().
Ptr< SpectrumChannel > ns3::BleHelper::GetChannel | ( | void | ) |
Get the channel associated to this helper.
Definition at line 86 of file ble-helper.cc.
References m_channel, and NS_LOG_FUNCTION.
NetDeviceContainer ns3::BleHelper::Install | ( | NodeContainer | c, |
BleLinkLayer::BleLinkLayerDeviceTypes | type | ||
) |
Install a BleNetdevice and the assocuiated structures (e.g.
channel, LinkLayer, PhyDevices in the nodes.
c | a set of nodes |
type | Type of device |
Definition at line 156 of file ble-helper.cc.
References ns3::NetDeviceContainer::Add(), ns3::BleSensorApplication::ADVERTISE, ns3::NodeContainer::Begin(), ns3::BleLinkLayer::CENTRAL, first::devices, ns3::NodeContainer::End(), m_channel, third::phy, and ns3::BleSensorApplication::SCANNING.
Copy Constructor - defined and not implemented.
void ns3::BleHelper::SetChannel | ( | Ptr< SpectrumChannel > | channel | ) |
Set the channel associated to this helper.
channel | Pointer to SpectrumChannel object |
Definition at line 79 of file ble-helper.cc.
References third::channel, m_channel, and NS_LOG_FUNCTION.
|
private |
channel to be used for the devices
Definition at line 139 of file ble-helper.h.
Referenced by BleHelper(), GetChannel(), Install(), SetChannel(), and ~BleHelper().