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);
88 message.reply(status_codes::NotFound);
90 if (paths[0] ==
"status") {
91 auto state = value::object();
95 state[
"state"] = value::string(
"searching");
98 state[
"state"] = value::string(
"syncing");
101 state[
"state"] = value::string(
"synchronized");
106 state[
"nof_prb"] = value(
_phy.
cell().nof_prb);
108 state[
"nof_prb"] = value(
_phy.
cell().mbsfn_prb);
110 state[
"cell_id"] = value(
_phy.
cell().id);
111 state[
"cfo"] = value(
_phy.
cfo());
112 state[
"cinr_db"] = value(
cinr_db());
140 message.reply(status_codes::OK, state);
141 }
else if (paths[0] ==
"sdr_params") {
142 value sdr = value::object();
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") {
166 message.reply(status_codes::OK, cestream);
167 }
else if (paths[0] ==
"pdsch_status") {
168 value sdr = value::object();
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) /
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;
192 std::for_each(std::begin(mch_info), std::end(mch_info), [&mi](
Phy::mch_info_t const& mch) {
194 m[
"mcs"] = value(mch.
mcs);
195 std::vector<value> mti;
198 mt[
"tmgi"] = value(mtch.tmgi);
199 mt[
"dest"] = value(mtch.dest);
200 mt[
"lcid"] = value(mtch.lcid);
203 m[
"mtchs"] = value::array(mti);
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";
223 Concurrency::streams::file_stream<uint8_t>::open_istream(logfile).then(
224 [message](
const Concurrency::streams::basic_istream<unsigned char>&
226 message.reply(status_codes::OK, file_stream,
"text/plain");
uint8_t get_filter_order()
uint8_t get_estimator_alg()
uint8_t get_filter_type()
float get_ue_sync_threshold_track()
bool get_ue_sync_track_cfo_pss_enable()
const std::vector< mch_info_t > & mch_info()
bool get_ue_sync_find_cfo_pss_enable()
float get_ue_sync_pss_cfo_ema_find()
float get_ue_sync_track_cfo_ema()
srsran_cell_t cell()
Get the current cell (with params adjusted for MBSFN)
float get_ue_sync_find_cfo_ema()
float get_ue_sync_cfo_loop_bw_pss()
float mbsfn_subcarrier_spacing_khz()
bool get_ue_sync_find_cfo_correct_enable()
float get_ue_sync_pss_cfo_ema_track()
bool get_ue_sync_track_cfo_correct_enable()
float cfo()
Get the current CFO value.
float get_ue_sync_threshold_find()
std::vector< uint8_t > GetData()
CasFrameProcessor * _cas_processor
std::vector< uint8_t > _cir_values
Time domain channel impulse response of the CAS.
float cinr_db()
Current instantaneous CINR value.
float cinr_db_avg()
Current average CINR value.
std::vector< uint8_t > _ce_values
Time domain subcarrier CE values.
std::vector< uint8_t > _corr_values
Correlaton samples from the sync functions.
ChannelInfo _mcch
RX info for MCCH.
std::map< uint32_t, ChannelInfo > _mch
RX info for MCHs.
ChannelInfo _pdsch
RX info for PDSCH.
std::vector< uint8_t > _corr_values_mbsfn
Correlaton samples from the sync functions.
std::vector< uint8_t > _cir_values_mbsfn
Time domain channel impulse response of the mbsfn subframes.
double get_frequency()
Get current center frequency.
double get_buffer_level()
Get current ringbuffer level (0 = empty .
unsigned get_filter_bw()
Get current filter bandwidth.
std::string get_antenna()
Get current antenna port.
double get_gain()
Get current gain.
double get_sample_rate()
Get current sample rate.
std::vector< mtch_info_t > mtchs