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
lr-wpan-lqi-tag.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Fraunhofer FKIE
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author:
18
* Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
19
*/
20
#ifndef LR_WPAN_LQI_TAG_H
21
#define LR_WPAN_LQI_TAG_H
22
23
#include <ns3/tag.h>
24
25
namespace
ns3
26
{
27
namespace
lrwpan
28
{
29
30
/**
31
* \ingroup lr-wpan
32
* Represent the LQI (Link Quality Estination).
33
*
34
* The LQI Tag is added to each received packet, and can be
35
* used by upper layers to estimate the channel conditions.
36
*
37
* The LQI is the total packet success rate scaled to 0-255.
38
*/
39
class
LrWpanLqiTag
:
public
Tag
40
{
41
public
:
42
/**
43
* Get the type ID.
44
*
45
* \return the object TypeId
46
*/
47
static
TypeId
GetTypeId
();
48
49
TypeId
GetInstanceTypeId
()
const override
;
50
51
/**
52
* Create a LrWpanLqiTag with the default LQI 0.
53
*/
54
LrWpanLqiTag
();
55
56
/**
57
* Create a LrWpanLqiTag with the given LQI value.
58
* \param lqi The LQI.
59
*/
60
LrWpanLqiTag
(uint8_t lqi);
61
62
uint32_t
GetSerializedSize
()
const override
;
63
void
Serialize
(
TagBuffer
i)
const override
;
64
void
Deserialize
(
TagBuffer
i)
override
;
65
void
Print
(std::ostream& os)
const override
;
66
67
/**
68
* Set the LQI to the given value.
69
*
70
* \param lqi the value of the LQI to set
71
*/
72
void
Set
(uint8_t lqi);
73
74
/**
75
* Get the LQI value.
76
*
77
* \return the LQI value
78
*/
79
uint8_t
Get
()
const
;
80
81
private
:
82
/**
83
* The current LQI value of the tag.
84
*/
85
uint8_t
m_lqi
;
86
};
87
88
}
// namespace lrwpan
89
}
// namespace ns3
90
#endif
/* LR_WPAN_LQI_TAG_H */
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:52
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:39
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lrwpan::LrWpanLqiTag
Represent the LQI (Link Quality Estination).
Definition:
lr-wpan-lqi-tag.h:40
ns3::lrwpan::LrWpanLqiTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
lr-wpan-lqi-tag.cc:63
ns3::lrwpan::LrWpanLqiTag::Set
void Set(uint8_t lqi)
Set the LQI to the given value.
Definition:
lr-wpan-lqi-tag.cc:87
ns3::lrwpan::LrWpanLqiTag::LrWpanLqiTag
LrWpanLqiTag()
Create a LrWpanLqiTag with the default LQI 0.
Definition:
lr-wpan-lqi-tag.cc:52
ns3::lrwpan::LrWpanLqiTag::m_lqi
uint8_t m_lqi
The current LQI value of the tag.
Definition:
lr-wpan-lqi-tag.h:85
ns3::lrwpan::LrWpanLqiTag::Serialize
void Serialize(TagBuffer i) const override
Definition:
lr-wpan-lqi-tag.cc:69
ns3::lrwpan::LrWpanLqiTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
lr-wpan-lqi-tag.cc:47
ns3::lrwpan::LrWpanLqiTag::Print
void Print(std::ostream &os) const override
Definition:
lr-wpan-lqi-tag.cc:81
ns3::lrwpan::LrWpanLqiTag::Deserialize
void Deserialize(TagBuffer i) override
Definition:
lr-wpan-lqi-tag.cc:75
ns3::lrwpan::LrWpanLqiTag::Get
uint8_t Get() const
Get the LQI value.
Definition:
lr-wpan-lqi-tag.cc:93
ns3::lrwpan::LrWpanLqiTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
lr-wpan-lqi-tag.cc:32
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lr-wpan
model
lr-wpan-lqi-tag.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6