5G-MAG Reference Tools - MBMS Modem
src
CasFrameProcessor.h
Go to the documentation of this file.
1
// 5G-MAG Reference Tools
2
// MBMS Modem Process
3
//
4
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
5
//
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU Affero General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU Affero General Public License for more details.
15
//
16
// You should have received a copy of the GNU Affero General Public License
17
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
//
19
20
#pragma once
21
22
#include <cstdint>
23
#include <string>
24
#include <vector>
25
#include <thread>
26
#include "srsran/srsran.h"
27
#include "srsran/rlc/rlc.h"
28
#include "
Phy.h
"
29
#include "
RestHandler.h
"
30
#include <libconfig.h++>
31
37
class
CasFrameProcessor
{
38
public
:
47
CasFrameProcessor
(
const
libconfig::Config&
cfg
,
Phy
& phy, srsran::rlc& rlc,
RestHandler
& rest,
unsigned
rx_channels)
48
:
_cfg
(
cfg
)
49
,
_phy
(phy)
50
,
_rest
(rest)
51
,
_rlc
(rlc)
52
,
_rx_channels
(rx_channels)
53
{}
54
58
virtual
~CasFrameProcessor
();
59
64
bool
init
();
65
72
bool
process
(uint32_t tti);
73
79
void
set_cell
(srsran_cell_t cell);
80
84
cf_t**
rx_buffer
() {
_mutex
.lock();
return
_signal_buffer_rx
; }
85
89
uint32_t
rx_buffer_size
() {
return
_signal_buffer_max_samples
; }
90
96
void
unlock
() {
_mutex
.unlock(); }
97
102
std::vector<uint8_t>
ce_values
();
103
107
std::vector<uint8_t>
pdsch_data
();
108
112
float
cinr_db
() {
return
_ue_dl
.chest_res.snr_db; }
113
114
private
:
115
const
libconfig::Config&
_cfg
;
116
srsran::rlc&
_rlc
;
117
Phy
&
_phy
;
118
RestHandler
&
_rest
;
119
120
cf_t*
_signal_buffer_rx
[SRSRAN_MAX_PORTS] = {};
121
uint32_t
_signal_buffer_max_samples
= 0;
122
123
srsran_softbuffer_rx_t
_softbuffer
;
124
uint8_t*
_data
[SRSRAN_MAX_CODEWORDS];
125
126
srsran_ue_dl_t
_ue_dl
= {};
127
srsran_ue_dl_cfg_t
_ue_dl_cfg
= {};
128
srsran_dl_sf_cfg_t
_sf_cfg
= {};
129
130
srsran_cell_t
_cell
;
131
std::mutex
_mutex
;
132
unsigned
_rx_channels
;
133
};
Phy.h
RestHandler.h
CasFrameProcessor
Frame processor for CAS subframes.
Definition:
CasFrameProcessor.h:37
CasFrameProcessor::_softbuffer
srsran_softbuffer_rx_t _softbuffer
Definition:
CasFrameProcessor.h:123
CasFrameProcessor::_ue_dl_cfg
srsran_ue_dl_cfg_t _ue_dl_cfg
Definition:
CasFrameProcessor.h:127
CasFrameProcessor::ce_values
std::vector< uint8_t > ce_values()
Get the CE values (time domain) for displaying the spectrum of the received signal.
Definition:
CasFrameProcessor.cpp:165
CasFrameProcessor::_rx_channels
unsigned _rx_channels
Definition:
CasFrameProcessor.h:132
CasFrameProcessor::_data
uint8_t * _data[SRSRAN_MAX_CODEWORDS]
Definition:
CasFrameProcessor.h:124
CasFrameProcessor::_rest
RestHandler & _rest
Definition:
CasFrameProcessor.h:118
CasFrameProcessor::~CasFrameProcessor
virtual ~CasFrameProcessor()
Default destructor.
Definition:
CasFrameProcessor.cpp:73
CasFrameProcessor::_signal_buffer_max_samples
uint32_t _signal_buffer_max_samples
Definition:
CasFrameProcessor.h:121
CasFrameProcessor::_ue_dl
srsran_ue_dl_t _ue_dl
Definition:
CasFrameProcessor.h:126
CasFrameProcessor::rx_buffer
cf_t ** rx_buffer()
Get a handle of the signal buffer to store samples for processing in.
Definition:
CasFrameProcessor.h:84
CasFrameProcessor::init
bool init()
Initialize signal- and softbuffers, init all underlying components.
Definition:
CasFrameProcessor.cpp:24
CasFrameProcessor::_sf_cfg
srsran_dl_sf_cfg_t _sf_cfg
Definition:
CasFrameProcessor.h:128
CasFrameProcessor::set_cell
void set_cell(srsran_cell_t cell)
Set the parameters for the cell (Nof PRB, etc).
Definition:
CasFrameProcessor.cpp:83
CasFrameProcessor::pdsch_data
std::vector< uint8_t > pdsch_data()
Get the constellation diagram data (I/Q data of the subcarriers after CE)
Definition:
CasFrameProcessor.cpp:175
CasFrameProcessor::rx_buffer_size
uint32_t rx_buffer_size()
Size of the signal buffer.
Definition:
CasFrameProcessor.h:89
CasFrameProcessor::unlock
void unlock()
Unlock the processor.
Definition:
CasFrameProcessor.h:96
CasFrameProcessor::_signal_buffer_rx
cf_t * _signal_buffer_rx[SRSRAN_MAX_PORTS]
Definition:
CasFrameProcessor.h:120
CasFrameProcessor::_cell
srsran_cell_t _cell
Definition:
CasFrameProcessor.h:130
CasFrameProcessor::_cfg
const libconfig::Config & _cfg
Definition:
CasFrameProcessor.h:115
CasFrameProcessor::_mutex
std::mutex _mutex
Definition:
CasFrameProcessor.h:131
CasFrameProcessor::cinr_db
float cinr_db()
Get the CINR estimate (in dB)
Definition:
CasFrameProcessor.h:112
CasFrameProcessor::_rlc
srsran::rlc & _rlc
Definition:
CasFrameProcessor.h:116
CasFrameProcessor::process
bool process(uint32_t tti)
Process the sample data in the signal buffer.
Definition:
CasFrameProcessor.cpp:89
CasFrameProcessor::_phy
Phy & _phy
Definition:
CasFrameProcessor.h:117
CasFrameProcessor::CasFrameProcessor
CasFrameProcessor(const libconfig::Config &cfg, Phy &phy, srsran::rlc &rlc, RestHandler &rest, unsigned rx_channels)
Default constructor.
Definition:
CasFrameProcessor.h:47
Phy
The PHY component.
Definition:
Phy.h:42
RestHandler
The RESTful API handler.
Definition:
RestHandler.h:44
cfg
static Config cfg
Global configuration object.
Definition:
main.cpp:165
Generated by
1.9.1