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 
39 namespace ns3
40 {
41 
42 class SatChannel;
43 
50 class SatPhyTx : public Object
51 {
52  public:
53  typedef enum
54  {
58 
62  SatPhyTx();
63 
67  virtual ~SatPhyTx();
68 
72  enum State
73  {
75  TX,
77  };
78 
82  static TypeId GetTypeId(void);
83 
87  virtual void DoDispose();
88 
89  void SetChannel(Ptr<SatChannel> c);
90  void ClearChannel();
91  Ptr<SatChannel> GetChannel();
92 
93  void SetMobility(Ptr<MobilityModel> m);
94  Ptr<MobilityModel> GetMobility();
95 
96  /*
97  * Set the transmit antenna gain pattern.
98  * \param agp antenna gain pattern
99  * \param mobility mobility model of satellite
100  */
101  void SetAntennaGainPattern(Ptr<SatAntennaGainPattern> agp, Ptr<SatMobilityModel> mobility);
102 
107  void SetMaxAntennaGain_Db(double gain_db);
108 
116  double GetAntennaGain(Ptr<MobilityModel> mobility);
117 
122  void SetDefaultFadingValue(double fadingValue);
123 
130  double GetFadingValue(Address macAddress, SatEnums::ChannelType_t channelType);
131 
136  void SetFadingContainer(Ptr<SatBaseFading> fadingContainer);
137 
142  virtual void StartTx(Ptr<SatSignalParameters> txParams);
143 
148  void SetSatId(uint32_t satId);
149 
154  void SetBeamId(uint32_t beamId);
155 
159  bool IsTransmitting(void) const;
160 
164  bool CanTransmit(void) const;
165 
166  protected:
167  virtual void EndTx();
168 
169  private:
170  void ChangeState(State newState);
171 
172  Ptr<MobilityModel> m_mobility;
173  Ptr<SatChannel> m_channel;
174 
175  /*
176  * Transmit antenna gain pattern
177  */
178  Ptr<SatAntennaGainPattern> m_antennaGainPattern;
179 
180  /*
181  * Satellite mobility model
182  */
183  Ptr<SatMobilityModel> m_satMobility;
184 
189 
191  uint32_t m_satId;
192  uint32_t m_beamId;
194 
198  Ptr<SatBaseFading> m_fadingContainer;
199 
204 };
205 
206 } // namespace ns3
207 
208 #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.