5G-MAG Reference Tools - MBMS Modem
Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
RestHandler Class Reference

The RESTful API handler. More...

#include <RestHandler.h>

Collaboration diagram for RestHandler:
Collaboration graph

Classes

class  ChannelInfo
 RX Info pertaining to an SCH (MCCH/MCH or PDSCH) More...
 

Public Types

typedef std::function< void(const std::string &antenna, unsigned fcen, double gain, unsigned sample_rate, unsigned bandwidth)> set_params_t
 Definition of the callback for setting new reception parameters. More...
 

Public Member Functions

 RestHandler (const libconfig::Config &cfg, const std::string &url, state_t &state, SdrReader &sdr, Phy &phy, set_params_t set_params)
 Default constructor. More...
 
virtual ~RestHandler ()
 Default destructor. More...
 
void start ()
 Start function for the listener. More...
 
float cinr_db ()
 Current instantaneous CINR value. More...
 
float cinr_db_avg ()
 Current average CINR value. More...
 
void add_cinr_value (float cinr)
 
void set_cas_processor (CasFrameProcessor *cas_processor)
 Save the pointer to the CasFrameProcessor. More...
 
void set_mbsfn_processor (MbsfnFrameProcessor *mbsfn_processor)
 Save the pointer to the vector cointaining the MbsfnFrameProcessors. More...
 

Public Attributes

std::vector< uint8_t > _ce_values = {}
 Time domain subcarrier CE values. More...
 
std::vector< uint8_t > _cir_values = {}
 Time domain channel impulse response of the CAS. More...
 
std::vector< uint8_t > _cir_values_mbsfn = {}
 Time domain channel impulse response of the mbsfn subframes. More...
 
std::vector< uint8_t > _corr_values = {}
 Correlaton samples from the sync functions. More...
 
std::vector< uint8_t > _corr_values_mbsfn = {}
 Correlaton samples from the sync functions. More...
 
ChannelInfo _pdsch
 RX info for PDSCH. More...
 
ChannelInfo _mcch
 RX info for MCCH. More...
 
std::map< uint32_t, ChannelInfo_mch
 RX info for MCHs. More...
 

Private Member Functions

void get (web::http::http_request message)
 
void put (web::http::http_request message)
 

Private Attributes

CasFrameProcessor_cas_processor
 
std::vector< MbsfnFrameProcessor * > _mbsfn_processors
 
std::vector< float > _cinr_db
 
const libconfig::Config & _cfg
 
std::unique_ptr< web::http::experimental::listener::http_listener > _listener
 
state_t_state
 
SdrReader_sdr
 
Phy_phy
 
set_params_t _set_params
 
bool _require_bearer_token = false
 
std::string _api_key
 

Detailed Description

The RESTful API handler.

Supports GET and PUT verbs for SDR parameters, and GET for reception info

Definition at line 47 of file RestHandler.h.

Member Typedef Documentation

◆ set_params_t

typedef std::function<void(const std::string& antenna, unsigned fcen, double gain, unsigned sample_rate, unsigned bandwidth)> RestHandler::set_params_t

Definition of the callback for setting new reception parameters.

Definition at line 52 of file RestHandler.h.

Constructor & Destructor Documentation

◆ RestHandler()

RestHandler::RestHandler ( const libconfig::Config &  cfg,
const std::string &  url,
state_t state,
SdrReader sdr,
Phy phy,
set_params_t  set_params 
)

Default constructor.

Parameters
cfgConfig singleton reference
urlURL to open the server on
stateReference to the main loop sate
sdrReference to the SDR reader
set_paramsSet parameters callback

Definition at line 36 of file RestHandler.cpp.

39  : _cfg(cfg),
40  _state(state),
41  _sdr(sdr),
42  _phy(phy),
43  _set_params(std::move(set_params)) {
44 
45  http_listener_config server_config;
46  if (url.rfind("https", 0) == 0) {
47  server_config.set_ssl_context_callback(
48  [&](boost::asio::ssl::context& ctx) {
49  std::string cert_file = "/usr/share/5gmag-rt/cert.pem";
50  cfg.lookupValue("modem.restful_api.cert", cert_file);
51 
52  std::string key_file = "/usr/share/5gmag-rt/key.pem";
53  cfg.lookupValue("modem.restful_api.key", key_file);
54 
55  ctx.set_options(boost::asio::ssl::context::default_workarounds);
56  ctx.use_certificate_chain_file(cert_file);
57  ctx.use_private_key_file(key_file, boost::asio::ssl::context::pem);
58  });
59  }
60 
61  cfg.lookupValue("modem.restful_api.api_key.enabled", _require_bearer_token);
63  _api_key = "106cd60-76c8-4c37-944c-df21aa690c1e";
64  cfg.lookupValue("modem.restful_api.api_key.key", _api_key);
65  }
66 
67  _listener = std::make_unique<http_listener>(
68  url, server_config);
69 
70  _listener->support(methods::GET, std::bind(&RestHandler::get, this, std::placeholders::_1)); // NOLINT
71  _listener->support(methods::PUT, std::bind(&RestHandler::put, this, std::placeholders::_1)); // NOLINT
72 
73  //_listener->open().wait();
74 }
SdrReader & _sdr
Definition: RestHandler.h:178
std::unique_ptr< web::http::experimental::listener::http_listener > _listener
Definition: RestHandler.h:175
void put(web::http::http_request message)
std::string _api_key
Definition: RestHandler.h:184
const libconfig::Config & _cfg
Definition: RestHandler.h:173
void get(web::http::http_request message)
Definition: RestHandler.cpp:78
state_t & _state
Definition: RestHandler.h:177
bool _require_bearer_token
Definition: RestHandler.h:183
set_params_t _set_params
Definition: RestHandler.h:181
static Config cfg
Global configuration object.
Definition: main.cpp:172
void set_params(const std::string &ant, unsigned fc, double g, unsigned sr, unsigned bw)
Set new SDR parameters and initialize resynchronisation.
Definition: main.cpp:205

◆ ~RestHandler()

RestHandler::~RestHandler ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ add_cinr_value()

void RestHandler::add_cinr_value ( float  cinr)

Definition at line 371 of file RestHandler.cpp.

371  {
372  if (_cinr_db.size() > CINR_RAVG_CNT) {
373  _cinr_db.erase(_cinr_db.begin());
374  }
375  _cinr_db.push_back(cinr);
376 }
const int CINR_RAVG_CNT
Definition: RestHandler.h:38
std::vector< float > _cinr_db
Definition: RestHandler.h:169

◆ cinr_db()

float RestHandler::cinr_db ( )
inline

Current instantaneous CINR value.

Definition at line 144 of file RestHandler.h.

144 { return _cinr_db.size() ? _cinr_db.back() : 0.0f; };

◆ cinr_db_avg()

float RestHandler::cinr_db_avg ( )
inline

Current average CINR value.

Definition at line 149 of file RestHandler.h.

149 { return _cinr_db.size() ? (std::accumulate(_cinr_db.begin(), _cinr_db.end(), 0.0f) / (_cinr_db.size() * 1.0f)) : 0.0f; };

◆ get()

void RestHandler::get ( web::http::http_request  message)
private

Definition at line 78 of file RestHandler.cpp.

78  {
79  spdlog::debug("Received GET request {}", message.to_string() );
80  auto paths = uri::split_path(uri::decode(message.relative_uri().path()));
82  (message.headers()["Authorization"] != "Bearer " + _api_key)) {
83  message.reply(status_codes::Unauthorized);
84  return;
85  }
86 
87  if (paths.empty()) {
88  message.reply(status_codes::NotFound);
89  } else {
90  if (paths[0] == "status") {
91  auto state = value::object();
92 
93  switch (_state) {
94  case searching:
95  state["state"] = value::string("searching");
96  break;
97  case syncing:
98  state["state"] = value::string("syncing");
99  break;
100  case processing:
101  state["state"] = value::string("synchronized");
102  break;
103  }
104 
105  if (_phy.cell().nof_prb == _phy.cell().mbsfn_prb) {
106  state["nof_prb"] = value(_phy.cell().nof_prb);
107  } else {
108  state["nof_prb"] = value(_phy.cell().mbsfn_prb);
109  }
110  state["cell_id"] = value(_phy.cell().id);
111  state["cfo"] = value(_phy.cfo());
112  state["cinr_db"] = value(cinr_db());
113  state["cinr_db_avg"] = value(cinr_db_avg());
114  state["subcarrier_spacing"] = value(_phy.mbsfn_subcarrier_spacing_khz());
115 
116  // CAS Chest params //
117  state["filter_order"] = value(_cas_processor->get_filter_order());
118  state["filter_coef"] = value(_cas_processor->get_filter_coef());
119  state["filter_type"] = value(_cas_processor->get_filter_type());
120  state["noise_alg"] = value(_cas_processor->get_noise_alg());
121  state["sync_error"] = value(_cas_processor->get_sync_error());
122  state["estimator_alg"] = value(_cas_processor->get_estimator_alg());
123  state["cfo_estimate"] = value(_cas_processor->get_cfo_estimate());
124  state["evm_meas"] = value(_cas_processor->get_evm_meas());
125 
126  // Phy params //
127  state["cfo_est_pss_find"] = value(_phy.get_ue_sync_find_cfo_pss_enable());
128  state["cfo_est_pss_track"] = value(_phy.get_ue_sync_track_cfo_pss_enable());
129  state["cfo_correct_find"] = value(_phy.get_ue_sync_find_cfo_correct_enable());
130  state["cfo_correct_track"] = value(_phy.get_ue_sync_track_cfo_correct_enable());
131  state["cfo_pss_loop_bw"] = value(_phy.get_ue_sync_cfo_loop_bw_pss());
132  state["cfo_ema_alpha_find"] = value(_phy.get_ue_sync_find_cfo_ema());
133  state["cfo_ema_alpha_track"] = value(_phy.get_ue_sync_track_cfo_ema());
134  state["pss_ema_find"] = value(_phy.get_ue_sync_pss_cfo_ema_find());
135  state["pss_ema_track"] = value(_phy.get_ue_sync_pss_cfo_ema_track());
136  state["threshold_find"] = value(_phy.get_ue_sync_threshold_find());
137  state["threshold_track"] = value(_phy.get_ue_sync_threshold_track());
138 
139 
140  message.reply(status_codes::OK, state);
141  } else if (paths[0] == "sdr_params") {
142  value sdr = value::object();
143  sdr["frequency"] = value(_sdr.get_frequency());
144  sdr["gain"] = value(_sdr.get_gain());
145  sdr["min_gain"] = value(_sdr.min_gain());
146  sdr["max_gain"] = value(_sdr.max_gain());
147  sdr["filter_bw"] = value(_sdr.get_filter_bw());
148  sdr["antenna"] = value(_sdr.get_antenna());
149  sdr["sample_rate"] = value(_sdr.get_sample_rate());
150  sdr["buffer_level"] = value(_sdr.get_buffer_level());
151  message.reply(status_codes::OK, sdr);
152  } else if (paths[0] == "ce_values") {
153  auto cestream = Concurrency::streams::bytestream::open_istream(_ce_values);
154  message.reply(status_codes::OK, cestream);
155  } else if (paths[0] == "cir_values") {
156  auto cestream = Concurrency::streams::bytestream::open_istream(_cir_values);
157  message.reply(status_codes::OK, cestream);
158  } else if (paths[0] == "cir_values_mbsfn") {
159  auto cestream = Concurrency::streams::bytestream::open_istream(_cir_values_mbsfn);
160  message.reply(status_codes::OK, cestream);
161  } else if (paths[0] == "corr_values") {
162  auto cestream = Concurrency::streams::bytestream::open_istream(_corr_values);
163  message.reply(status_codes::OK, cestream);
164  } else if (paths[0] == "corr_values_mbsfn") {
165  auto cestream = Concurrency::streams::bytestream::open_istream(_corr_values_mbsfn);
166  message.reply(status_codes::OK, cestream);
167  } else if (paths[0] == "pdsch_status") {
168  value sdr = value::object();
169  sdr["bler"] = value(static_cast<float>(_pdsch.errors) /
170  static_cast<float>(_pdsch.total));
171  sdr["ber"] = value(_pdsch.ber);
172  sdr["mcs"] = value(_pdsch.mcs);
173  sdr["present"] = 1;
174  message.reply(status_codes::OK, sdr);
175  } else if (paths[0] == "pdsch_data") {
176  auto cestream = Concurrency::streams::bytestream::open_istream(_pdsch.GetData());
177  message.reply(status_codes::OK, cestream);
178  } else if (paths[0] == "mcch_status") {
179  value sdr = value::object();
180  sdr["bler"] = value(static_cast<float>(_mcch.errors) /
181  static_cast<float>(_mcch.total));
182  sdr["ber"] = value(_mcch.ber);
183  sdr["mcs"] = value(_mcch.mcs);
184  sdr["present"] = 1;
185  message.reply(status_codes::OK, sdr);
186  } else if (paths[0] == "mcch_data") {
187  auto cestream = Concurrency::streams::bytestream::open_istream(_mcch.GetData());
188  message.reply(status_codes::OK, cestream);
189  } else if (paths[0] == "mch_info") {
190  std::vector<value> mi;
191  auto mch_info = _phy.mch_info();
192  std::for_each(std::begin(mch_info), std::end(mch_info), [&mi](Phy::mch_info_t const& mch) {
193  value m;
194  m["mcs"] = value(mch.mcs);
195  std::vector<value> mti;
196  std::for_each(std::begin(mch.mtchs), std::end(mch.mtchs), [&mti](Phy::mtch_info_t const& mtch) {
197  value mt;
198  mt["tmgi"] = value(mtch.tmgi);
199  mt["dest"] = value(mtch.dest);
200  mt["lcid"] = value(mtch.lcid);
201  mti.push_back(mt);
202  });
203  m["mtchs"] = value::array(mti);
204  mi.push_back(m);
205  });
206  message.reply(status_codes::OK, value::array(mi));
207  } else if (paths[0] == "mch_status") {
208  int idx = std::stoi(paths[1]);
209  value sdr = value::object();
210  sdr["bler"] = value(static_cast<float>(_mch[idx].errors) /
211  static_cast<float>(_mch[idx].total));
212  sdr["ber"] = value(_mch[idx].ber);
213  sdr["mcs"] = value(_mch[idx].mcs);
214  sdr["present"] = value(_mch[idx].present);
215  message.reply(status_codes::OK, sdr);
216  } else if (paths[0] == "mch_data") {
217  int idx = std::stoi(paths[1]);
218  auto cestream = Concurrency::streams::bytestream::open_istream(_mch[idx].GetData());
219  message.reply(status_codes::OK, cestream);
220  } else if (paths[0] == "log") {
221  std::string logfile = "/var/log/syslog";
222 
223  Concurrency::streams::file_stream<uint8_t>::open_istream(logfile).then(
224  [message](const Concurrency::streams::basic_istream<unsigned char>&
225  file_stream) {
226  message.reply(status_codes::OK, file_stream, "text/plain");
227  });
228  }
229  }
230 }
@ syncing
Definition: RestHandler.h:39
@ searching
Definition: RestHandler.h:39
@ processing
Definition: RestHandler.h:39
float get_ue_sync_threshold_track()
Definition: Phy.h:235
bool get_ue_sync_track_cfo_pss_enable()
Definition: Phy.h:185
const std::vector< mch_info_t > & mch_info()
Definition: Phy.h:253
bool get_ue_sync_find_cfo_pss_enable()
Definition: Phy.h:179
float get_ue_sync_pss_cfo_ema_find()
Definition: Phy.h:223
float get_ue_sync_track_cfo_ema()
Definition: Phy.h:205
srsran_cell_t cell()
Get the current cell (with params adjusted for MBSFN)
Definition: Phy.h:91
float get_ue_sync_find_cfo_ema()
Definition: Phy.h:211
float get_ue_sync_cfo_loop_bw_pss()
Definition: Phy.h:173
float mbsfn_subcarrier_spacing_khz()
Definition: Phy.h:275
bool get_ue_sync_find_cfo_correct_enable()
Definition: Phy.h:193
float get_ue_sync_pss_cfo_ema_track()
Definition: Phy.h:229
bool get_ue_sync_track_cfo_correct_enable()
Definition: Phy.h:199
float cfo()
Get the current CFO value.
Definition: Phy.h:108
float get_ue_sync_threshold_find()
Definition: Phy.h:241
std::vector< uint8_t > GetData()
Definition: RestHandler.h:84
CasFrameProcessor * _cas_processor
Definition: RestHandler.h:161
std::vector< uint8_t > _cir_values
Time domain channel impulse response of the CAS.
Definition: RestHandler.h:107
float cinr_db()
Current instantaneous CINR value.
Definition: RestHandler.h:144
float cinr_db_avg()
Current average CINR value.
Definition: RestHandler.h:149
std::vector< uint8_t > _ce_values
Time domain subcarrier CE values.
Definition: RestHandler.h:102
std::vector< uint8_t > _corr_values
Correlaton samples from the sync functions.
Definition: RestHandler.h:118
ChannelInfo _mcch
RX info for MCCH.
Definition: RestHandler.h:134
std::map< uint32_t, ChannelInfo > _mch
RX info for MCHs.
Definition: RestHandler.h:139
ChannelInfo _pdsch
RX info for PDSCH.
Definition: RestHandler.h:129
std::vector< uint8_t > _corr_values_mbsfn
Correlaton samples from the sync functions.
Definition: RestHandler.h:124
std::vector< uint8_t > _cir_values_mbsfn
Time domain channel impulse response of the mbsfn subframes.
Definition: RestHandler.h:112
double get_frequency()
Get current center frequency.
Definition: SdrReader.h:100
double get_buffer_level()
Get current ringbuffer level (0 = empty .
Definition: SdrReader.cpp:399
unsigned get_filter_bw()
Get current filter bandwidth.
Definition: SdrReader.h:105
std::string get_antenna()
Get current antenna port.
Definition: SdrReader.h:120
double max_gain()
Definition: SdrReader.h:129
double min_gain()
Definition: SdrReader.h:127
double get_gain()
Get current gain.
Definition: SdrReader.h:110
double get_sample_rate()
Get current sample rate.
Definition: SdrReader.h:95
std::vector< mtch_info_t > mtchs
Definition: Phy.h:250

◆ put()

void RestHandler::put ( web::http::http_request  message)
private

Definition at line 232 of file RestHandler.cpp.

232  {
233  spdlog::debug("Received PUT request {}", message.to_string() );
234 
235  if (_require_bearer_token &&
236  (message.headers()["Authorization"] != "Bearer " + _api_key)) {
237  message.reply(status_codes::Unauthorized);
238  return;
239  }
240 
241  auto paths = uri::split_path(uri::decode(message.relative_uri().path()));
242  if (paths.empty()) {
243  message.reply(status_codes::NotFound);
244  } else {
245  if (paths[0] == "sdr_params") {
246  value answer;
247 
248  auto f = _sdr.get_frequency();
249  auto g = _sdr.get_gain();
250  auto bw = _sdr.get_filter_bw();
251  auto a = _sdr.get_antenna();
252  auto sr = _sdr.get_sample_rate();
253 
254  const auto & jval = message.extract_json().get();
255  spdlog::debug("Received JSON: {}", jval.serialize());
256 
257  if (jval.has_field("antenna")) {
258  a = jval.at("antenna").as_string();
259  }
260  if (jval.has_field("frequency")) {
261  f = jval.at("frequency").as_integer();
262  }
263  if (jval.has_field("gain")) {
264  g = jval.at("gain").as_double();
265  }
266  _set_params( a, f, g, sr, bw);
267 
268  message.reply(status_codes::OK, answer);
269  } else if (paths[0] == "chest_cfg_params") {
270  value answer;
271 
272  const auto & jval = message.extract_json().get();
273  spdlog::debug("Recieved JSON: {}", jval.serialize());
274 
275  if (jval.has_field("noise_alg")) {
276  auto alg = jval.at("noise_alg").as_string();
277  spdlog::info("New alg est {}", alg);
278  _cas_processor->set_noise_alg(static_cast<srsran_chest_dl_noise_alg_t>(stoi(alg)));
279  }
280  if (jval.has_field("sync_error")) {
281  spdlog::info("New sync error value");
282 
283  bool alg = jval.at("sync_error").as_bool();
284 
285  spdlog::info("{}", alg);
287  }
288  if (jval.has_field("estimator_alg")) {
289  auto alg = jval.at("estimator_alg").as_string();
290  spdlog::info("New alg est {}", alg);
291  _cas_processor->set_estimator_alg(static_cast<srsran_chest_dl_estimator_alg_t>(stoi(alg)));
292  }
293  if (jval.has_field("filter_type")) {
294  auto type = jval.at("filter_type").as_string();
295  spdlog::info("New filter type {}", type);
296  _cas_processor->set_filter_type(static_cast<srsran_chest_filter_t>(stoi(type)));
297  }
298  if (jval.has_field("filter_order")) {
299  spdlog::info("New filter order");
300  auto order = jval.at("filter_order").as_integer();
302  }
303  if (jval.has_field("filter_coef")) {
304  spdlog::info("New filter coef");
305  auto coef = jval.at("filter_coef").as_double();
307  }
308 
309  // Phy params
310  if (jval.has_field("cfo_est_pss_find")) {
311  spdlog::info("New cfo est pss find");
312  auto toggle = jval.at("cfo_est_pss_find").as_bool();
314  }
315  if (jval.has_field("cfo_est_pss_track")) {
316  spdlog::info("New cfo est pss track");
317  auto toggle = jval.at("cfo_est_pss_track").as_bool();
319  }
320  if (jval.has_field("cfo_correct_find")) {
321  spdlog::info("New cfo correct find");
322  auto toggle = jval.at("cfo_correct_find").as_bool();
324  }
325  if (jval.has_field("cfo_correct_track")) {
326  spdlog::info("New cfo correct track");
327  auto toggle = jval.at("cfo_correct_track").as_bool();
329  }
330  if (jval.has_field("cfo_pss_loop_bw")) {
331  spdlog::info("New BW pss CFO loop");
332  auto bw = jval.at("cfo_pss_loop_bw").as_double();
334  }
335  if (jval.has_field("cfo_ema_alpha_find")) {
336  spdlog::info("New CFO ema alpha for find");
337  auto ema = jval.at("cfo_ema_alpha_find").as_double();
339  }
340  if (jval.has_field("cfo_ema_alpha_track")) {
341  spdlog::info("New CFO ema alpha for track");
342  auto ema = jval.at("cfo_ema_alpha_track").as_double();
344  }
345  if (jval.has_field("pss_ema_find")) {
346  spdlog::info("New PSS corr ema alpha for find");
347  auto ema = jval.at("pss_ema_find").as_double();
349  }
350  if (jval.has_field("pss_ema_track")) {
351  spdlog::info("New PSS corr ema alpha for track");
352  auto ema = jval.at("pss_ema_track").as_double();
354  }
355  if (jval.has_field("threshold_find")) {
356  spdlog::info("New threshold for find");
357  auto ema = jval.at("threshold_find").as_double();
359  }
360  if (jval.has_field("threshold_track")) {
361  spdlog::info("New threshold for track");
362  auto ema = jval.at("threshold_track").as_double();
364  }
365 
366  message.reply(status_codes::OK, answer);
367  }
368  }
369 }
void set_noise_alg(srsran_chest_dl_noise_alg_t noise_alg)
Set the noise estimation algorithm used in the channel estimation stage.
void set_sync_error(bool enable)
Enables the estimation os synchronization error.
void set_estimator_alg(srsran_chest_dl_estimator_alg_t estimator_alg)
Set the method to estimate the channel estimates of the complete resource grid from the reference sym...
void set_filter_coef(float filter_coef)
Set the coef for gauss filtering.
void set_filter_order(uint8_t filter_order)
Set the filter order used to filter the channel estimates.
void set_filter_type(srsran_chest_filter_t filter_type)
Set the filter type for chest.
void set_ue_sync_track_cfo_ema(float ema)
Sets the ema alpha value used for the tracking of the CFO in the trackin sync object,...
Definition: Phy.h:204
void set_ue_sync_threshold_track(float threshold)
Sets the threshold of the peak found while tracking for synchronization.
Definition: Phy.h:234
void set_ue_sync_find_cfo_ema(float ema)
Sets the ema alpha value used for the tracking of the CFO in the trackin sync object,...
Definition: Phy.h:210
void set_ue_sync_track_cfo_pss_enable(bool enable)
Enables or disables the CFO estimation from the PSS in the tracking stage.
Definition: Phy.h:184
void set_ue_sync_pss_cfo_ema_find(float ema)
Sets the weight factor alpha for the exponential moving average of the PSS correlation output
Definition: Phy.h:222
void set_ue_sync_pss_cfo_ema_track(float ema)
Sets the weight factor alpha for the exponential moving average of the PSS correlation output
Definition: Phy.h:228
void set_ue_sync_track_cfo_correct_enable(bool enable)
Enables the CFO correction while tracking the synchronization from previous estimations.
Definition: Phy.h:198
void set_ue_sync_find_cfo_pss_enable(bool enable)
Enables or disables the CFO estimation from the PSS in the finding stage.
Definition: Phy.h:178
void set_ue_sync_find_cfo_correct_enable(bool enable)
Enables the CFO correction while finding the synchronization from previous estimations.
Definition: Phy.h:190
void set_ue_sync_cfo_loop_bw_pss(float bw)
Set the factor for the PSS loopback.
Definition: Phy.h:172
void set_ue_sync_threshold_find(float threshold)
Sets the threshold of the peak found while searching for synchronization.
Definition: Phy.h:240

◆ set_cas_processor()

void RestHandler::set_cas_processor ( CasFrameProcessor cas_processor)
inline

Save the pointer to the CasFrameProcessor.

Definition at line 156 of file RestHandler.h.

156 { _cas_processor = cas_processor; };

◆ set_mbsfn_processor()

void RestHandler::set_mbsfn_processor ( MbsfnFrameProcessor mbsfn_processor)
inline

Save the pointer to the vector cointaining the MbsfnFrameProcessors.

Definition at line 161 of file RestHandler.h.

161 { _mbsfn_processors.push_back(mbsfn_processor); };
std::vector< MbsfnFrameProcessor * > _mbsfn_processors
Definition: RestHandler.h:167

◆ start()

void RestHandler::start ( )
inline

Start function for the listener.

Definition at line 73 of file RestHandler.h.

73 { _listener->open().wait(); }

Member Data Documentation

◆ _api_key

std::string RestHandler::_api_key
private

Definition at line 184 of file RestHandler.h.

◆ _cas_processor

CasFrameProcessor* RestHandler::_cas_processor
private

Definition at line 166 of file RestHandler.h.

◆ _ce_values

std::vector<uint8_t> RestHandler::_ce_values = {}

Time domain subcarrier CE values.

Definition at line 102 of file RestHandler.h.

◆ _cfg

const libconfig::Config& RestHandler::_cfg
private

Definition at line 173 of file RestHandler.h.

◆ _cinr_db

std::vector<float> RestHandler::_cinr_db
private

Definition at line 169 of file RestHandler.h.

◆ _cir_values

std::vector<uint8_t> RestHandler::_cir_values = {}

Time domain channel impulse response of the CAS.

Definition at line 107 of file RestHandler.h.

◆ _cir_values_mbsfn

std::vector<uint8_t> RestHandler::_cir_values_mbsfn = {}

Time domain channel impulse response of the mbsfn subframes.

Definition at line 112 of file RestHandler.h.

◆ _corr_values

std::vector<uint8_t> RestHandler::_corr_values = {}

Correlaton samples from the sync functions.

Definition at line 118 of file RestHandler.h.

◆ _corr_values_mbsfn

std::vector<uint8_t> RestHandler::_corr_values_mbsfn = {}

Correlaton samples from the sync functions.

Definition at line 124 of file RestHandler.h.

◆ _listener

std::unique_ptr<web::http::experimental::listener::http_listener> RestHandler::_listener
private

Definition at line 175 of file RestHandler.h.

◆ _mbsfn_processors

std::vector<MbsfnFrameProcessor*> RestHandler::_mbsfn_processors
private

Definition at line 167 of file RestHandler.h.

◆ _mcch

ChannelInfo RestHandler::_mcch

RX info for MCCH.

Definition at line 134 of file RestHandler.h.

◆ _mch

std::map<uint32_t, ChannelInfo> RestHandler::_mch

RX info for MCHs.

Definition at line 139 of file RestHandler.h.

◆ _pdsch

ChannelInfo RestHandler::_pdsch

RX info for PDSCH.

Definition at line 129 of file RestHandler.h.

◆ _phy

Phy& RestHandler::_phy
private

Definition at line 179 of file RestHandler.h.

◆ _require_bearer_token

bool RestHandler::_require_bearer_token = false
private

Definition at line 183 of file RestHandler.h.

◆ _sdr

SdrReader& RestHandler::_sdr
private

Definition at line 178 of file RestHandler.h.

◆ _set_params

set_params_t RestHandler::_set_params
private

Definition at line 181 of file RestHandler.h.

◆ _state

state_t& RestHandler::_state
private

Definition at line 177 of file RestHandler.h.


The documentation for this class was generated from the following files: