Agora  1.2.0
Agora project
client_radio.h
Go to the documentation of this file.
1 
5 #ifndef CLIENT_RADIO_LIB_H_
6 #define CLIENT_RADIO_LIB_H_
7 
8 #include <atomic>
9 #include <cstdlib>
10 #include <vector>
11 
12 #include "config.h"
13 #include "radio.h"
14 
16  public:
17  ClientRadioConfig(const Config* const cfg, Radio::RadioType radio_type);
19 
20  bool RadioStart();
21  void RadioStop();
22  void ReadSensors();
23  int RadioTx(size_t radio_id, void** buffs, size_t num_samps,
24  Radio::TxFlags flags, long long& tx_time);
25 
26  int RadioRx(size_t radio_id,
27  std::vector<std::vector<std::complex<int16_t>>>& rx_data,
28  size_t rx_size, Radio::RxFlags& out_flags, long long& rx_time_ns);
29 
30  int RadioRx(size_t radio_id,
31  std::vector<std::vector<std::complex<int16_t>>*>& rx_buffs,
32  size_t rx_size, Radio::RxFlags& out_flags, long long& rx_time_ns);
33 
34  int RadioRx(size_t radio_id, std::vector<void*>& rx_locs, size_t rx_size,
35  Radio::RxFlags& out_flags, long long& rx_time_ns);
36 
37  void Go() const;
38 
39  private:
40  void InitClientRadio(size_t radio_id);
41 
42  const Config* const cfg_;
43  std::vector<std::unique_ptr<Radio>> radios_;
44  size_t total_radios_;
46 
47  std::atomic<size_t> num_client_radios_initialized_;
48 };
49 #endif // CLIENT_RADIO_LIB_H_
radio.h
Defination file for the Radio class.
ClientRadioConfig::RadioStart
bool RadioStart()
Definition: client_radio.cc:76
ClientRadioConfig::Go
void Go() const
Definition: client_radio.cc:88
Config::UeAntNum
size_t UeAntNum() const
Definition: config.h:41
ClientRadioConfig::num_client_radios_initialized_
std::atomic< size_t > num_client_radios_initialized_
Definition: client_radio.h:47
ClientRadioConfig::RadioRx
int RadioRx(size_t radio_id, std::vector< std::vector< std::complex< int16_t >>> &rx_data, size_t rx_size, Radio::RxFlags &out_flags, long long &rx_time_ns)
Definition: client_radio.cc:101
Config::UeChannel
std::string UeChannel() const
Definition: config.h:114
Config::ClientTxGainA
double ClientTxGainA(size_t id) const
Definition: config.h:70
Config::UeRadioId
const std::vector< std::string > & UeRadioId() const
Definition: config.h:362
ClientRadioConfig
Definition: client_radio.h:15
flags
list flags
Definition: .ycm_extra_conf.py:39
ClientRadioConfig::cfg_
const Config *const cfg_
Definition: client_radio.h:42
ClientRadioConfig::total_radios_
size_t total_radios_
Definition: client_radio.h:44
Config::UeNum
size_t UeNum() const
Definition: config.h:40
ClientRadioConfig::RadioStop
void RadioStop()
Definition: client_radio.cc:125
ClientRadioConfig::~ClientRadioConfig
~ClientRadioConfig()
Definition: client_radio.cc:131
Radio::TxFlags
TxFlags
Definition: radio.h:20
Radio::RadioType
RadioType
Definition: radio.h:17
ClientRadioConfig::ClientRadioConfig
ClientRadioConfig(const Config *const cfg, Radio::RadioType radio_type)
Definition: client_radio.cc:10
Radio::Create
static std::unique_ptr< Radio > Create(RadioType type)
Definition: radio.cc:11
i
for i
Definition: generate_data.m:107
ClientRadioConfig::radios_
std::vector< std::unique_ptr< Radio > > radios_
Definition: client_radio.h:43
Catch::cout
std::ostream & cout()
Config::ClientTxGainB
double ClientTxGainB(size_t id) const
Definition: config.h:76
kUseUHD
static constexpr bool kUseUHD
Definition: symbols.h:162
Radio::RxFlags
RxFlags
Definition: radio.h:19
Utils::StrToChannels
static std::vector< size_t > StrToChannels(const std::string &channel)
Definition: utils.cc:207
ClientRadioConfig::RadioTx
int RadioTx(size_t radio_id, void **buffs, size_t num_samps, Radio::TxFlags flags, long long &tx_time)
Definition: client_radio.cc:96
ClientRadioConfig::InitClientRadio
void InitClientRadio(size_t radio_id)
Definition: client_radio.cc:59
Config::ClientRxGainB
double ClientRxGainB(size_t id) const
Definition: config.h:79
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
Config::UeHwFramer
bool UeHwFramer() const
Definition: config.h:54
config.h
Declaration file for the configuration class which importants json configuration values into class va...
rx_data
case QPSK rx_data
Definition: generate_data.m:160
Config::ClientRxGainA
double ClientRxGainA(size_t id) const
Definition: config.h:73
ClientRadioConfig::ReadSensors
void ReadSensors()
Definition: client_radio.cc:119
client_radio.h
Declaration file for the client radio config class.
ClientRadioConfig::total_antennas_
size_t total_antennas_
Definition: client_radio.h:45