diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 79b5884a13..779a3a8dce 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -140,6 +140,12 @@ int generate_dlsch_header(unsigned char *mac_header, unsigned char short_padding, unsigned short post_padding){return 0;} +// Dummy function to avoid linking error at compilation of nr-dlsim +int is_x2ap_enabled(void) +{ + return 0; +} + // needed for some functions openair0_config_t openair0_cfg[MAX_CARDS]; diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 39aa9c3224..cee04c1e57 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -100,6 +100,12 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return 0;} +// Dummy function to avoid linking error at compilation of nr-prachsim +int is_x2ap_enabled(void) +{ + return 0; +} + int main(int argc, char **argv){ char c; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 4be07e426d..5494e64eca 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -119,6 +119,12 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( return 0; } +// Dummy function to avoid linking error at compilation of nr-ulsim +int is_x2ap_enabled(void) +{ + return 0; +} + // needed for some functions uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 757724765e..d94b340a92 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -82,6 +82,7 @@ #include "executables/softmodem-common.h" #include +#include "x2ap_eNB.h" //#define XER_PRINT @@ -317,8 +318,10 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { MessageDef *msg; /* send a tick to x2ap */ - msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_SUBFRAME_PROCESS); - itti_send_msg_to_task(TASK_X2AP, ctxt_pP->module_id, msg); + if (is_x2ap_enabled()){ + msg = itti_alloc_new_message(TASK_RRC_ENB, X2AP_SUBFRAME_PROCESS); + itti_send_msg_to_task(TASK_X2AP, ctxt_pP->module_id, msg); + } } ///---------------------------------------------------------------------------------------------------------------///