EMANE  1.2.1
frameworkphy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014,2016-2017 - Adjacent Link LLC, Bridgewater,
3  * New Jersey
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of Adjacent Link LLC nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef EMANEFRAMEWORK_HEADER_
35 #define EMANEFRAMEWORK_HEADER_
36 
37 #include "emane/phylayerimpl.h"
38 #include "emane/phytypes.h"
40 
41 #include "locationmanager.h"
42 #include "spectrummonitor.h"
43 #include "gainmanager.h"
45 #include "eventtablepublisher.h"
47 #include "fadingmanager.h"
48 
49 #include <set>
50 #include <cstdint>
51 #include <memory>
52 
53 namespace EMANE
54 {
56  {
57  public:
59  PlatformServiceProvider* pPlatformService,
60  SpectrumMonitor * pSpectrumMonitor);
61 
62  ~FrameworkPHY();
63 
64  void initialize(Registrar & registrar) override;
65 
66  void configure(const ConfigurationUpdate & update) override;
67 
68  void start() override;
69 
70  void stop() override;
71 
72  void destroy() throw() override;
73 
74  void processConfiguration(const ConfigurationUpdate & update) override;
75 
76  void processUpstreamPacket(const CommonPHYHeader & hdr,
77  UpstreamPacket & pkt,
78  const ControlMessages & msgs) override;
79 
80  // provides test harness access
81  void processUpstreamPacket_i(const TimePoint & now,
82  const CommonPHYHeader & hdr,
83  UpstreamPacket & pkt,
84  const ControlMessages & msgs);
85 
86  void processDownstreamControl(const ControlMessages & msgs) override;
87 
89  const ControlMessages & msgs) override;
90 
91  void processEvent(const EventId & eventId,
92  const Serialization & serialization) override;
93 
94 
96 
97  private:
98  SpectrumMonitor * pSpectrumMonitor_;
99  GainManager gainManager_;
100  LocationManager locationManager_;
101  std::uint64_t u64BandwidthHz_;
102  double dTxPowerdBm_;
103  std::uint64_t u64TxFrequencyHz_;
104  double dReceiverSensitivitydBm_;
105  SpectrumMonitor::NoiseMode noiseMode_;
106  std::uint16_t u16SubId_;
107  std::uint16_t u16TxSequenceNumber_;
108  std::pair<double,bool> optionalFixedAntennaGaindBi_;
109  std::unique_ptr<PropagationModelAlgorithm> pPropagationModelAlgorithm_;
110  Utils::CommonLayerStatistics commonLayerStatistics_;
111  EventTablePublisher eventTablePublisher_;
112  ReceivePowerTablePublisher receivePowerTablePublisher_;
113  Microseconds noiseBinSize_;
114  Microseconds maxSegmentOffset_;
115  Microseconds maxMessagePropagation_;
116  Microseconds maxSegmentDuration_;
117  Microseconds timeSyncThreshold_;
118  bool bNoiseMaxClamp_;
119  double dSystemNoiseFiguredB_;
120  StatisticNumeric<std::uint64_t> * pTimeSyncThresholdRewrite_;
121  FadingManager fadingManager_;
122  };
123 }
124 
125 #endif // EMANEFRAMEWORK_HEADER_
126 
std::string Serialization
Definition: serializable.h:42
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
The Registrar interface provides access to all of the emulator registrars.
Definition: registrar.h:50
void configure(const ConfigurationUpdate &update) override
void start() override
Interface used to create a PHY layer plugin implementation.
Definition: phylayerimpl.h:53
void destroy() override
std::list< const ControlMessage * > ControlMessages
void processUpstreamPacket(const CommonPHYHeader &hdr, UpstreamPacket &pkt, const ControlMessages &msgs) override
Common NEM layer statistics and drop reason tables.
void processEvent(const EventId &eventId, const Serialization &serialization) override
std::uint16_t EventId
Definition: types.h:53
The PlatformServiceProvider interface provides access to emulator services.
void processConfiguration(const ConfigurationUpdate &update) override
void initialize(Registrar &registrar) override
The common physical layer header used to facilitate heterogeneous radio model experimentation.
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
void processDownstreamPacket(DownstreamPacket &pkt, const ControlMessages &msgs) override
SpectrumMonitor & getSpectrumMonitor()
void stop() override
std::chrono::microseconds Microseconds
Definition: types.h:45
std::uint16_t NEMId
Definition: types.h:52
void processUpstreamPacket_i(const TimePoint &now, const CommonPHYHeader &hdr, UpstreamPacket &pkt, const ControlMessages &msgs)
void processDownstreamControl(const ControlMessages &msgs) override
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
Clock::time_point TimePoint
Definition: types.h:50
FrameworkPHY(NEMId id, PlatformServiceProvider *pPlatformService, SpectrumMonitor *pSpectrumMonitor)
Definition: frameworkphy.cc:96
Definition: agent.h:43