diff --git a/src/osmo-bsc/meas_rep.c b/src/osmo-bsc/meas_rep.c index 73d9a1f21..9b2fca0d8 100644 --- a/src/osmo-bsc/meas_rep.c +++ b/src/osmo-bsc/meas_rep.c @@ -31,11 +31,15 @@ static int get_field(const struct gsm_meas_rep *rep, case MEAS_REP_DL_RXLEV_FULL: if (!(rep->flags & MEAS_REP_F_DL_VALID)) return -EINVAL; - return rep->dl.full.rx_lev; + /* Add BS Power value to rxlev: improve the RXLEV value by the amount of power that the BTS is reducing + * transmission. Note that bs_power is coded as dB/2, a positive value indicating the amount of power reduction + * on the downlink; rxlev is coded in dB, where a higher number means stronger signal. */ + return rep->dl.full.rx_lev + (rep->bs_power * 2); case MEAS_REP_DL_RXLEV_SUB: if (!(rep->flags & MEAS_REP_F_DL_VALID)) return -EINVAL; - return rep->dl.sub.rx_lev; + /* Apply BS Power as explained above */ + return rep->dl.sub.rx_lev + (rep->bs_power * 2); case MEAS_REP_DL_RXQUAL_FULL: if (!(rep->flags & MEAS_REP_F_DL_VALID)) return -EINVAL; diff --git a/tests/handover/test_bs_power.ho_vty b/tests/handover/test_bs_power.ho_vty index 2c68d57a6..5d8c27846 100644 --- a/tests/handover/test_bs_power.ho_vty +++ b/tests/handover/test_bs_power.ho_vty @@ -6,11 +6,6 @@ create-bts trx-count 1 timeslots c+s4 TCH/F TCH/F TCH/F TCH/F TCH/F TCH/F PDCH set-ts-use trx 0 0 states * TCH/F - - - - - * meas-rep repeat 10 bspower 20 lchan 0 0 1 0 rxlev 20 rxqual 0 ta 0 neighbors 30 -# FAIL: there should be no handover, because the bspower reduction of 20 with an rxlev of 20 (= 40) is stronger than the -# neighbor at 30. But since osmo-bsc fails to take the BS Power into account, it hands over to the neighbor. -#expect-no-chan -expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0 - -# When the neighbor then reports the stronger original cell, we get handover oscillation -meas-rep repeat 10 bspower 0 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40 -expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0 +# there should be no handover, because the bspower reduction of 20 with an rxlev of 20 (= 40) is stronger than the +# neighbor at 30. +expect-no-chan