satellite-phy-tx.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
4  * Copyright (c) 2018 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Jani Puttonen <jani.puttonen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.com>
21  */
22 
23 #ifndef SATELLITE_PHY_TX_H
24 #define SATELLITE_PHY_TX_H
25 
27 #include "satellite-base-fading.h"
29 #include "satellite-net-device.h"
31 
32 #include <ns3/mac48-address.h>
33 #include <ns3/mobility-model.h>
34 #include <ns3/nstime.h>
35 #include <ns3/packet.h>
36 
37 #include <map>
38 #include <stdint.h>
39 
40 namespace ns3
41 {
42 
43 class SatChannel;
44 
51 class SatPhyTx : public Object
52 {
53  public:
54  typedef enum
55  {
59 
63  SatPhyTx();
64 
68  virtual ~SatPhyTx();
69 
73  enum State
74  {
76  TX,
78  };
79 
83  static TypeId GetTypeId(void);
84 
88  virtual void DoDispose();
89 
90  void SetChannel(Ptr<SatChannel> c);
91  void ClearChannel();
92  Ptr<SatChannel> GetChannel();
93 
94  void SetMobility(Ptr<MobilityModel> m);
95  Ptr<MobilityModel> GetMobility();
96 
97  /*
98  * Set the transmit antenna gain pattern.
99  * \param agp antenna gain pattern
100  * \param mobility mobility model of satellite
101  */
102  void SetAntennaGainPattern(Ptr<SatAntennaGainPattern> agp, Ptr<SatMobilityModel> mobility);
103 
108  void SetMaxAntennaGain_Db(double gain_db);
109 
117  double GetAntennaGain(Ptr<MobilityModel> mobility);
118 
123  void SetDefaultFadingValue(double fadingValue);
124 
131  double GetFadingValue(Address macAddress, SatEnums::ChannelType_t channelType);
132 
137  void SetFadingContainer(Ptr<SatBaseFading> fadingContainer);
138 
143  virtual void StartTx(Ptr<SatSignalParameters> txParams);
144 
149  void SetSatId(uint32_t satId);
150 
155  void SetBeamId(uint32_t beamId);
156 
160  bool IsTransmitting(void) const;
161 
165  bool CanTransmit(void) const;
166 
167  protected:
168  virtual void EndTx();
169 
170  private:
171  void ChangeState(State newState);
172 
173  Ptr<MobilityModel> m_mobility;
174  Ptr<SatChannel> m_channel;
175 
176  /*
177  * Transmit antenna gain pattern
178  */
179  Ptr<SatAntennaGainPattern> m_antennaGainPattern;
180 
181  /*
182  * Satellite mobility model
183  */
184  Ptr<SatMobilityModel> m_satMobility;
185 
190 
192  uint32_t m_satId;
193  uint32_t m_beamId;
195 
199  Ptr<SatBaseFading> m_fadingContainer;
200 
205 };
206 
207 } // namespace ns3
208 
209 #endif /* SATELLITE_PHY_TX_H */
ChannelType_t
Types of channel.
The SatellitePhyTx models the physical layer transmitter of satellite system.
void SetDefaultFadingValue(double fadingValue)
Function for setting the default fading value.
void SetSatId(uint32_t satId)
Set the satellite id for all the transmissions from this SatPhyTx.
bool CanTransmit(void) const
Tell whether or not this channel can transmit data.
Ptr< SatAntennaGainPattern > m_antennaGainPattern
void SetChannel(Ptr< SatChannel > c)
double m_maxAntennaGain
Configured maximum antenna gain in linear.
double GetFadingValue(Address macAddress, SatEnums::ChannelType_t channelType)
Get fading value.
Ptr< MobilityModel > m_mobility
Ptr< MobilityModel > GetMobility()
SatPhyTxMode_t m_txMode
void SetAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > mobility)
bool IsTransmitting(void) const
Tell whether or not this channel is transmitting data.
virtual void EndTx()
void SetBeamId(uint32_t beamId)
Set the beam id for all the transmissions from this SatPhyTx.
double m_defaultFadingValue
Default fading value.
void ChangeState(State newState)
virtual void StartTx(Ptr< SatSignalParameters > txParams)
Start packet transmission to the channel.
void SetMobility(Ptr< MobilityModel > m)
State
PHY states.
Ptr< SatMobilityModel > m_satMobility
SatPhyTx()
Default constructor.
Ptr< SatBaseFading > m_fadingContainer
Fading container for fading model.
Ptr< SatChannel > GetChannel()
double GetAntennaGain(Ptr< MobilityModel > mobility)
Get antenna gain based on position or in case that antenna pattern is not configured,...
Ptr< SatChannel > m_channel
virtual ~SatPhyTx()
Destructor for SatPhyTx.
virtual void DoDispose()
Dispose of this class instance.
void SetMaxAntennaGain_Db(double gain_db)
Set the maximum Antenna gain in Db.
void SetFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
static TypeId GetTypeId(void)
inherited from Object
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.