diff --git a/executables/nr-ue.c b/executables/nr-ue.c index a3336d6386..109be6292a 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -179,6 +179,17 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) if (nr_prach == 1) { + nfapi_nr_rach_indication_t rach_ind = { + .header = { + .message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, + }, + .sfn = frame_tx, + .slot = nr_slot_tx, + .pdu_list = NULL, + .number_of_pdus = 0, + }; + send_nsa_standalone_msg(&rach_ind); + /* Fill rach indication here and send to proxy. Basically take pieces from L1_nr_prach_procedures() and send it to the proxy. prach from ue->gNb->gnb sends rach->ue receives rach The UE is basically filling the rach and proxy will receive and think that it came from the gNB. The diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 7e624f4f95..fa1b5b5287 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -127,7 +127,18 @@ void nrue_init_standalone_socket(const char *addr, int tx_port, int rx_port) tx_port, rx_port, addr); } - +void send_nsa_standalone_msg(nfapi_nr_rach_indication_t *rach_ind) +{ + char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; + int encoded_size = nfapi_nr_p7_message_pack(rach_ind, buffer, sizeof(buffer), NULL); + LOG_I(NR_MAC, "NR_RACH_IND sent to Proxy, Size: %d Frame %d Subframe %d\n", encoded_size, + rach_ind->sfn, rach_ind->slot); + if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0) + { + LOG_E(NR_MAC, "Send Proxy NR_UE failed\n"); + return; + } +} static void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) { int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index cd3b39cd25..693bfb2483 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -218,6 +218,8 @@ typedef struct nfapi_dl_tti_config_req_tx_data_req_t nfapi_nr_tx_data_request_t *tx_data_req_pdu_list; } nfapi_dl_tti_config_req_tx_data_req_t; +void send_nsa_standalone_msg(nfapi_nr_rach_indication_t *rach_ind); + /**\brief done free of memory allocation by module_id and release to pointer pool. \param module_id module id*/ int nr_ue_if_module_kill(uint32_t module_id);