aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/coding/gsm0503_coding.c5
-rw-r--r--tests/coding/coding_test.ok12
2 files changed, 9 insertions, 8 deletions
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 163ce21a..8480240d 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -2879,7 +2879,7 @@ static inline int16_t rach_decode_ber(const sbit_t *burst, uint8_t bsic, bool is
osmo_ubit2pbit_ext(ra, 0, conv, 0, nbits, 1);
- return is_11bit ? osmo_load16le(ra) : ra[0];
+ return is_11bit ? ((ra[0] << 3) | (ra[1] & 0x07)) : ra[0];
}
/*! Decode the Extended (11-bit) RACH according to 3GPP TS 45.003
@@ -2974,7 +2974,8 @@ int gsm0503_rach_ext_encode(ubit_t *burst, uint16_t ra11, uint8_t bsic, bool is_
uint8_t ra[2] = { 0 }, nbits = 8;
if (is_11bit) {
- osmo_store16le(ra11, ra);
+ ra[0] = (uint8_t) (ra11 >> 3);
+ ra[1] = (uint8_t) (ra11 & 0x07);
nbits = 11;
} else
ra[0] = (uint8_t)ra11;
diff --git a/tests/coding/coding_test.ok b/tests/coding/coding_test.ok
index 496ce897..3a4fbf2a 100644
--- a/tests/coding/coding_test.ok
+++ b/tests/coding/coding_test.ok
@@ -40,12 +40,12 @@ S-Bits:
Decoded: 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17
xcch_decode: n_errors=60 n_bits_total=456 ber=0.13
-Decoded RA11: 0x7cc
-Decoded RA11: 0x6cc
-Decoded RA11: 0x7cd
-Decoded RA11: 0x4cd
-Decoded RA11: 0x7cc
-Decoded RA11: 0x6ce
+Decoded RA11: 0x667
+Decoded RA11: 0x666
+Decoded RA11: 0x66f
+Decoded RA11: 0x66c
+Decoded RA11: 0x667
+Decoded RA11: 0x676
Encoding: 03 03 01 00
U-Bits: 111001110011000011100111001100001101001111000000000011010000011010110111111100