EMANE  1.0.1
frameworkphy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014,2016 - 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 
48 #include <set>
49 #include <cstdint>
50 #include <memory>
51 
52 namespace EMANE
53 {
55  {
56  public:
58  PlatformServiceProvider* pPlatformService,
59  SpectrumMonitor * pSpectrumMonitor);
60 
61  ~FrameworkPHY();
62 
63  void initialize(Registrar & registrar) override;
64 
65  void configure(const ConfigurationUpdate & update) override;
66 
67  void start() override;
68 
69  void stop() override;
70 
71  void destroy() throw() override;
72 
73  void processConfiguration(const ConfigurationUpdate & update) override;
74 
75  void processUpstreamPacket(const CommonPHYHeader & hdr,
76  UpstreamPacket & pkt,
77  const ControlMessages & msgs) override;
78 
79  // provides test harness access
80  void processUpstreamPacket_i(const TimePoint & now,
81  const CommonPHYHeader & hdr,
82  UpstreamPacket & pkt,
83  const ControlMessages & msgs);
84 
85  void processDownstreamControl(const ControlMessages & msgs) override;
86 
88  const ControlMessages & msgs) override;
89 
90  void processEvent(const EventId & eventId,
91  const Serialization & serialization) override;
92 
93 
95 
96  private:
97  SpectrumMonitor * pSpectrumMonitor_;
98  GainManager gainManager_;
99  LocationManager locationManager_;
100  std::uint64_t u64BandwidthHz_;
101  double dTxPowerdBm_;
102  std::uint64_t u64TxFrequencyHz_;
103  double dReceiverSensitivitydBm_;
104  SpectrumMonitor::NoiseMode noiseMode_;
105  std::uint16_t u16SubId_;
106  std::uint16_t u16TxSequenceNumber_;
107  std::pair<double,bool> optionalFixedAntennaGaindBi_;
108  std::unique_ptr<PropagationModelAlgorithm> pPropagationModelAlgorithm_;
109  Utils::CommonLayerStatistics commonLayerStatistics_;
110  EventTablePublisher eventTablePublisher_;
111  ReceivePowerTablePublisher receivePowerTablePublisher_;
112  Microseconds noiseBinSize_;
113  Microseconds maxSegmentOffset_;
114  Microseconds maxMessagePropagation_;
115  Microseconds maxSegmentDuration_;
116  Microseconds timeSyncThreshold_;
117  bool bNoiseMaxClamp_;
118  double dSystemNoiseFiguredB_;
119  StatisticNumeric<std::uint64_t> * pTimeSyncThresholdRewrite_;
120  };
121 }
122 
123 #endif // EMANEFRAMEWORK_HEADER_
124 
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:86
Definition: agent.h:43