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-stack.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 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_STACK_H
11
#define ZIGBEE_STACK_H
12
13
#include "
zigbee-nwk.h
"
14
15
#include "ns3/lr-wpan-mac-base.h"
16
#include "ns3/lr-wpan-net-device.h"
17
#include "ns3/traced-callback.h"
18
19
#include <stdint.h>
20
#include <string>
21
22
namespace
ns3
23
{
24
25
class
Node;
26
27
namespace
zigbee
28
{
29
30
class
ZigbeeNwk;
31
32
/**
33
* @ingroup zigbee
34
*
35
* Zigbee protocol stack to device interface.
36
*
37
* This class is an encapsulating class representing the protocol stack as described
38
* by the Zigbee Specification. In the current implementation only the Zigbee
39
* network layer (NWK) is included. However, this class is meant be later
40
* be extended to include other layer and sublayers part of the Zigbee Specification.
41
* The implementation is analogous to a NetDevice which encapsulates PHY and
42
* MAC layers and provide the necessary hooks. Zigbee Stack is meant to encapsulate
43
* NWK, APS, ZLC layers (and others if applicable).
44
*/
45
class
ZigbeeStack
:
public
Object
46
{
47
public
:
48
/**
49
* Get the type ID.
50
*
51
* @return the object TypeId
52
*/
53
static
TypeId
GetTypeId
();
54
55
/**
56
* Default constructor
57
*/
58
ZigbeeStack
();
59
~ZigbeeStack
()
override
;
60
61
/**
62
* Get the Channel object of the underlying LrWpanNetDevice
63
* @return The LrWpanNetDevice Channel Object
64
*/
65
Ptr<Channel>
GetChannel
()
const
;
66
67
/**
68
* Get the node currently using this ZigbeeStack.
69
* @return The reference to the node object using this ZigbeeStack.
70
*/
71
Ptr<Node>
GetNode
()
const
;
72
73
/**
74
* Get the NWK layer used by this ZigbeeStack.
75
*
76
* @return the NWK object
77
*/
78
Ptr<ZigbeeNwk>
GetNwk
()
const
;
79
80
/**
81
* Set the NWK layer used by this ZigbeeStack.
82
*
83
* @param nwk The NWK layer object
84
*/
85
void
SetNwk
(
Ptr<ZigbeeNwk>
nwk);
86
87
/**
88
* Returns a smart pointer to the underlying NetDevice.
89
*
90
* @return A smart pointer to the underlying NetDevice.
91
*/
92
Ptr<NetDevice>
GetNetDevice
()
const
;
93
94
/**
95
* Setup Zigbee to be the next set of higher layers for the specified NetDevice.
96
* All the packets incoming and outgoing from the NetDevice will be
97
* processed by ZigbeeStack.
98
*
99
* @param netDevice A smart pointer to the NetDevice used by Zigbee.
100
*/
101
void
SetNetDevice
(
Ptr<NetDevice>
netDevice);
102
103
protected
:
104
/**
105
* Dispose of the Objects used by the ZigbeeStack
106
*/
107
void
DoDispose
()
override
;
108
109
/**
110
* Initialize of the Objects used by the ZigbeeStack
111
*/
112
void
DoInitialize
()
override
;
113
114
private
:
115
Ptr<lrwpan::LrWpanMacBase>
m_mac
;
//!< The underlying LrWpan MAC connected to this Zigbee Stack.
116
Ptr<ZigbeeNwk>
m_nwk
;
//!< The Zigbee Network layer.
117
Ptr<Node>
m_node
;
//!< The node associated with this NetDevice.
118
Ptr<NetDevice>
m_netDevice
;
//!< Smart pointer to the underlying NetDevice.
119
};
120
121
}
// namespace zigbee
122
}
// namespace ns3
123
124
#endif
/* ZIGBEE_STACK_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::zigbee::ZigbeeStack
Zigbee protocol stack to device interface.
Definition
zigbee-stack.h:46
ns3::zigbee::ZigbeeStack::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
zigbee-stack.cc:29
ns3::zigbee::ZigbeeStack::~ZigbeeStack
~ZigbeeStack() override
Definition
zigbee-stack.cc:47
ns3::zigbee::ZigbeeStack::SetNwk
void SetNwk(Ptr< ZigbeeNwk > nwk)
Set the NWK layer used by this ZigbeeStack.
Definition
zigbee-stack.cc:144
ns3::zigbee::ZigbeeStack::m_netDevice
Ptr< NetDevice > m_netDevice
Smart pointer to the underlying NetDevice.
Definition
zigbee-stack.h:118
ns3::zigbee::ZigbeeStack::m_mac
Ptr< lrwpan::LrWpanMacBase > m_mac
The underlying LrWpan MAC connected to this Zigbee Stack.
Definition
zigbee-stack.h:115
ns3::zigbee::ZigbeeStack::SetNetDevice
void SetNetDevice(Ptr< NetDevice > netDevice)
Setup Zigbee to be the next set of higher layers for the specified NetDevice.
Definition
zigbee-stack.cc:130
ns3::zigbee::ZigbeeStack::GetChannel
Ptr< Channel > GetChannel() const
Get the Channel object of the underlying LrWpanNetDevice.
Definition
zigbee-stack.cc:112
ns3::zigbee::ZigbeeStack::ZigbeeStack
ZigbeeStack()
Default constructor.
Definition
zigbee-stack.cc:38
ns3::zigbee::ZigbeeStack::GetNwk
Ptr< ZigbeeNwk > GetNwk() const
Get the NWK layer used by this ZigbeeStack.
Definition
zigbee-stack.cc:138
ns3::zigbee::ZigbeeStack::GetNode
Ptr< Node > GetNode() const
Get the node currently using this ZigbeeStack.
Definition
zigbee-stack.cc:118
ns3::zigbee::ZigbeeStack::m_nwk
Ptr< ZigbeeNwk > m_nwk
The Zigbee Network layer.
Definition
zigbee-stack.h:116
ns3::zigbee::ZigbeeStack::m_node
Ptr< Node > m_node
The node associated with this NetDevice.
Definition
zigbee-stack.h:117
ns3::zigbee::ZigbeeStack::DoDispose
void DoDispose() override
Dispose of the Objects used by the ZigbeeStack.
Definition
zigbee-stack.cc:53
ns3::zigbee::ZigbeeStack::GetNetDevice
Ptr< NetDevice > GetNetDevice() const
Returns a smart pointer to the underlying NetDevice.
Definition
zigbee-stack.cc:124
ns3::zigbee::ZigbeeStack::DoInitialize
void DoInitialize() override
Initialize of the Objects used by the ZigbeeStack.
Definition
zigbee-stack.cc:65
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
zigbee-nwk.h
src
zigbee
model
zigbee-stack.h
Generated on Tue Feb 18 2025 18:20:56 for ns-3 by
1.11.0