From cd463dd72acbe2286dc33fa266ec081d75b57751 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 11 Feb 2013 12:52:56 +0100 Subject: TRX: Minor fixes, especially handle TOA of RACH correctly --- src/osmo-bts-trx/trx_if.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/osmo-bts-trx/trx_if.c') diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 7d1be85..b8535e3 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -368,7 +368,7 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) int len; uint8_t tn; int8_t rssi; - int16_t toa; + float toa; uint32_t fn; sbit_t bits[148]; int i; @@ -384,7 +384,7 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) tn = buf[0]; fn = (buf[1] << 24) | (buf[2] << 16) | (buf[3] << 8) | buf[4]; rssi = (int8_t)buf[5]; - toa = (int16_t)(buf[6] << 8) | buf[7]; + toa = ((int16_t)(buf[6] << 8) | buf[7]) / 256.0F; /* copy and convert bits {254..0} to sbits {-127..127} */ for (i = 0; i < 148; i++) { @@ -403,7 +403,7 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what) return -EINVAL; } - LOGP(DTRX, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%d ", + LOGP(DTRX, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%.2f ", tn, fn, rssi, toa); trx_sched_ul_burst(l1h, tn, fn, bits, rssi, toa); -- cgit v1.2.3