Commit ef55aaa7 authored by Roberto Rosca's avatar Roberto Rosca

Store position coordinates in NR_UE_RRC_INST_t

position_coordinates will be allocated and populated upon receiving SIB19
Co-authored-by: default avatarRobert Schmidt <robert.schmidt@openairinterface.org>
parent 3f74749a
......@@ -23,21 +23,17 @@
extern uint16_t NB_UE_INST;
static position_t read_position_coordinates(char *sectionName)
static void read_position_coordinates(char *sectionName, position_t *position)
{
position_t p;
position_t *position = &p;
paramdef_t position_params[] = POSITION_CONFIG_PARAMS_DEF;
int ret = config_get(config_get_if(), position_params, sizeofArray(position_params), sectionName);
AssertFatal(ret >= 0, "configuration couldn't be performed for position name: %s", sectionName);
return p;
}
position_t get_position_coordinates(int Mod_id)
void get_position_coordinates(int Mod_id, position_t *position)
{
AssertFatal(Mod_id < NB_UE_INST, "Mod_id must be less than NB_UE_INST. Mod_id:%d NB_UE_INST:%d", Mod_id, NB_UE_INST);
char positionName[64];
snprintf(positionName, sizeof(positionName), "position%d", Mod_id);
return read_position_coordinates(positionName);
}
read_position_coordinates(positionName, position);
}
\ No newline at end of file
......@@ -53,5 +53,6 @@ typedef struct position {
double positionZ;
} position_t;
position_t get_position_coordinates(int Mod_id);
void get_position_coordinates(int Mod_id, position_t *position);
#endif
......@@ -166,7 +166,7 @@ static void set_DRB_status(NR_UE_RRC_INST_t *rrc, NR_DRB_Identity_t drb_id, NR_R
rrc->status_DRBs[drb_id - 1] = status;
}
static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, instance_t ue_id)
static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, instance_t ue_id, position_t *position)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN);
......@@ -242,8 +242,14 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si,
SI_info->SInfo_r17.sib19_validity = true;
if (g_log->log_component[NR_RRC].level >= OAILOG_DEBUG)
xer_fprint(stdout, &asn_DEF_NR_SIB19_r17, (const void *)typeandinfo->choice.sib19_v1700);
position_t p = get_position_coordinates(0);
nr_rrc_mac_config_req_sib19_r17(ue_id, &p, typeandinfo->choice.sib19_v1700);
// allocate memory for position coordinates
if (!position)
position = CALLOC(1, sizeof(*position));
// populate position with position from config file
get_position_coordinates(ue_id, position);
nr_rrc_mac_config_req_sib19_r17(ue_id, position, typeandinfo->choice.sib19_v1700);
nr_timer_start(&SI_info->SInfo_r17.sib19_timer);
break;
default:
......@@ -389,7 +395,7 @@ static void nr_rrc_process_reconfiguration_v1530(NR_UE_RRC_INST_t *rrc, NR_RRCRe
SEQUENCE_free(&asn_DEF_NR_SystemInformation, si, 1);
} else {
LOG_I(NR_RRC, "[UE %ld] Decoding dedicatedSystemInformationDelivery\n", rrc->ue_id);
nr_decode_SI(SI_info, si, rrc->ue_id);
nr_decode_SI(SI_info, si, rrc->ue_id, rrc->position_coordinates);
}
}
if (rec_1530->otherConfig) {
......@@ -898,7 +904,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(NR_UE_RRC_INST_t *rrc,
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation:
LOG_I(NR_RRC, "[UE %ld] Decoding SI\n", rrc->ue_id);
NR_SystemInformation_t *si = bcch_message->message.choice.c1->choice.systemInformation;
nr_decode_SI(SI_info, si, rrc->ue_id);
nr_decode_SI(SI_info, si, rrc->ue_id, rrc->position_coordinates);
break;
case NR_BCCH_DL_SCH_MessageType__c1_PR_NOTHING:
default:
......
......@@ -196,6 +196,8 @@ typedef struct rrcPerNB {
NR_RSRP_Range_t s_measure;
} rrcPerNB_t;
/* forward declaration */
struct position;
typedef struct NR_UE_RRC_INST_s {
instance_t ue_id;
rrcPerNB_t perNB[NB_CNX_UE];
......@@ -236,6 +238,8 @@ typedef struct NR_UE_RRC_INST_s {
//Sidelink params
NR_SL_PreconfigurationNR_r16_t *sl_preconfig;
struct position *position_coordinates;
} NR_UE_RRC_INST_t;
#endif
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