Commit becbb0a4 authored by Raymond Knopp's avatar Raymond Knopp

added UE reading of configuration files (RRCReconfiguration,RadioBearerConfig)...

added UE reading of configuration files (RRCReconfiguration,RadioBearerConfig) for static NSA without LTE
parent 4b5ad6a9
...@@ -2598,14 +2598,14 @@ void nr_ue_measurement_procedures(uint16_t l, // symbol index of each slot [0 ...@@ -2598,14 +2598,14 @@ void nr_ue_measurement_procedures(uint16_t l, // symbol index of each slot [0
if (l==2) { if (l==2) {
// UE measurements on symbol 0 // UE measurements on symbol 0
LOG_D(PHY,"Calling measurements nr_tti_rx %d, rxdata %p\n",nr_tti_rx,ue->common_vars.rxdata); LOG_D(PHY,"Calling measurements nr_tti_rx %d, rxdata %p\n",nr_tti_rx,ue->common_vars.rxdata);
/*
nr_ue_measurements(ue, nr_ue_measurements(ue,
0, 0,
0, 0,
0, 0,
0, 0,
nr_tti_rx); nr_tti_rx);
*/
//(nr_tti_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) //(nr_tti_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
#if T_TRACER #if T_TRACER
......
...@@ -104,6 +104,10 @@ int generate_CG_Config(gNB_RRC_INST *rrc, ...@@ -104,6 +104,10 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
printf("%02x",((uint8_t *)buffer)[i]); printf("%02x",((uint8_t *)buffer)[i]);
} }
printf("\n"); printf("\n");
FILE *fd = fopen("reconfig.raw","w");
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
fclose(fd);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_RadioBearerConfig, NULL, (void *)rbconfig, buffer, 1024); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_RadioBearerConfig, NULL, (void *)rbconfig, buffer, 1024);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
...@@ -116,6 +120,9 @@ int generate_CG_Config(gNB_RRC_INST *rrc, ...@@ -116,6 +120,9 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
printf("%02x",((uint8_t*)buffer)[i]); printf("%02x",((uint8_t*)buffer)[i]);
} }
printf("\n"); printf("\n");
fd = fopen("rbconfig.raw","w");
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
fclose(fd);
return(0); return(0);
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "mac_proto.h" #include "mac_proto.h"
extern int phy_test;
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
int8_t nr_rrc_ue_decode_secondary_cellgroup_config( int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
...@@ -85,6 +85,14 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config( ...@@ -85,6 +85,14 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
return 0; return 0;
} }
int8_t nr_rrc_ue_process_RadioBearerConfig(NR_RadioBearerConfig_t *RadioBearerConfig){
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
// Configure PDCP
return 0;
}
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded) // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded)
// RRCReconfiguration // RRCReconfiguration
...@@ -96,7 +104,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig ...@@ -96,7 +104,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
if(NR_UE_rrc_inst->radio_bearer_config == NULL){ if(NR_UE_rrc_inst->radio_bearer_config == NULL){
NR_UE_rrc_inst->radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; NR_UE_rrc_inst->radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
}else{ }else{
nr_rrc_ue_process_radio_bearer_config(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig); nr_rrc_ue_process_RadioBearerConfig(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig);
} }
} }
...@@ -108,6 +116,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig ...@@ -108,6 +116,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
(uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf, (uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf,
rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size, 0, 0); rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->size, 0, 0);
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
if(NR_UE_rrc_inst->cell_group_config == NULL){ if(NR_UE_rrc_inst->cell_group_config == NULL){
// first time receive the configuration, just use the memory allocated from uper_decoder. TODO this is not good implementation, need to maintain RRC_INST own structure every time. // first time receive the configuration, just use the memory allocated from uper_decoder. TODO this is not good implementation, need to maintain RRC_INST own structure every time.
NR_UE_rrc_inst->cell_group_config = cellGroupConfig; NR_UE_rrc_inst->cell_group_config = cellGroupConfig;
...@@ -148,6 +158,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig ...@@ -148,6 +158,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
return 0; return 0;
} }
int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
return 0; return 0;
...@@ -197,12 +209,56 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ ...@@ -197,12 +209,56 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
return 0; return 0;
} }
int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config){
return 0;
}
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len) {
switch (nsa_message_type) {
case nr_SecondaryCellGroupConfig_r15:
{
NR_RRCReconfiguration_t *RRCReconfiguration;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_RRCReconfiguration,
(void **)&RRCReconfiguration,
(uint8_t *)message,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(RRC,"NR_RRCReconfiguration decode error\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_RRCReconfiguration, RRCReconfiguration, 1 );
return;
}
nr_rrc_ue_process_rrcReconfiguration(RRCReconfiguration);
}
break;
case nr_RadioBearerConfigX_r15:
{
NR_RadioBearerConfig_t *RadioBearerConfig;
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_RadioBearerConfig,
(void **)&RadioBearerConfig,
(uint8_t *)message,
msg_len);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(RRC,"NR_RadioBearerConfig decode error\n");
// free the memory
SEQUENCE_free( &asn_DEF_NR_RadioBearerConfig, RadioBearerConfig, 1 );
return;
}
nr_rrc_ue_process_RadioBearerConfig(RadioBearerConfig);
}
break;
default:
AssertFatal(1==0,"Unknown message %d\n",nsa_message_type);
break;
}
}
int8_t openair_rrc_top_init_ue_nr(void){ int8_t openair_rrc_top_init_ue_nr(void){
if(NB_NR_UE_INST > 0){ if(NB_NR_UE_INST > 0){
...@@ -264,6 +320,20 @@ int8_t openair_rrc_top_init_ue_nr(void){ ...@@ -264,6 +320,20 @@ int8_t openair_rrc_top_init_ue_nr(void){
RRC_LIST_INIT(NR_UE_rrc_inst->CSI_SSB_ResourceSet_list, NR_maxNrofCSI_SSB_ResourceSets); RRC_LIST_INIT(NR_UE_rrc_inst->CSI_SSB_ResourceSet_list, NR_maxNrofCSI_SSB_ResourceSets);
RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ResourceConfig_list, NR_maxNrofCSI_ResourceConfigurations); RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ResourceConfig_list, NR_maxNrofCSI_ResourceConfigurations);
RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); RRC_LIST_INIT(NR_UE_rrc_inst->CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations);
if (phy_test==1) {
// read in files for RRCReconfiguration and RBconfig
FILE *fd;
fd = fopen("reconfig.raw","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");
msg_len=fread(buffer,1,1024,fd);
fclose(fd);
process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len);
}
}else{ }else{
NR_UE_rrc_inst = NULL; NR_UE_rrc_inst = NULL;
} }
......
...@@ -57,6 +57,11 @@ ...@@ -57,6 +57,11 @@
typedef uint32_t channel_t; typedef uint32_t channel_t;
typedef enum {
nr_SecondaryCellGroupConfig_r15=0,
nr_RadioBearerConfigX_r15=1
} nsa_message_t;
typedef struct NR_UE_RRC_INST_s { typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config; NR_MeasConfig_t *meas_config;
......
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