From 916d508bf6312acbc29a3e3575151b9bc7bc66d2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 27 Feb 2018 19:39:24 +0100 Subject: measurement: Keep average of high-accurate ToA value in lchan At the end of a measurement processing window, we currently compute the ToA / timing offset at 1/256th symbol accuracy, but we only print it to the log. Let's store the value in the lchan to make it usable by other code in follow-up patches. Change-Id: I5f00a16ac966b627d9452a98b8fa70984bed684a --- include/osmo-bts/gsm_data_shared.h | 1 + src/common/measurement.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 770aea8b..2d6ead12 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -290,6 +290,7 @@ struct gsm_lchan { /* last L1 header from the MS */ uint8_t l1_info[2]; struct gsm_meas_rep_unidir ul_res; + int16_t ms_toa256; } meas; struct { struct amr_multirate_conf amr_mr; diff --git a/src/common/measurement.c b/src/common/measurement.c index bdb28508..ba7494a1 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -399,6 +399,7 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) mru->sub.rx_lev = dbm2rxlev((int)irssi_sub_sum * -1); mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum); mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum); + lchan->meas.ms_toa256 = ta256b_sum; LOGP(DMEAS, LOGL_INFO, "%s UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u)," "RXQUAL_FULL(%u), RXQUAL_SUB(%u), num_meas_sub(%u), num_ul_meas(%u) \n", -- cgit v1.2.3