diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-04 00:18:54 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-04 23:59:49 +0700 |
commit | c5d9507b5ddd04d4ac14dc009b6df20c3098e2cc (patch) | |
tree | 40561fa371771d3317cb365e716f9cfdd166e1ba | |
parent | cd9b850ee4ac4c0a876102924d7456b327a1b250 (diff) |
host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocore
No need to reimplement the existing functions...
Change-Id: Ic9b232c8561609d42dac10e6249a3e1c58c4edc1
-rw-r--r-- | src/host/trxcon/trx_if.c | 9 |
1 files changed, 2 insertions, 7 deletions
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); |