Commit 997c2e07 authored by Melissa Elkadi's avatar Melissa Elkadi

Added rsrp/q back into report. ASN debug on.

parent 1f3b3970
......@@ -395,7 +395,7 @@ set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
#add_definitions("-DEMIT_ASN_DEBUG=1")
add_definitions("-DEMIT_ASN_DEBUG=1")
# Debug related options
......
......@@ -4217,10 +4217,23 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
}
ssize_t do_nrMeasurementReport(int measid, long phy_id, uint8_t *buffer) {
ssize_t do_nrMeasurementReport(uint8_t *buffer,
size_t bufsize,
LTE_MeasId_t measid,
LTE_PhysCellIdNR_r15_t phy_id,
long rsrp_s,
long rsrq_s,
long rsrp_tar,
long rsrq_tar) {
LOG_I(RRC, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MICHAEL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
#if EMIT_ASN_DEBUG
#warning EMIT_ASN_DEBUG is enabled
#else
#error EMIT_ASN_DEBUG is disabled
#endif
LTE_UL_DCCH_Message_t ul_dcch_msg;
memset((void *)&ul_dcch_msg, 0, sizeof(LTE_UL_DCCH_Message_t));
memset(&ul_dcch_msg, 0, sizeof(ul_dcch_msg));
ul_dcch_msg.message.present = LTE_UL_DCCH_MessageType_PR_c1;
ul_dcch_msg.message.choice.c1.present = LTE_UL_DCCH_MessageType__c1_PR_measurementReport;
......@@ -4228,47 +4241,47 @@ ssize_t do_nrMeasurementReport(int measid, long phy_id, uint8_t *buffer) {
measurementReport->criticalExtensions.present = LTE_MeasurementReport__criticalExtensions_PR_c1;
measurementReport->criticalExtensions.choice.c1.present = LTE_MeasurementReport__criticalExtensions__c1_PR_measurementReport_r8;
LTE_MeasurementReport_r8_IEs_t *mr_r8 = &measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8;
mr_r8->measResults.measId = measid;
mr_r8->measResults.measResultNeighCells = CALLOC(1, sizeof(*mr_r8->measResults.measResultNeighCells));
mr_r8->measResults.measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15;
LTE_MeasResultCellListNR_r15_t *mr_cl = &mr_r8->measResults.measResultNeighCells->choice.measResultNeighCellListNR_r15;
mr_cl = CALLOC(1, sizeof(*mr_cl));
LTE_MeasResultCellNR_r15_t *measResultNR_r15;
LTE_MeasResults_t *mr_r8 = &measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults;
//mr_r8 = CALLOC(1, sizeof(*mr_r8));
mr_r8->measId = measid;
mr_r8->measResultPCell.rsrpResult = rsrp_s;
mr_r8->measResultPCell.rsrqResult = rsrq_s;
mr_r8->measResultNeighCells = CALLOC(1, sizeof(*mr_r8->measResultNeighCells));
mr_r8->measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15;
//mr_r8->ext4 = CALLOC(1, sizeof(*mr_r8->ext4));
//mr_r8->ext4->measResultPCell_v1310->rs_sinr_Result_r13 = NULL;
LTE_MeasResultNR_r15_t *measResultNR_r15;
measResultNR_r15 = CALLOC(1, sizeof(*measResultNR_r15));
measResultNR_r15->pci_r15 = phy_id;
measResultNR_r15->rsrpResult_r15 = &rsrp_tar;
measResultNR_r15->rsrqResult_r15 = &rsrq_tar;
LTE_MeasResultCellNR_r15_t *measResultCellNR_r15;
measResultCellNR_r15 = CALLOC(1, sizeof(*measResultCellNR_r15));
measResultCellNR_r15->pci_r15 = phy_id;
ASN_SEQUENCE_ADD(&measResultCellNR_r15->measResultCell_r15, measResultNR_r15);
LTE_MeasResultCellListNR_r15_t *measResultListNR_r15;
measResultListNR_r15 = CALLOC(1, sizeof(*measResultListNR_r15));
ASN_SEQUENCE_ADD(&measResultListNR_r15->list, measResultNR_r15);
ASN_SEQUENCE_ADD(&measResultListNR_r15->list, measResultCellNR_r15);
LTE_MeasResultCellListNR_r15_t *mr_cl = &mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15;
ASN_SEQUENCE_ADD(&mr_cl->list, measResultListNR_r15);
//xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message,
NULL,
(void *)&ul_dcch_msg,
&ul_dcch_msg,
buffer,
RRC_BUF_SIZE);
bufsize);
if(enc_rval.encoded == -1) {
LOG_I(RRC, "[eNB AssertFatal] ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
free(mr_r8->measResults.measResultNeighCells);
mr_r8->measResults.measResultNeighCells = NULL;
free(measResultListNR_r15);
measResultListNR_r15 = NULL;
free(measResultNR_r15);
measResultNR_r15 = NULL;
SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET);
return -1;
}
free(mr_r8->measResults.measResultNeighCells);
mr_r8->measResults.measResultNeighCells = NULL;
free(measResultListNR_r15);
measResultListNR_r15 = NULL;
free(measResultNR_r15);
measResultNR_r15 = NULL;
SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET);
return((enc_rval.encoded+7)/8);
}
......
......@@ -343,7 +343,14 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
ssize_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_id,long rsrp_s,long rsrq_s,long rsrp_t,long rsrq_t);
ssize_t do_nrMeasurementReport(int measid, long phy_id, uint8_t *buffer);
ssize_t do_nrMeasurementReport(uint8_t *buffer,
size_t bufsize,
LTE_MeasId_t measid,
LTE_PhysCellIdNR_r15_t phy_id,
long rsrp_s,
long rsrq_s,
long rsrp_tar,
long rsrq_tar);
uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t transaction_id, uint32_t pdu_length, uint8_t *pdu_buffer);
......
......@@ -4097,12 +4097,17 @@ void ue_meas_filtering( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_
//-----------------------------------------------------------------------------
void rrc_ue_generate_nrMeasurementReport(protocol_ctxt_t *const ctxt_pP, uint8_t eNB_index ) {
uint8_t buffer[RRC_BUF_SIZE];
uint8_t target_eNB_offset = UE_rrc_inst[ctxt_pP->module_id].Info[0].handoverTarget;
LTE_PhysCellId_t targetCellId = UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.targetCellId;
UE_RRC_INST *ue = &UE_rrc_inst[ctxt_pP->module_id];
uint8_t target_eNB_offset = ue->Info[0].handoverTarget;
LTE_PhysCellId_t targetCellId = ue->HandoverInfoUe.targetCellId;
for (int i = 0; i < MAX_MEAS_ID; i++) {
if (UE_rrc_inst[ctxt_pP->module_id].measReportList[eNB_index][i] != NULL) {
LTE_MeasId_t measId = UE_rrc_inst[ctxt_pP->module_id].measReportList[eNB_index][i]->measId;
if (ue->measReportList[eNB_index][i] != NULL) {
LTE_MeasId_t measId = ue->measReportList[eNB_index][i]->measId;
long rsrp_s = binary_search_float(RSRP_meas_mapping, 98, ue->rsrp_db_filtered[eNB_index]);
long rsrq_s = binary_search_float(RSRQ_meas_mapping, 35, ue->rsrq_db_filtered[eNB_index]);
long rsrp_tar = binary_search_float(RSRP_meas_mapping, 98, ue->rsrp_db_filtered[target_eNB_offset]);
long rsrq_tar = binary_search_float(RSRQ_meas_mapping, 35, ue->rsrq_db_filtered[target_eNB_offset]);
LOG_I(RRC,"Melissa [UE %d] Frame %d: source eNB: %d target eNB: %d servingCell(%d) targetCell(%ld)\n",
ctxt_pP->module_id,
......@@ -4113,7 +4118,9 @@ void rrc_ue_generate_nrMeasurementReport(protocol_ctxt_t *const ctxt_pP, uint8_t
targetCellId);
if (ctxt_pP->frame != 0) {
ssize_t size = do_nrMeasurementReport(measId, targetCellId, buffer);
LOG_I(RRC, "Melissa, this is measId %ld, targetCellId %ld, rsrp_s %ld, rsrq_s %ld, rsrp_t %ld, rsrq_t %ld\n",
measId, targetCellId, rsrp_s, rsrq_s, rsrp_tar, rsrq_tar);
ssize_t size = do_nrMeasurementReport(buffer, sizeof(buffer), measId, targetCellId, rsrp_s, rsrq_s, rsrp_tar, rsrq_tar);
AssertFatal(size >= 0, "do_nrMeasurementReport failed \n");
LOG_I(RRC, "Melissa [UE %d] Frame %d : Generating Measurement Report for eNB %d\n",
ctxt_pP->module_id, ctxt_pP->frame, eNB_index);
......
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