From 0d6c3e811007be828207c0f69ff4e2dddeeb64db Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 23 Feb 2018 14:06:27 +0100 Subject: measurement.c: Don't silently copy "FULL" measurements to "SUB" The existing code contained an ugly hack that if we didn't have any "SUB" measurements we would simply use the "FULL" values. That's wrong as TS 45.008 contains quite detailed rules on how the "SUB" values are to be computed. In some cases, they are identical to "FULL", but in most they are not. Let's remove the hack and replace it with an ERROR message, as clearly something is wrong if we ever encounter a measurement period end in which no single "SUB" measurement was received. The only situation in which this can occur is if the related uplink burst/block was missing, so let's set BER to 100% and level to lowest possible. Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd --- src/common/measurement.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/common/measurement.c') diff --git a/src/common/measurement.c b/src/common/measurement.c index 87bd4db3..98d9403d 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -380,8 +380,11 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) ber_sub_sum = ber_sub_sum / num_meas_sub; irssi_sub_sum = irssi_sub_sum / num_meas_sub; } else { - ber_sub_sum = ber_full_sum; - irssi_sub_sum = irssi_full_sum; + LOGP(DMEAS, LOGL_ERROR, "%s No measurements for SUB!!!\n", gsm_lchan_name(lchan)); + /* The only situation in which this can occur is if the related uplink burst/block was + * missing, so let's set BER to 100% and level to lowest possible. */ + ber_sub_sum = 10000; /* 100% */ + irssi_sub_sum = 120; /* -120 dBm */ } LOGP(DMEAS, LOGL_INFO, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), " -- cgit v1.2.3