diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index a288dbebdea206543557b5f809b13c203993810a..c9d0930e83de8e1d329543ab96902084351284f6 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -83,6 +83,7 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" +#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 9b7ded5fa3800e4d4a6716f1e088159d35dc8ad4..79ea205680035d6cc5dc5aed62f4f104931336ce 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -809,7 +809,7 @@ if (slot_nr==18) return NULL; } -void init_NR_UE(int nb_inst) { +void init_NR_UE(int nb_inst, char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; pthread_t threads[nb_inst]; @@ -817,7 +817,7 @@ void init_NR_UE(int nb_inst) { for (inst=0; inst < nb_inst; inst++) { PHY_VARS_NR_UE *UE = PHY_vars_UE_g[inst][0]; AssertFatal((UE->if_inst = nr_ue_if_module_init(inst)) != NULL, "can not initial IF module\n"); - nr_l3_init_ue(); + nr_l3_init_ue(rrc_config_path); nr_l2_init_ue(); mac_inst = get_mac_inst(inst); mac_inst->if_module = UE->if_inst; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 569314d54b2e8069063d4ae0564d7dad5e1de330..e535040fa987b27bdd19e54172fd35e7e74b400e 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -209,6 +209,8 @@ tpool_t *Tpool; char *usrp_args=NULL; +char *rrc_config_path=NULL; + /* forward declarations */ void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); @@ -766,7 +768,7 @@ int main( int argc, char **argv ) { // wait for end of program printf("TYPE <CTRL-C> TO TERMINATE\n"); - init_NR_UE(1); + init_NR_UE(1,rrc_config_path); while(true) sleep(3600); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 2434a1c23cdad3fcb99997ddc1a058d56cc0b805..fe448cf28e28bfe8c1d6c9eeeb7985c98c7e2bd9 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -85,7 +85,8 @@ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \ - {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0} \ + {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \ + {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } @@ -97,7 +98,7 @@ extern int T_dont_fork; // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_NR_UE(int); +extern void init_NR_UE(int, char*); extern void reset_opp_meas(void); extern void print_opp_meas(void); void *UE_thread(void *arg); diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 8188b4f5721d269c74146e32ff8e0c421f5977b7..2c6b5e40bdeaddb5c2611218c9adbd1e1cb7c8cb 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -33,10 +33,10 @@ #include "defs.h" #include "rrc_proto.h" -int nr_l3_init_ue(void){ +int nr_l3_init_ue(char* rrc_config_path){ //LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); - openair_rrc_top_init_ue_nr(); + openair_rrc_top_init_ue_nr(rrc_config_path); return 0; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 50cc1f61918ed48d5f08505125bea44984f14465..bf22b85f8bf1d98d424265fd51aca64d3e8135a8 100755 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -259,7 +259,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, } -int8_t openair_rrc_top_init_ue_nr(void){ +int8_t openair_rrc_top_init_ue_nr(char* rrc_config_path){ if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -324,12 +324,21 @@ int8_t openair_rrc_top_init_ue_nr(void){ if (phy_test==1) { // read in files for RRCReconfiguration and RBconfig FILE *fd; - fd = fopen("reconfig.raw","r"); + char filename[1024]; + if (rrc_config_path) + sprintf(filename,"%s/reconfig.raw",rrc_config_path); + else + sprintf(filename,"reconfig.raw"); + fd = fopen(filename,"r"); char buffer[1024]; int msg_len=fread(buffer,1,1024,fd); fclose(fd); process_nsa_message(NR_UE_rrc_inst, nr_SecondaryCellGroupConfig_r15, buffer,msg_len); - fd = fopen("rbconfig.raw","r"); + if (rrc_config_path) + sprintf(filename,"%s/rbconfig.raw",rrc_config_path); + else + sprintf(filename,"rbconfig.raw"); + fd = fopen(filename,"r"); msg_len=fread(buffer,1,1024,fd); fclose(fd); process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len); diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 111a9d2dd1076b1de57679a2fda7e9577181d90c..d195de76af5209d685fae843be341cc5a4e84a81 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -43,14 +43,14 @@ // main_rrc.c // /**\brief Layer 3 initialization*/ -int nr_l3_init_ue(void); +int nr_l3_init_ue(char*); // // UE_rrc.c // /**\brief Initial the top level RRC structure instance*/ -int8_t openair_rrc_top_init_ue_nr(void); +int8_t openair_rrc_top_init_ue_nr(char*);