lora-beam-tag.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2017 University of Padova
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Bastien Tauran <bastien.tauran@viveris.fr>
19  */
20 
21 #include "lora-beam-tag.h"
22 
23 #include <ns3/log.h>
24 
25 NS_LOG_COMPONENT_DEFINE("LoraBeamTag");
26 
27 namespace ns3
28 {
29 
30 NS_OBJECT_ENSURE_REGISTERED(LoraBeamTag);
31 
32 TypeId
34 {
35  static TypeId tid = TypeId("ns3::LoraBeamTag").SetParent<Tag>().AddConstructor<LoraBeamTag>();
36  return tid;
37 }
38 
39 TypeId
41 {
42  return GetTypeId();
43 }
44 
45 LoraBeamTag::LoraBeamTag(uint8_t beamId)
46  : m_beamId(beamId)
47 {
48 }
49 
51 {
52 }
53 
54 uint32_t
56 {
57  return 1;
58 }
59 
60 void
61 LoraBeamTag::Serialize(TagBuffer i) const
62 {
63  i.WriteU8(m_beamId);
64 }
65 
66 void
68 {
69  m_beamId = i.ReadU8();
70 }
71 
72 void
73 LoraBeamTag::Print(std::ostream& os) const
74 {
75  os << m_beamId;
76 }
77 
78 uint8_t
80 {
81  return m_beamId;
82 }
83 
84 void
85 LoraBeamTag::SetBeamId(uint8_t beamId)
86 {
87  m_beamId = beamId;
88 }
89 
90 } // namespace ns3
virtual TypeId GetInstanceTypeId(void) const
void SetBeamId(uint8_t beamId)
Set which beamId this packet was transmitted with.
uint8_t GetBeamId() const
Read which beam ID this packet was transmitted with.
static TypeId GetTypeId(void)
uint8_t m_beamId
The beam ID used by the packet.
Definition: lora-beam-tag.h:68
virtual void Serialize(TagBuffer i) const
virtual ~LoraBeamTag()
virtual uint32_t GetSerializedSize() const
virtual void Print(std::ostream &os) const
LoraBeamTag(uint8_t beamId=0)
Create a LoraBeamTag with a given beam ID.
virtual void Deserialize(TagBuffer i)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.