A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lr-wpan-lqi-tag.cc
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#include "lr-wpan-lqi-tag.h"
10
11#include <ns3/integer.h>
12
13namespace ns3
14{
15namespace lrwpan
16{
17
18NS_OBJECT_ENSURE_REGISTERED(LrWpanLqiTag);
19
20TypeId
22{
23 static TypeId tid = TypeId("ns3::lrwpan::LrWpanLqiTag")
24 .AddDeprecatedName("ns3::LrWpanLqiTag")
25 .SetParent<Tag>()
26 .SetGroupName("LrWpan")
27 .AddConstructor<LrWpanLqiTag>()
28 .AddAttribute("Lqi",
29 "The lqi of the last packet received",
30 IntegerValue(0),
33 return tid;
34}
35
38{
39 return GetTypeId();
40}
41
43 : m_lqi(0)
44{
45}
46
48 : m_lqi(lqi)
49{
50}
51
54{
55 return sizeof(uint8_t);
56}
57
58void
63
64void
69
70void
71LrWpanLqiTag::Print(std::ostream& os) const
72{
73 os << "Lqi = " << m_lqi;
74}
75
76void
78{
79 m_lqi = lqi;
80}
81
82uint8_t
84{
85 return m_lqi;
86}
87
88} // namespace lrwpan
89} // namespace ns3
Hold a signed integer type.
Definition integer.h:34
read and write tag data
Definition tag-buffer.h:41
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition tag-buffer.h:161
TAG_BUFFER_INLINE uint8_t ReadU8()
Definition tag-buffer.h:185
tag a set of bytes in a packet
Definition tag.h:28
a unique identifier for an interface.
Definition type-id.h:48
TypeId AddDeprecatedName(const std::string &name)
Add an deprecated name for a TypeId.
Definition type-id.cc:862
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
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.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeIntegerChecker()
Definition integer.h:99
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Definition integer.h:35