Merge remote-tracking branch 'origin/oai-ue-fix-rsrp-mapping' into integration_2025_w42 (!3701)
OAI UE: add shared RSRP Table 10.1.6.1-1 mapping function to helpers and adopt it RRC UE - Add to common/utils/nr/nr_common remove from NR_MAC_UE/nr_ue_procedures.c - Adopt in asn1_msg.c for MeasurementReport: this solves the following possible assert: Assertion (enc_rval.encoded > 0) failed! In do_nrMeasurementReport_SA() /oai-ran/openair2/RRC/NR/MESSAGES/asn1_msg.c:898 ASN1 message encoding failed (MeasResultServMOList, 18446744073709551615)! Motivation: unify RSRP-to-index mapping across layers and fix NR RRC MeasurementReport encoding failures due to out-of-range values by reusing the validated mapping. Note: NR_RSRP-Range.c constraint: /* (0..127) */ Also refactored MeasurementReport to improve the code.
This commit is contained in:
@@ -152,6 +152,17 @@ void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out)
|
||||
#endif
|
||||
}
|
||||
|
||||
/** @brief 3GPP TS 38.133 Table 10.1.6.1-1 mapping from dBm to RSRP index */
|
||||
uint8_t get_rsrp_index(int rsrp_dBm)
|
||||
{
|
||||
int index = rsrp_dBm + 157;
|
||||
if (rsrp_dBm > -44)
|
||||
index = 113;
|
||||
if (rsrp_dBm < -140)
|
||||
index = 16;
|
||||
return (uint8_t)index;
|
||||
}
|
||||
|
||||
// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html
|
||||
uint64_t reverse_bits(uint64_t in, int n_bits)
|
||||
{
|
||||
|
||||
@@ -186,6 +186,9 @@ typedef struct meas_s {
|
||||
val_init_t csi_rsrp_dBm;
|
||||
} meas_t;
|
||||
|
||||
/** @brief Returns NR RSRP index per 3GPP TS 38.133 Table 10.1.6.1-1 */
|
||||
uint8_t get_rsrp_index(int rsrp_dBm);
|
||||
|
||||
/**
|
||||
* @brief To start a timer
|
||||
* @param timer Timer to be started
|
||||
|
||||
Reference in New Issue
Block a user