Commit c3758fec authored by General ABS's avatar General ABS Committed by rmagueta

Send RSRP measured with CSI in measurement report

parent e9402ec3
......@@ -103,7 +103,7 @@ typedef struct NRRrcMacBcchDataInd_s {
typedef struct NRRrcMacMeasDataInd_s {
uint8_t gnb_index;
uint8_t cqi;
uint8_t rsrp;
} NRRrcMacMeasDataInd;
typedef struct RrcMacBcchMbmsDataReq_s {
......
......@@ -1222,7 +1222,7 @@ int8_t nr_ue_process_csirs_measurements(module_id_t module_id,
LOG_D(NR_MAC,"(%d.%d) Received CSI-RS measurements\n", frame, slot);
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
memcpy(&mac->csirs_measurements, csirs_measurements, sizeof(*csirs_measurements));
nr_mac_rrc_meas_ind_ue(module_id, csirs_measurements->gNB_index, csirs_measurements->cqi);
nr_mac_rrc_meas_ind_ue(module_id, csirs_measurements->gNB_index, csirs_measurements->rsrp);
return 0;
}
......@@ -2760,16 +2760,7 @@ uint8_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac,
}
// TODO: Improvements will be needed to cri_ssbri_bitlen>0
// TS 38.133 - Table 10.1.6.1-1
int rsrp_dBm = mac->csirs_measurements.rsrp_dBm;
if (rsrp_dBm < -140) {
temp_payload = 16;
} else if (rsrp_dBm > -44) {
temp_payload = 113;
} else {
temp_payload = mac->csirs_measurements.rsrp_dBm + 157;
}
temp_payload = mac->csirs_measurements.rsrp;
reverse_n_bits((uint8_t *)&temp_payload, n_bits);
LOG_D(NR_MAC, "cri_ssbri_bitlen = %d\n", cri_ssbri_bitlen);
......
......@@ -1002,7 +1002,7 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size,
}
// TODO: Improve this function that is all hardcoded
uint16_t do_nrMeasurementReport_SA(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size) {
uint16_t do_nrMeasurementReport_SA(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size, uint8_t rsrp_s) {
asn_enc_rval_t enc_rval;
NR_UL_DCCH_Message_t ul_dcch_msg;
......@@ -1025,7 +1025,7 @@ uint16_t do_nrMeasurementReport_SA(uint8_t Mod_id, uint8_t *buffer, size_t buffe
*measResultServMo->measResultServingCell.physCellId = 0;
measResultServMo->measResultServingCell.measResult.cellResults.resultsCSI_RS_Cell = CALLOC(1,sizeof(struct NR_MeasQuantityResults));
measResultServMo->measResultServingCell.measResult.cellResults.resultsCSI_RS_Cell->rsrp = CALLOC(1,sizeof(NR_RSRP_Range_t));
*measResultServMo->measResultServingCell.measResult.cellResults.resultsCSI_RS_Cell->rsrp = 10;
*measResultServMo->measResultServingCell.measResult.cellResults.resultsCSI_RS_Cell->rsrp = rsrp_s;
ASN_SEQUENCE_ADD(&measurementReport_ie->measResults.measResultServingMOList.list, measResultServMo);
xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&ul_dcch_msg);
......
......@@ -146,7 +146,7 @@ uint8_t do_RRCSetupComplete(uint8_t Mod_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS);
uint16_t do_nrMeasurementReport_SA(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size);
uint16_t do_nrMeasurementReport_SA(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size, uint8_t rsrp_s);
uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size, uint8_t *rv);
......
......@@ -39,10 +39,10 @@
typedef uint32_t channel_t;
int8_t nr_mac_rrc_meas_ind_ue(module_id_t module_id, uint32_t gNB_index, uint8_t cqi) {
int8_t nr_mac_rrc_meas_ind_ue(module_id_t module_id, uint32_t gNB_index, uint8_t rsrp_s) {
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_MEAS_DATA_IND);
NR_RRC_MAC_MEAS_DATA_IND(message_p).gnb_index = gNB_index;
NR_RRC_MAC_MEAS_DATA_IND(message_p).cqi = cqi;
NR_RRC_MAC_MEAS_DATA_IND(message_p).rsrp = rsrp_s;
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
return 0;
}
......
......@@ -2280,14 +2280,16 @@ nr_rrc_ue_establish_srb2(
break;
case NR_RRC_MAC_MEAS_DATA_IND:
LOG_I(NR_RRC, "[gNB %i, count %i] Received measurements: CQI = %i\n",
LOG_I(NR_RRC, "[gNB %i, count %i] Received measurements: RSRP_s = %i (dBm)\n",
NR_RRC_MAC_MEAS_DATA_IND(msg_p).gnb_index,
number_of_received_meas,
NR_RRC_MAC_MEAS_DATA_IND(msg_p).cqi);
NR_RRC_MAC_MEAS_DATA_IND(msg_p).rsrp-157);
// FIXME: Add a correct criterion
if (number_of_received_meas == 50) {
rrc_ue_generate_measurementReport(&ctxt, NR_RRC_MAC_MEAS_DATA_IND(msg_p).gnb_index);
rrc_ue_generate_measurementReport(&ctxt,
NR_RRC_MAC_MEAS_DATA_IND(msg_p).gnb_index,
NR_RRC_MAC_MEAS_DATA_IND(msg_p).rsrp);
number_of_received_meas = 0;
}
......
......@@ -113,8 +113,8 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const ui
/**\brief Send measurements to RRC to perform the L3 measurements
\param module_id module id
\param gNB_index gNB index
\param cqi channel quality indicator*/
int8_t nr_mac_rrc_meas_ind_ue(module_id_t module_id, uint32_t gNB_index, uint8_t cqi);
\param rsrp_s reference signal received power*/
int8_t nr_mac_rrc_meas_ind_ue(module_id_t module_id, uint32_t gNB_index, uint8_t rsrp_s);
/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP)
\param module_id module id
......
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