diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2018-07-14 21:09:54 +0200 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2018-09-05 16:08:16 +0300 |
commit | 94443261586312967ae7eb0cce8953977de457f1 (patch) | |
tree | dd5c07fc575e9719edd664d5f3c428176f7c029e /src/coding | |
parent | 559443040567c5def8fdb84dd43504202e2ae7df (diff) |
coding: Correctly count bits when decoding EDGE bursts with MCS >= 7.
They consist of two blocks, so we should count both blocks.
Change-Id: I560de192212dae4705054a1665726369b83d213a
Diffstat (limited to 'src/coding')
-rw-r--r-- | src/coding/gsm0503_coding.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index c72aabc0..088b8bba 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -979,6 +979,9 @@ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t if (rc < 0) return -EFAULT; } else { + /* Bit counters for the second block */ + int n_errors2, n_bits_total2; + /* MCS-7,8,9 block 1 */ rc = egprs_decode_data(l2_data, c1, cps.mcs, cps.p[0], 0, n_errors, n_bits_total); @@ -987,7 +990,11 @@ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t /* MCS-7,8,9 block 2 */ rc = egprs_decode_data(l2_data, c2, cps.mcs, cps.p[1], - 1, n_errors, n_bits_total); + 1, &n_errors2, &n_bits_total2); + if (n_errors) + *n_errors += n_errors2; + if (n_bits_total) + *n_bits_total += n_bits_total2; if (rc < 0) return -EFAULT; } |