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 #include <ostream>
26 
27 NS_LOG_COMPONENT_DEFINE("LoraBeamTag");
28 
29 namespace ns3
30 {
31 
32 NS_OBJECT_ENSURE_REGISTERED(LoraBeamTag);
33 
34 TypeId
36 {
37  static TypeId tid = TypeId("ns3::LoraBeamTag").SetParent<Tag>().AddConstructor<LoraBeamTag>();
38  return tid;
39 }
40 
41 TypeId
43 {
44  return GetTypeId();
45 }
46 
47 LoraBeamTag::LoraBeamTag(uint8_t beamId)
48  : m_beamId(beamId)
49 {
50 }
51 
53 {
54 }
55 
56 uint32_t
58 {
59  return 1;
60 }
61 
62 void
63 LoraBeamTag::Serialize(TagBuffer i) const
64 {
65  i.WriteU8(m_beamId);
66 }
67 
68 void
70 {
71  m_beamId = i.ReadU8();
72 }
73 
74 void
75 LoraBeamTag::Print(std::ostream& os) const
76 {
77  os << m_beamId;
78 }
79 
80 uint8_t
82 {
83  return m_beamId;
84 }
85 
86 void
87 LoraBeamTag::SetBeamId(uint8_t beamId)
88 {
89  m_beamId = beamId;
90 }
91 
92 } // 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:71
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.