From 29ea40f5387c18a0aeb906039750bbf3a9828e7e Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Wed, 10 Jun 2015 00:27:18 -0400 Subject: trx: Assume 100% BER if total decoded bits is 0 in l1if_process_meas_res() --- src/osmo-bts-trx/l1_if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 6f8cd845..d0cf56d2 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -474,7 +474,8 @@ int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t fn, uint { struct gsm_lchan *lchan = &trx->ts[tn].lchan[l1sap_chan2ss(chan_nr)]; struct osmo_phsap_prim l1sap; - float ber = (float)n_errors / (float)n_bits_total; + /* 100% BER is n_bits_total is 0 */ + float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total; LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", -- cgit v1.2.3