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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author:
7
* Sascha Alexander Jopen <jopen@cs.uni-bonn.de>
8
*/
9
#ifndef LR_WPAN_LQI_TAG_H
10
#define LR_WPAN_LQI_TAG_H
11
12
#include <ns3/tag.h>
13
14
namespace
ns3
15
{
16
namespace
lrwpan
17
{
18
19
/**
20
* @ingroup lr-wpan
21
* Represent the LQI (Link Quality Estination).
22
*
23
* The LQI Tag is added to each received packet, and can be
24
* used by upper layers to estimate the channel conditions.
25
*
26
* The LQI is the total packet success rate scaled to 0-255.
27
*/
28
class
LrWpanLqiTag
:
public
Tag
29
{
30
public
:
31
/**
32
* Get the type ID.
33
*
34
* @return the object TypeId
35
*/
36
static
TypeId
GetTypeId
();
37
38
TypeId
GetInstanceTypeId
()
const override
;
39
40
/**
41
* Create a LrWpanLqiTag with the default LQI 0.
42
*/
43
LrWpanLqiTag
();
44
45
/**
46
* Create a LrWpanLqiTag with the given LQI value.
47
* @param lqi The LQI.
48
*/
49
LrWpanLqiTag
(uint8_t lqi);
50
51
uint32_t
GetSerializedSize
()
const override
;
52
void
Serialize
(
TagBuffer
i)
const override
;
53
void
Deserialize
(
TagBuffer
i)
override
;
54
void
Print
(std::ostream& os)
const override
;
55
56
/**
57
* Set the LQI to the given value.
58
*
59
* @param lqi the value of the LQI to set
60
*/
61
void
Set
(uint8_t lqi);
62
63
/**
64
* Get the LQI value.
65
*
66
* @return the LQI value
67
*/
68
uint8_t
Get
()
const
;
69
70
private
:
71
/**
72
* The current LQI value of the tag.
73
*/
74
uint8_t
m_lqi
;
75
};
76
77
}
// namespace lrwpan
78
}
// namespace ns3
79
#endif
/* LR_WPAN_LQI_TAG_H */
ns3::TagBuffer
read and write tag data
Definition
tag-buffer.h:41
ns3::Tag
tag a set of bytes in a packet
Definition
tag.h:28
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lrwpan::LrWpanLqiTag
Represent the LQI (Link Quality Estination).
Definition
lr-wpan-lqi-tag.h:29
ns3::lrwpan::LrWpanLqiTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
lr-wpan-lqi-tag.cc:53
ns3::lrwpan::LrWpanLqiTag::Set
void Set(uint8_t lqi)
Set the LQI to the given value.
Definition
lr-wpan-lqi-tag.cc:77
ns3::lrwpan::LrWpanLqiTag::LrWpanLqiTag
LrWpanLqiTag()
Create a LrWpanLqiTag with the default LQI 0.
Definition
lr-wpan-lqi-tag.cc:42
ns3::lrwpan::LrWpanLqiTag::m_lqi
uint8_t m_lqi
The current LQI value of the tag.
Definition
lr-wpan-lqi-tag.h:74
ns3::lrwpan::LrWpanLqiTag::Serialize
void Serialize(TagBuffer i) const override
Definition
lr-wpan-lqi-tag.cc:59
ns3::lrwpan::LrWpanLqiTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
lr-wpan-lqi-tag.cc:37
ns3::lrwpan::LrWpanLqiTag::Print
void Print(std::ostream &os) const override
Definition
lr-wpan-lqi-tag.cc:71
ns3::lrwpan::LrWpanLqiTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
lr-wpan-lqi-tag.cc:65
ns3::lrwpan::LrWpanLqiTag::Get
uint8_t Get() const
Get the LQI value.
Definition
lr-wpan-lqi-tag.cc:83
ns3::lrwpan::LrWpanLqiTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
lr-wpan-lqi-tag.cc:21
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 Wed Dec 11 2024 18:20:43 for ns-3 by
1.11.0