A Discrete-Event Network Simulator
API
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 
37 class LrWpanLqiTag : public Tag
38 {
39  public:
45  static TypeId GetTypeId();
46 
47  TypeId GetInstanceTypeId() const override;
48 
52  LrWpanLqiTag();
53 
58  LrWpanLqiTag(uint8_t lqi);
59 
60  uint32_t GetSerializedSize() const override;
61  void Serialize(TagBuffer i) const override;
62  void Deserialize(TagBuffer i) override;
63  void Print(std::ostream& os) const override;
64 
70  void Set(uint8_t lqi);
71 
77  uint8_t Get() const;
78 
79  private:
83  uint8_t m_lqi;
84 };
85 
86 } // namespace ns3
87 #endif /* LR_WPAN_LQI_TAG_H */
Represent the LQI (Link Quality Estination).
void Deserialize(TagBuffer i) override
uint8_t Get() const
Get the LQI value.
void Set(uint8_t lqi)
Set the LQI to the given value.
uint32_t GetSerializedSize() const override
uint8_t m_lqi
The current LQI value of the tag.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
LrWpanLqiTag()
Create a LrWpanLqiTag with the default LQI 0.
void Serialize(TagBuffer i) const override
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.