Changes in prs config parsing function, added help string

This commit is contained in:
Sagar Parsawar
2022-08-25 23:01:30 +02:00
parent 7bc69f505a
commit a292f1a251
13 changed files with 268 additions and 572 deletions
+54 -56
View File
@@ -34,7 +34,7 @@
#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "openair2/GNB_APP/prs_nr_paramdef.h"
#include "openair2/COMMON/prs_nr_paramdef.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
/*
@@ -156,7 +156,9 @@ void RCconfig_nrUE_prs(void *cfg)
{
int j = 0, k = 0, gNB_id = 0;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg;
char str[7][100] = {'\0'}; int16_t n[7] = {0};
PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg;
prs_config_t *prs_config = NULL;
paramlist_def_t gParamList = {CONFIG_STRING_PRS_LIST,NULL,0};
paramdef_t gParams[] = PRS_GLOBAL_PARAMS_DESC;
@@ -167,7 +169,7 @@ void RCconfig_nrUE_prs(void *cfg)
}
else
{
LOG_I(PHY,"%s configuration NOT found..!! Skipping configuring UE for the PRS reception\n", CONFIG_STRING_PRS_CONFIG);
LOG_E(PHY,"%s configuration NOT found..!! Skipped configuring UE for the PRS reception\n", CONFIG_STRING_PRS_CONFIG);
}
paramlist_def_t PRS_ParamList = {{0},NULL,0};
@@ -184,77 +186,73 @@ void RCconfig_nrUE_prs(void *cfg)
gNB_id = *(PRS_ParamList.paramarray[j][PRS_GNB_ID].uptr);
if(gNB_id != i) gNB_id = i; // force gNB_id to avoid mismatch
memset(n,0,sizeof(n));
ue->prs_vars[gNB_id]->NumPRSResources = *(PRS_ParamList.paramarray[j][NUM_PRS_RESOURCES].uptr);
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
{
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[0] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[0];
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[1] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[1];
prs_config = &ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg;
prs_config->PRSResourceSetPeriod[0] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[0];
prs_config->PRSResourceSetPeriod[1] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[1];
// per PRS resources parameters
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart = PRS_ParamList.paramarray[j][PRS_SYMBOL_START_LIST].uptr[k];
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols = PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS_LIST].uptr[k];
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.REOffset = PRS_ParamList.paramarray[j][PRS_RE_OFFSET_LIST].uptr[k];
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NPRSID = PRS_ParamList.paramarray[j][PRS_ID_LIST].uptr[k];
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceOffset = PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET_LIST].uptr[k];
prs_config->SymbolStart = PRS_ParamList.paramarray[j][PRS_SYMBOL_START_LIST].uptr[k];
prs_config->NumPRSSymbols = PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS_LIST].uptr[k];
prs_config->REOffset = PRS_ParamList.paramarray[j][PRS_RE_OFFSET_LIST].uptr[k];
prs_config->NPRSID = PRS_ParamList.paramarray[j][PRS_ID_LIST].uptr[k];
prs_config->PRSResourceOffset = PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET_LIST].uptr[k];
// Common parameters to all PRS resources
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr);
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr);
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr);
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr);
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr);
prs_config->NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr);
prs_config->RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr);
prs_config->CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr);
prs_config->PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr);
prs_config->PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr);
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingBitRepetition = *(PRS_ParamList.paramarray[j][PRS_MUTING_BIT_REPETITION].uptr);
prs_config->MutingBitRepetition = *(PRS_ParamList.paramarray[j][PRS_MUTING_BIT_REPETITION].uptr);
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++)
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l];
{
prs_config->MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l];
if (k == 0) // print only for 0th resource
n[5] += snprintf(str[5]+n[5],sizeof(str[5]),"%d, ",prs_config->MutingPattern1[l]);
}
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++)
ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern2[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].uptr[l];
{
prs_config->MutingPattern2[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].uptr[l];
if (k == 0) // print only for 0th resource
n[6] += snprintf(str[6]+n[6],sizeof(str[6]),"%d, ",prs_config->MutingPattern2[l]);
}
// print to buffer
n[0] += snprintf(str[0]+n[0],sizeof(str[0]),"%d, ",prs_config->SymbolStart);
n[1] += snprintf(str[1]+n[1],sizeof(str[1]),"%d, ",prs_config->NumPRSSymbols);
n[2] += snprintf(str[2]+n[2],sizeof(str[2]),"%d, ",prs_config->REOffset);
n[3] += snprintf(str[3]+n[3],sizeof(str[3]),"%d, ",prs_config->PRSResourceOffset);
n[4] += snprintf(str[4]+n[4],sizeof(str[4]),"%d, ",prs_config->NPRSID);
} // for k
k = 0;
prs_config = &ue->prs_vars[gNB_id]->prs_resource[0].prs_cfg;
LOG_I(PHY, "-----------------------------------------\n");
LOG_I(PHY, "PRS Config for gNB_id %d @ %p\n", gNB_id, &ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg);
LOG_I(PHY, "PRS Config for gNB_id %d @ %p\n", gNB_id, prs_config);
LOG_I(PHY, "-----------------------------------------\n");
LOG_I(PHY, "NumPRSResources \t%d\n", ue->prs_vars[gNB_id]->NumPRSResources);
LOG_I(PHY, "PRSResourceSetPeriod \t[%d, %d]\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[0], ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[1]);
LOG_I(PHY, "NumRB \t\t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumRB);
LOG_I(PHY, "RBOffset \t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.RBOffset);
LOG_I(PHY, "CombSize \t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.CombSize);
LOG_I(PHY, "PRSResourceRepetition \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceRepetition);
LOG_I(PHY, "PRSResourceTimeGap \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceTimeGap);
LOG_I(PHY, "MutingBitRepetition \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingBitRepetition);
LOG_I(PHY, "SymbolStart \t\t[");
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart);
printf("\b\b]\n");
LOG_I(PHY, "NumPRSSymbols \t\t[");
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols);
printf("\b\b]\n");
LOG_I(PHY, "REOffset \t\t[");
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.REOffset);
printf("\b\b]\n");
LOG_I(PHY, "PRSResourceOffset \t[");
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceOffset);
printf("\b\b]\n");
LOG_I(PHY, "NPRS_ID \t\t[");
for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NPRSID);
printf("\b\b]\n");
LOG_I(PHY, "MutingPattern1 \t\t[");
for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern1[l]);
printf("\b\b]\n");
LOG_I(PHY, "MutingPattern2 \t\t[");
for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++)
printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern2[l]);
printf("\b\b]\n");
LOG_I(PHY, "PRSResourceSetPeriod \t[%d, %d]\n", prs_config->PRSResourceSetPeriod[0], prs_config->PRSResourceSetPeriod[1]);
LOG_I(PHY, "NumRB \t\t\t%d\n", prs_config->NumRB);
LOG_I(PHY, "RBOffset \t\t%d\n", prs_config->RBOffset);
LOG_I(PHY, "CombSize \t\t%d\n", prs_config->CombSize);
LOG_I(PHY, "PRSResourceRepetition \t%d\n", prs_config->PRSResourceRepetition);
LOG_I(PHY, "PRSResourceTimeGap \t%d\n", prs_config->PRSResourceTimeGap);
LOG_I(PHY, "MutingBitRepetition \t%d\n", prs_config->MutingBitRepetition);
LOG_I(PHY, "SymbolStart \t\t[%s\b\b]\n", str[0]);
LOG_I(PHY, "NumPRSSymbols \t\t[%s\b\b]\n", str[1]);
LOG_I(PHY, "REOffset \t\t[%s\b\b]\n", str[2]);
LOG_I(PHY, "PRSResourceOffset \t[%s\b\b]\n", str[3]);
LOG_I(PHY, "NPRS_ID \t\t[%s\b\b]\n", str[4]);
LOG_I(PHY, "MutingPattern1 \t\t[%s\b\b]\n", str[5]);
LOG_I(PHY, "MutingPattern2 \t\t[%s\b\b]\n", str[6]);
LOG_I(PHY, "-----------------------------------------\n");
}
}
else
{
LOG_I(PHY,"No %s configuration found\n", PRS_ParamList.listname);
LOG_E(PHY,"No %s configuration found..!!\n", PRS_ParamList.listname);
}
}
}