A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
zigbee-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Tokushima University, Japan
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author:
7
* Alberto Gallegos Ramonet <alramonet@is.tokushima-u.ac.jp>
8
*/
9
10
#ifndef ZIGBEE_HELPER_H
11
#define ZIGBEE_HELPER_H
12
13
#include "
zigbee-stack-container.h
"
14
15
#include "ns3/net-device-container.h"
16
#include "ns3/object-factory.h"
17
18
#include <optional>
19
#include <string>
20
21
namespace
ns3
22
{
23
24
class
Node;
25
class
AttributeValue;
26
class
Time
;
27
28
/**
29
* @ingroup zigbee
30
*
31
* Setup a Zigbee stack to be used with LrWpanNetDevice.
32
*/
33
class
ZigbeeHelper
34
{
35
public
:
36
/*
37
* Construct a ZigbeeHelper
38
*/
39
ZigbeeHelper
();
40
/**
41
* Set an attribute on each ns3::ZigbeeStack created by
42
* ZigbeeHelper::Install.
43
*
44
* @param n1 [in] The name of the attribute to set.
45
* @param v1 [in] The value of the attribute to set.
46
*/
47
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
& v1);
48
49
/**
50
* Install the Zigbee stack on top of an existing LrWpanNetDevice.
51
*
52
* This function requires a set of properly configured LrWpanNetDevices
53
* passed in as the parameter "c". After the installation,
54
* the set Zigbee stack contains the upper layers that communicate
55
* directly with the application.
56
*
57
* Note that Zigbee is specific designed to be used on top of
58
* LrWpanDevice (IEEE 802.15.4).
59
* Any other protocol will be discarded by Zigbee.
60
*
61
*
62
* @param [in] c The NetDevice container with LrWpanNetDevices.
63
* @return A container with the newly created ZigbeeStacks.
64
*/
65
zigbee::ZigbeeStackContainer
Install
(
NetDeviceContainer
c);
66
67
/**
68
* If this is set, the helper will only create Zigbee stacks that contain
69
* only the NWK layer
70
*/
71
void
SetNwkLayerOnly
();
72
73
/**
74
* Assign a fixed random variable stream number to the random variables
75
* used by this model. Return the number of streams (possibly zero) that
76
* have been assigned. The Install() method should have previously been
77
* called by the user.
78
*
79
* @param [in] c NetDeviceContainer of the set of net devices for which the
80
* ZigbeeStack should be modified to use a fixed stream.
81
* @param [in] stream First stream index to use.
82
* @return The number of stream indices assigned by this helper.
83
*/
84
int64_t
AssignStreams
(
NetDeviceContainer
c, int64_t stream);
85
86
private
:
87
ObjectFactory
m_stackFactory
;
//!< Zigbee stack object factory.
88
bool
m_nwkLayerOnly
;
//!< Flag indicating that only the NWK layer is present
89
};
90
91
}
// namespace ns3
92
93
#endif
/* ZIGBEE_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition
net-device-container.h:32
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::ZigbeeHelper
Setup a Zigbee stack to be used with LrWpanNetDevice.
Definition
zigbee-helper.h:34
ns3::ZigbeeHelper::ZigbeeHelper
ZigbeeHelper()
Definition
zigbee-helper.cc:23
ns3::ZigbeeHelper::Install
zigbee::ZigbeeStackContainer Install(NetDeviceContainer c)
Install the Zigbee stack on top of an existing LrWpanNetDevice.
Definition
zigbee-helper.cc:38
ns3::ZigbeeHelper::SetNwkLayerOnly
void SetNwkLayerOnly()
If this is set, the helper will only create Zigbee stacks that contain only the NWK layer.
Definition
zigbee-helper.cc:67
ns3::ZigbeeHelper::AssignStreams
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
ns3::ZigbeeHelper::m_stackFactory
ObjectFactory m_stackFactory
Zigbee stack object factory.
Definition
zigbee-helper.h:87
ns3::ZigbeeHelper::m_nwkLayerOnly
bool m_nwkLayerOnly
Flag indicating that only the NWK layer is present.
Definition
zigbee-helper.h:88
ns3::ZigbeeHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::ZigbeeStack created by ZigbeeHelper::Install.
Definition
zigbee-helper.cc:31
ns3::zigbee::ZigbeeStackContainer
Holds a vector of ns3::ZigbeeStack pointers.
Definition
zigbee-stack-container.h:37
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition
nstime.h:865
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
zigbee-stack-container.h
src
zigbee
helper
zigbee-helper.h
Generated on Mon Jun 16 2025 11:07:25 for ns-3 by
1.11.0