A Discrete-Event Network Simulator
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
14namespace ns3
15{
16namespace 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 */
28class 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 */
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 */
read and write tag data
Definition tag-buffer.h:41
tag a set of bytes in a packet
Definition tag.h:28
a unique identifier for an interface.
Definition type-id.h:48
Represent the LQI (Link Quality Estination).
uint32_t GetSerializedSize() const override
void Set(uint8_t lqi)
Set the LQI to the given value.
LrWpanLqiTag()
Create a LrWpanLqiTag with the default LQI 0.
uint8_t m_lqi
The current LQI value of the tag.
void Serialize(TagBuffer i) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const override
void Deserialize(TagBuffer i) override
uint8_t Get() const
Get the LQI value.
static TypeId GetTypeId()
Get the type ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.