mirror of https://github.com/PentHertz/srsLTE.git
Exposed continuous TX mode to ue.conf
This commit is contained in:
parent
68cbb6ca7f
commit
3ab74fb552
|
@ -44,13 +44,11 @@ typedef struct {
|
|||
float rx_corr_iq_q;
|
||||
} rf_cal_t;
|
||||
|
||||
|
||||
namespace srslte {
|
||||
|
||||
/* Interface to the RF frontend.
|
||||
*/
|
||||
class radio
|
||||
{
|
||||
class radio {
|
||||
public:
|
||||
radio() : tr_local_time(1024 * 10), tr_usrp_time(1024 * 10), tr_tx_time(1024 * 10), tr_is_eob(1024 * 10) {
|
||||
bzero(&rf_device, sizeof(srslte_rf_t));
|
||||
|
@ -74,6 +72,7 @@ namespace srslte {
|
|||
agc_enabled = false;
|
||||
radio_is_streaming = false;
|
||||
is_initialized = false;
|
||||
continuous_tx = false;
|
||||
};
|
||||
|
||||
bool init(char *args = NULL, char *devname = NULL, uint32_t nof_channels = 1);
|
||||
|
@ -87,6 +86,9 @@ namespace srslte {
|
|||
|
||||
void set_manual_calibration(rf_cal_t *calibration);
|
||||
|
||||
bool is_continuous_tx();
|
||||
void set_continuous_tx(bool enable);
|
||||
|
||||
void get_time(srslte_timestamp_t *now);
|
||||
bool tx_single(void *buffer, uint32_t nof_samples, srslte_timestamp_t tx_time);
|
||||
bool tx(void *buffer[SRSLTE_MAX_PORTS], uint32_t nof_samples, srslte_timestamp_t tx_time);
|
||||
|
@ -136,7 +138,6 @@ namespace srslte {
|
|||
|
||||
srslte_rf_t rf_device;
|
||||
|
||||
|
||||
const static uint32_t burst_preamble_max_samples = 30720000; // 30.72 MHz is maximum frequency
|
||||
double burst_preamble_sec;// Start of burst preamble time (off->on RF transition time)
|
||||
srslte_timestamp_t end_of_burst_time;
|
||||
|
@ -170,7 +171,8 @@ namespace srslte {
|
|||
uint32_t tti;
|
||||
bool agc_enabled;
|
||||
|
||||
bool is_initialized = true;;
|
||||
bool continuous_tx;
|
||||
bool is_initialized;
|
||||
bool radio_is_streaming;
|
||||
|
||||
uint32_t saved_nof_channels;
|
||||
|
|
|
@ -51,11 +51,13 @@ bool radio::init(char *args, char *devname, uint32_t nof_channels)
|
|||
// Suppress radio stdout
|
||||
srslte_rf_suppress_stdout(&rf_device);
|
||||
|
||||
continuous_tx = false;
|
||||
tx_adv_auto = true;
|
||||
// Set default preamble length each known device
|
||||
// We distinguish by device family, maybe we should calibrate per device
|
||||
if (strstr(srslte_rf_name(&rf_device), "uhd")) {
|
||||
burst_preamble_sec = uhd_default_burst_preamble_sec;
|
||||
continuous_tx = true;
|
||||
} else if (strstr(srslte_rf_name(&rf_device), "bladerf")) {
|
||||
burst_preamble_sec = blade_default_burst_preamble_sec;
|
||||
} else {
|
||||
|
@ -111,6 +113,14 @@ void radio::set_burst_preamble(double preamble_us)
|
|||
burst_preamble_sec = (double) preamble_us/1e6;
|
||||
}
|
||||
|
||||
void radio::set_continuous_tx(bool enable) {
|
||||
continuous_tx = enable;
|
||||
}
|
||||
|
||||
bool radio::is_continuous_tx() {
|
||||
return continuous_tx;
|
||||
}
|
||||
|
||||
void radio::set_tx_adv(int nsamples)
|
||||
{
|
||||
tx_adv_auto = false;
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
#ifndef SRSUE_PHCH_COMMON_H
|
||||
#define SRSUE_PHCH_COMMON_H
|
||||
|
||||
#define TX_MODE_CONTINUOUS 1
|
||||
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
|
|
@ -64,6 +64,7 @@ typedef struct {
|
|||
std::string device_args;
|
||||
std::string time_adv_nsamples;
|
||||
std::string burst_preamble;
|
||||
std::string continuous_tx;
|
||||
}rf_args_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -77,6 +77,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
|
|||
("rf.time_adv_nsamples", bpo::value<string>(&args->rf.time_adv_nsamples)->default_value("auto"),
|
||||
"Transmission time advance")
|
||||
("rf.burst_preamble_us", bpo::value<string>(&args->rf.burst_preamble)->default_value("auto"), "Transmission time advance")
|
||||
("rf.continuous_tx", bpo::value<string>(&args->rf.continuous_tx)->default_value("auto"), "Transmit samples continuously to the radio or on bursts (auto/yes/no). Default is auto (yes for UHD, no for rest)")
|
||||
|
||||
("rrc.feature_group", bpo::value<uint32_t>(&args->rrc.feature_group)->default_value(0xe6041c00), "Hex value of the featureGroupIndicators field in the"
|
||||
"UECapabilityInformation message. Default 0xe6041c00")
|
||||
|
|
|
@ -248,7 +248,7 @@ void phch_common::worker_end(uint32_t tti, bool tx_enable,
|
|||
radio_h->tx_single(buffer, nof_samples, tx_time);
|
||||
is_first_of_burst = false;
|
||||
} else {
|
||||
if (TX_MODE_CONTINUOUS) {
|
||||
if (radio_h->is_continuous_tx()) {
|
||||
if (!is_first_of_burst) {
|
||||
radio_h->tx_single(zeros, nof_samples, tx_time);
|
||||
}
|
||||
|
|
|
@ -160,6 +160,9 @@ bool ue::init(all_args_t *args_)
|
|||
if (args->rf.burst_preamble.compare("auto")) {
|
||||
radio.set_burst_preamble(atof(args->rf.burst_preamble.c_str()));
|
||||
}
|
||||
if (args->rf.continuous_tx.compare("auto")) {
|
||||
radio.set_continuous_tx(args->rf.continuous_tx.compare("yes")?false:true);
|
||||
}
|
||||
|
||||
radio.set_manual_calibration(&args->rf_cal);
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
# Default "auto". B210 USRP: 100 samples, bladeRF: 27.
|
||||
# burst_preamble_us: Preamble length to transmit before start of burst.
|
||||
# Default "auto". B210 USRP: 400 us, bladeRF: 0 us.
|
||||
# continuous_tx: Transmit samples continuously to the radio or on bursts (auto/yes/no).
|
||||
# Default is auto (yes for UHD, no for rest)
|
||||
#####################################################################
|
||||
[rf]
|
||||
dl_earfcn = 3400
|
||||
|
@ -33,6 +35,7 @@ rx_gain = 40
|
|||
#device_args = auto
|
||||
#time_adv_nsamples = auto
|
||||
#burst_preamble_us = auto
|
||||
#continuous_tx = auto
|
||||
|
||||
|
||||
#####################################################################
|
||||
|
|
Loading…
Reference in New Issue