A Discrete-Event Network Simulator
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
14
15#include "ns3/net-device-container.h"
16#include "ns3/object-factory.h"
17
18#include <optional>
19#include <string>
20
21namespace ns3
22{
23
24class Node;
25class AttributeValue;
26class Time;
27
28/**
29 * @ingroup zigbee
30 *
31 * Setup a Zigbee stack to be used with LrWpanNetDevice.
32 */
34{
35 public:
36 /*
37 * Construct a ZigbeeHelper
38 */
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 */
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 */
Hold a value for an Attribute.
Definition attribute.h:59
holds a vector of ns3::NetDevice pointers
Instantiate subclasses of ns3::Object.
Setup a Zigbee stack to be used with LrWpanNetDevice.
zigbee::ZigbeeStackContainer Install(NetDeviceContainer c)
Install the Zigbee stack on top of an existing LrWpanNetDevice.
void SetNwkLayerOnly()
If this is set, the helper will only create Zigbee stacks that contain only the NWK layer.
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
ObjectFactory m_stackFactory
Zigbee stack object factory.
bool m_nwkLayerOnly
Flag indicating that only the NWK layer is present.
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each ns3::ZigbeeStack created by ZigbeeHelper::Install.
Holds a vector of ns3::ZigbeeStack pointers.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition nstime.h:865
Every class exported by the ns3 library is enclosed in the ns3 namespace.