forked from zhaopy10/CoMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radio_lib.hpp
48 lines (46 loc) · 1.2 KB
/
radio_lib.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <SoapySDR/Device.hpp>
#include <SoapySDR/Formats.hpp>
#include <SoapySDR/Errors.hpp>
#include <SoapySDR/Time.hpp>
#include <cstdlib>
#include <cstddef>
#include <chrono>
#include <string>
#include <cstdint>
#include <complex>
#include <csignal>
enum RadioType
{
eNB=0,
UE=1
};
class RadioConfig
{
public:
RadioConfig(std::vector<std::string>, int, double, double, double, double, int, int, int, std::vector<int>);
void radioStart(std::vector<void *> buffs);
void radioStop();
void radioTx(std::vector<void *> buffs);
void radioRx(std::vector<void *> buffs);
void radioSched(std::vector<int> sched);
~RadioConfig();
private:
std::vector<std::string> _radioId;
std::vector<SoapySDR::Device *> baStn;
std::vector<SoapySDR::Stream *> txStreams;
std::vector<SoapySDR::Stream *> rxStreams;
// beacon
std::vector<std::complex<int16_t>> buff;
double _rate;
double _freq;
double _rxgain;
double _txgain;
int _radioNum;
int _numCh;
int _symlen; //size of ofdm symbols as well as burst length
int _symnum; // max value 256
int _maxFrame;
std::vector<int> _tddSched; // max len 256*16
RadioType _radioType;
};