From c5d9507b5ddd04d4ac14dc009b6df20c3098e2cc Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 4 Dec 2017 00:18:54 +0700 Subject: host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore No need to reimplement the existing functions... Change-Id: Ic9b232c8561609d42dac10e6249a3e1c58c4edc1 --- src/host/trxcon/trx_if.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c index d7f496eb..1f5edb28 100644 --- a/src/host/trxcon/trx_if.c +++ b/src/host/trxcon/trx_if.c @@ -537,8 +537,8 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what) sbit_t bits[148]; int8_t rssi, tn; uint32_t fn; - int len, i; float toa; + int len; len = recv(ofd->fd, buf, sizeof(buf), 0); if (len <= 0) @@ -556,12 +556,7 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what) 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++) { - if (buf[8 + i] == 255) - bits[i] = -127; - else - bits[i] = 127 - buf[8 + i]; - } + osmo_ubit2sbit(bits, buf + 8, 148); if (tn >= 8) { LOGP(DTRXD, LOGL_ERROR, "Illegal TS %d\n", tn); -- cgit v1.2.3