diff --git a/openair2/COMMON/nrppa_messages_def.h b/openair2/COMMON/nrppa_messages_def.h index ecca67ba33..e3ddeb244f 100644 --- a/openair2/COMMON/nrppa_messages_def.h +++ b/openair2/COMMON/nrppa_messages_def.h @@ -24,3 +24,7 @@ // LMF -> CU MESSAGE_DEF(NRPPA_TRP_INFORMATION_REQ, MESSAGE_PRIORITY_MED, nrppa_trp_information_req_t, nrppa_trp_information_req) MESSAGE_DEF(NRPPA_TRP_INFORMATION_RESP, MESSAGE_PRIORITY_MED, nrppa_trp_information_resp_t, nrppa_trp_information_resp) +MESSAGE_DEF(NRPPA_POSITIONING_INFORMATION_REQ, + MESSAGE_PRIORITY_MED, + nrppa_positioning_information_req_t, + nrppa_positioning_information_req) diff --git a/openair2/COMMON/nrppa_messages_types.h b/openair2/COMMON/nrppa_messages_types.h index f461909a35..fef930ac9a 100644 --- a/openair2/COMMON/nrppa_messages_types.h +++ b/openair2/COMMON/nrppa_messages_types.h @@ -26,6 +26,7 @@ #define NRPPA_TRP_INFORMATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_trp_information_req #define NRPPA_TRP_INFORMATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.nrppa_trp_information_resp +#define NRPPA_POSITIONING_INFORMATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrppa_positioning_information_req /* Structure of Positioning related NRPPA messages */ /* IE structures for Positioning related messages as per TS 38.455 V16.7.1*/ @@ -245,4 +246,9 @@ typedef struct nrppa_trp_information_resp_s { nrppa_trp_information_list_t trp_information_list; } nrppa_trp_information_resp_t; +typedef struct nrppa_positioning_information_req_s { + // IE 9.2.4 (mandatory) + uint16_t transaction_id; +} nrppa_positioning_information_req_t; + #endif // NRPPA_MESSAGES_TYPES_H_ diff --git a/openair3/NRPPA/nrppa_gNB_decoder.c b/openair3/NRPPA/nrppa_gNB_decoder.c index d197d0d141..94524fd060 100644 --- a/openair3/NRPPA/nrppa_gNB_decoder.c +++ b/openair3/NRPPA/nrppa_gNB_decoder.c @@ -35,6 +35,11 @@ static int nrppa_gNB_decode_initiating_message(NRPPA_NRPPA_PDU_t *pdu) LOG_I(NRPPA, "TRP Information Request initiating message\n"); free(res.buffer); break; + case NRPPA_ProcedureCode_id_positioningInformationExchange: // PositioningInformationRequest + res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NRPPA_NRPPA_PDU, pdu); + LOG_I(NRPPA, "Positioning Information Request initiating message\n"); + free(res.buffer); + break; default: AssertFatal(false, "Unknown procedure ID (%d) for initiating message\n", (int)pdu->choice.initiatingMessage->procedureCode); diff --git a/openair3/NRPPA/nrppa_gNB_handlers.c b/openair3/NRPPA/nrppa_gNB_handlers.c index ce36e34d81..99299ecb64 100644 --- a/openair3/NRPPA/nrppa_gNB_handlers.c +++ b/openair3/NRPPA/nrppa_gNB_handlers.c @@ -47,7 +47,9 @@ nrppa_message_decoded_callback nrppa_messages_callback[][3] = { {0, 0, 0}, // NRPPA_ProcedureCode_id_oTDOAInformationExchange ((NRPPA_ProcedureCode_t)6) {0, 0, 0}, // NRPPA_ProcedureCode_id_assistanceInformationControl ((NRPPA_ProcedureCode_t)7) {0, 0, 0}, // NRPPA_ProcedureCode_id_assistanceInformationFeedback ((NRPPA_ProcedureCode_t)8) - {0, 0, 0}, // NRPPA_ProcedureCode_id_positioningInformationExchange ((NRPPA_ProcedureCode_t)9) + {nrppa_gNB_handle_positioning_information_request, + 0, + 0}, // NRPPA_ProcedureCode_id_positioningInformationExchange ((NRPPA_ProcedureCode_t)9) {0, 0, 0}, // NRPPA_ProcedureCode_id_positioningInformationUpdate ((NRPPA_ProcedureCode_t)10) {0, 0, 0}, // NRPPA_ProcedureCode_id_Measurement ((NRPPA_ProcedureCode_t)11) {0, 0, 0}, // NRPPA_ProcedureCode_id_MeasurementReport ((NRPPA_ProcedureCode_t)12) diff --git a/openair3/NRPPA/nrppa_gNB_location_information_transfer.c b/openair3/NRPPA/nrppa_gNB_location_information_transfer.c index bc1af664cd..6821e251ed 100644 --- a/openair3/NRPPA/nrppa_gNB_location_information_transfer.c +++ b/openair3/NRPPA/nrppa_gNB_location_information_transfer.c @@ -415,3 +415,30 @@ int nrppa_gNB_trp_information_response(instance_t instance, MessageDef *msg_p) return length; } + +int nrppa_gNB_handle_positioning_information_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu) +{ + DevAssert(pdu != NULL); + DevAssert(nrppa_msg_info != NULL); + + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { + xer_fprint(stdout, &asn_DEF_NRPPA_NRPPA_PDU, pdu); + } + + LOG_I(NRPPA, "Processing Received Positioning Information Request\n"); + + // Preparing positioning information request for RRC + MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NRPPA_POSITIONING_INFORMATION_REQ); + nrppa_positioning_information_req_t *req = &NRPPA_POSITIONING_INFORMATION_REQ(msg); + + // IE 9.2.4 nrppatransactionID : mandatory + req->transaction_id = pdu->choice.initiatingMessage->nrppatransactionID; + + nrppa_store_ue_context(nrppa_msg_info, req->transaction_id); + + LOG_I(NRPPA, "Forwarding to RRC Positioning Information Request transaction id=%d\n", req->transaction_id); + + itti_send_msg_to_task(TASK_RRC_GNB, 0, msg); + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NRPPA_NRPPA_PDU, &pdu); + return 0; +} diff --git a/openair3/NRPPA/nrppa_gNB_location_information_transfer.h b/openair3/NRPPA/nrppa_gNB_location_information_transfer.h index 2f9ec72cd0..5fbd697c07 100644 --- a/openair3/NRPPA/nrppa_gNB_location_information_transfer.h +++ b/openair3/NRPPA/nrppa_gNB_location_information_transfer.h @@ -28,5 +28,6 @@ int nrppa_gNB_trp_information_response(instance_t instance, MessageDef *msg_p); void free_trp_information_request(nrppa_trp_information_req_t *msg); NRPPA_TRPInformationItem_t encode_trp_info_type_response_item_nrppa(nrppa_trp_information_type_response_item_t *in); void free_trp_information_response(nrppa_trp_information_resp_t *msg); +int nrppa_gNB_handle_positioning_information_request(nrppa_gnb_ue_info_t *nrppa_msg_info, const NRPPA_NRPPA_PDU_t *pdu); #endif /* NRPPA_GNB_POSITIONING_PROCEDURES_H_ */