trxcon: trx_data_rx_cb(): support parsing 8-PSK modulated bursts

Change-Id: I78b1a79c329299ab65eb339e9447a47382983cd9
This commit is contained in:
Vadim Yanitskiy 2022-11-24 11:46:40 +07:00 committed by fixeria
parent 384a8dd3fe
commit 04b14c49f0
1 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,9 @@
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>
#define TRXDv0_HDR_LEN 8
#define GMSK_BURST_LEN 148
#define S(x) (1 << (x))
static void trx_fsm_cleanup_cb(struct osmo_fsm_inst *fi,
@ -642,7 +645,7 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
return read_len;
}
if (read_len < (8 + 148)) { /* TRXDv0 header + GMSK burst */
if (read_len < (TRXDv0_HDR_LEN + GMSK_BURST_LEN)) {
LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR,
"Got data message with invalid length '%zd'\n", read_len);
return -EINVAL;
@ -661,8 +664,8 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what)
.fn = osmo_load32be(buf + 1),
.rssi = -(int8_t) buf[5],
.toa256 = (int16_t) (buf[6] << 8) | buf[7],
.burst = burst,
.burst_len = 148,
.burst = burst, /* at least GMSK_BURST_LEN */
.burst_len = read_len - TRXDv0_HDR_LEN,
};
/* Convert ubits {254..0} to sbits {-127..127} in-place */