added dl_earfcn_list to ue config

dl_earfcn_list = 2100,2200,3400
This commit is contained in:
Joseph Giovatto 2018-10-04 14:29:00 -04:00 committed by Andre Puschmann
parent a5a7eb02d2
commit af6de04806
4 changed files with 25 additions and 10 deletions

View File

@ -54,7 +54,7 @@ namespace srsue {
*******************************************************************************/
typedef struct {
uint32_t dl_earfcn;
std::string dl_earfcn;
float dl_freq;
float ul_freq;
float freq_offset;

View File

@ -66,7 +66,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
// Command line or config file options
bpo::options_description common("Configuration options");
common.add_options()
("rf.dl_earfcn", bpo::value<uint32_t>(&args->rf.dl_earfcn)->default_value(3400), "Downlink EARFCN")
("rf.dl_earfcn", bpo::value<string>(&args->rf.dl_earfcn)->default_value("3400"), "Downlink EARFCN list")
("rf.freq_offset", bpo::value<float>(&args->rf.freq_offset)->default_value(0), "(optional) Frequency offset")
("rf.dl_freq", bpo::value<float>(&args->rf.dl_freq)->default_value(-1), "Downlink Frequency (if positive overrides EARFCN)")
("rf.ul_freq", bpo::value<float>(&args->rf.ul_freq)->default_value(-1), "Uplink Frequency (if positive overrides EARFCN)")

View File

@ -32,6 +32,7 @@
#include <string>
#include <algorithm>
#include <iterator>
#include <sstream>
using namespace srslte;
@ -226,19 +227,33 @@ bool ue::init(all_args_t *args_) {
gw.init(&pdcp, &nas, &gw_log, 3 /* RB_ID_DRB1 */);
gw.set_netmask(args->expert.ip_netmask);
gw.set_tundevname(args->expert.ip_devname);
// Get current band from provided EARFCN
args->rrc.supported_bands[0] = srslte_band_get_band(args->rf.dl_earfcn);
args->rrc.nof_supported_bands = 1;
std::vector<uint32_t> earfcn_list;
if(! args->rf.dl_earfcn.empty()) {
std::stringstream ss(args->rf.dl_earfcn);
int idx = 0;
while(ss.good()) {
std::string substr;
getline(ss, substr, ',');
const int earfcn = atoi(substr.c_str());
args->rrc.supported_bands[idx] = srslte_band_get_band(earfcn);
args->rrc.nof_supported_bands = ++idx;
earfcn_list.push_back(earfcn);
printf("adding %d to earfcn_list\n", earfcn);
}
} else {
printf("error: dl_earfcn list is empty\n");
return false;
}
args->rrc.ue_category = atoi(args->ue_category_str.c_str());
// set args and initialize RRC
rrc.init(&phy, &mac, &rlc, &pdcp, &nas, usim, &gw, &mac, &rrc_log);
rrc.set_args(args->rrc);
// Currently EARFCN list is set to only one frequency as indicated in ue.conf
std::vector<uint32_t> earfcn_list;
earfcn_list.push_back(args->rf.dl_earfcn);
phy.set_earfcn(earfcn_list);
if (args->rf.dl_freq > 0 && args->rf.ul_freq > 0) {

View File

@ -3,7 +3,7 @@
#####################################################################
# RF configuration
#
# dl_earfcn: Downlink EARFCN code.
# dl_earfcn: Downlink EARFCN code list 3400,2100,...
# freq_offset: Uplink and Downlink optional frequency offset (in Hz)
# tx_gain: Transmit gain (dB).
# rx_gain: Optional receive gain (dB). If disabled, AGC if enabled