From e357646ed708bd5acc56b250d01bd695fff9cd73 Mon Sep 17 00:00:00 2001 From: Luca Melette Date: Mon, 22 Jan 2018 17:14:08 +0100 Subject: Import gprsdecode utility from SRLabs This change introduces a modified version of gprsdecode utility, which is intended to decode the GPRS burst captures and forward decoded packets to the GSMTAP sink. The following modifications were made: - use shared libosmocoding library for GSM 05.03 coding; - use optget for command line options parsing; - use a single application select loop; - use GNU automake as the build system; - add regression tests (GNU autotest); - clean up and comment the code; - add license headers; The code is based on work of SRLabs: https://srlabs.de/ git://git.srlabs.de/gprsdecode.git Related: OS#1672 Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856 --- src/host/gprsdecode/gprs.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/host/gprsdecode/gprs.h (limited to 'src/host/gprsdecode/gprs.h') diff --git a/src/host/gprsdecode/gprs.h b/src/host/gprsdecode/gprs.h new file mode 100644 index 00000000..1147d543 --- /dev/null +++ b/src/host/gprsdecode/gprs.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +#define GSM_BURST_PL_LEN 116 +#define GPRS_BURST_PL_LEN GSM_BURST_PL_LEN + +#define MEAS_AVG(meas) \ + ((meas[0] + meas[1] + meas[2] + meas[3]) / 4) + +/* Burst decoder state */ +struct burst_buf { + unsigned snr[4]; + unsigned rxl[4]; + unsigned errors; + unsigned count; + + sbit_t bursts[GSM_BURST_PL_LEN * 4]; + uint32_t fn_first; +}; + +int process_pdch(struct l1ctl_burst_ind *bi, bool verbose); -- cgit v1.2.3