added UE reading of configuration files (RRCReconfiguration,RadioBearerConfig) for static NSA without LTE
This commit is contained in:
@@ -104,6 +104,10 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
printf("%02x",((uint8_t *)buffer)[i]);
|
||||
}
|
||||
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);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
@@ -116,6 +120,9 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
printf("%02x",((uint8_t*)buffer)[i]);
|
||||
}
|
||||
printf("\n");
|
||||
fd = fopen("rbconfig.raw","w");
|
||||
fwrite((void*)buffer,1,(size_t)((enc_rval.encoded+7)>>3),fd);
|
||||
fclose(fd);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "mac_proto.h"
|
||||
|
||||
|
||||
|
||||
extern int phy_test;
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
@@ -85,6 +85,14 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
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)
|
||||
// RRCReconfiguration
|
||||
@@ -96,7 +104,7 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
if(NR_UE_rrc_inst->radio_bearer_config == NULL){
|
||||
NR_UE_rrc_inst->radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
|
||||
}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
|
||||
(uint8_t *)rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup->buf,
|
||||
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){
|
||||
// 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;
|
||||
@@ -148,6 +158,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
|
||||
|
||||
return 0;
|
||||
@@ -197,12 +209,56 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
|
||||
|
||||
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){
|
||||
|
||||
if(NB_NR_UE_INST > 0){
|
||||
@@ -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_ResourceConfig_list, NR_maxNrofCSI_ResourceConfigurations);
|
||||
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{
|
||||
NR_UE_rrc_inst = NULL;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
|
||||
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 {
|
||||
|
||||
NR_MeasConfig_t *meas_config;
|
||||
|
||||
Reference in New Issue
Block a user