Commit 6faddf2c authored by Florian Kaltenberger's avatar Florian Kaltenberger

adding --rrc_config_path command line option to UE

parent d20ace82
......@@ -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"
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment