Commit 2989bb59 authored by Robert Schmidt's avatar Robert Schmidt Committed by Roberto Rosca

handle position from RRC

parent be618b06
......@@ -2219,7 +2219,6 @@ target_link_libraries(nr_pucchsim PRIVATE
target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_executable(nr_dlsim
${OPENAIR_DIR}/executables/position_interface.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/executables/softmodem-common.c
......@@ -2255,7 +2254,6 @@ target_link_libraries(nr_ulschsim PRIVATE
target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_executable(nr_ulsim
${OPENAIR_DIR}/executables/position_interface.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/executables/softmodem-common.c
......
......@@ -47,7 +47,7 @@
}
// clang-format on
typedef struct {
typedef struct position {
double positionX;
double positionY;
double positionZ;
......@@ -56,4 +56,4 @@ typedef struct {
void config_position_coordinates(int Mod_id);
position_t *init_position_coordinates(char *sectionName);
position_t *get_position_coordinates(int Mod_id);
#endif
\ No newline at end of file
#endif
......@@ -1749,7 +1749,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
}
// computes delay between ue and sat based on SIB19 ephemeris data
static double calculate_ue_sat_ta(position_t *position_params, struct NR_PositionVelocity_r17 *sat_pos)
static double calculate_ue_sat_ta(const position_t *position_params, struct NR_PositionVelocity_r17 *sat_pos)
{
// get UE position coordinates
double posx = position_params->positionX;
......@@ -1768,7 +1768,7 @@ static double calculate_ue_sat_ta(position_t *position_params, struct NR_Positio
return ta_ms;
}
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, NR_SIB19_r17_t *sib19_r17)
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const position_t *pos, NR_SIB19_r17_t *sib19_r17)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
int ret = pthread_mutex_lock(&mac->if_mutex);
......@@ -1786,7 +1786,7 @@ void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, NR_SIB19_r17_t *sib1
if (position_velocity
&& (position_velocity->positionX_r17 != 0 || position_velocity->positionY_r17 != 0
|| position_velocity->positionZ_r17 != 0)) {
mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(get_position_coordinates(module_id), position_velocity);
mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(pos, position_velocity);
}
}
// if cellSpecificKoffset_r17 is present
......@@ -2647,4 +2647,4 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
ue_init_config_request(mac, mac->current_DL_BWP->scs);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
\ No newline at end of file
}
......@@ -91,8 +91,8 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
NR_SI_SchedulingInfo_v1700_t *si_SchedulingInfo_v1700,
NR_ServingCellConfigCommonSIB_t *scc);
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id,
NR_SIB19_r17_t *sib19_r17);
struct position; /* forward declaration */
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const struct position *pos, NR_SIB19_r17_t *sib19_r17);
void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause);
......
......@@ -62,6 +62,7 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "executables/position_interface.h"
#ifndef CELLULAR
#include "RRC/NR/MESSAGES/asn1_msg.h"
......@@ -241,7 +242,8 @@ 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);
nr_rrc_mac_config_req_sib19_r17(ue_id, 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);
nr_timer_start(&SI_info->SInfo_r17.sib19_timer);
break;
default:
......
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