aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/coding/coding_test.c53
-rw-r--r--tests/coding/coding_test.ok7
2 files changed, 60 insertions, 0 deletions
diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c
index 2ae95f87..17ddfaaa 100644
--- a/tests/coding/coding_test.c
+++ b/tests/coding/coding_test.c
@@ -185,6 +185,22 @@ static void test_rach_ext(uint8_t bsic, uint16_t ra)
printd("\n");
}
+static void test_rach_11bit_sample(uint8_t bsic, const sbit_t *payload)
+{
+ int n_errors, n_bits_total;
+ uint16_t ra11;
+ int rc;
+
+ /* Decode, correcting errors */
+ rc = gsm0503_rach_ext_decode_ber(&ra11, payload, bsic, &n_errors, &n_bits_total);
+ if (rc) {
+ printf("%s(): decoding failed (rc=%d)\n", __func__, rc);
+ return;
+ }
+
+ printf("Decoded RA11: 0x%03x\n", ra11);
+}
+
static void test_sch(uint8_t *info)
{
uint8_t result[4];
@@ -376,6 +392,39 @@ uint8_t test_macblock[][54] = {
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 },
};
+/* 11-bit Access Burst soft-bits (payload only) from an EGPRS capable phone (BSIC 63) */
+static const sbit_t test_rach_11bit[6][36] = {
+ { 103, 109, -108, -110, 107, 108, -106, -120, -121,
+ -120, -105, 122, -104, -109, 108, 109, -109, -111,
+ 107, 111, -105, -119, -121, -104, 122, -120, 121,
+ -99, -121, -120, -122, -106, 109, 109, -108, -111 },
+
+ { 103, 109, -109, -109, 106, 107, -106, -121, -121,
+ -120, -106, 121, -120, 117, -122, 101, 109, -122,
+ 120, -120, 101, 118, 120, 102, -125, 101, 110,
+ -120, 121, -101, -121, -118, -121, -106, 108, 121 },
+
+ { -121, -122, -104, 123, -104, -108, 122, -104, -121,
+ -121, -102, 124, -105, -110, 107, 109, -108, -109,
+ 121, -122, 101, 107, -121, 105, 108, -110, -107,
+ 124, -104, -109, 120, -122, 100, 122, 104, -123 },
+
+ { -122, -123, -103, 123, -105, -109, 122, -105, -121,
+ -120, -104, 122, -120, 121, -101, -122, -120, -120,
+ -119, -105, 120, -106, -108, 123, -104, -113, 105,
+ 122, 101, -122, 119, -122, 117, -121, 119, -122 },
+
+ { 105, 110, -109, -109, 107, 108, -108, -120, -120,
+ -121, -106, 121, -104, -107, 106, 108, -108, -108,
+ 108, 107, -105, -120, -122, -104, 122, -119, 121,
+ -103, -122, -118, -120, -106, 108, 108, -110, -111 },
+
+ { 120, -103, -123, -104, 119, -121, 100, 123, 106,
+ -109, -107, 121, -122, 118, -121, 103, 108, -122,
+ 120, -119, 121, -103, -121, -119, -121, -103, 124,
+ -106, -108, 122, -103, -106, 121, -120, 119, -121 },
+};
+
uint8_t test_speech_fr[33];
uint8_t test_speech_efr[31];
uint8_t test_speech_hr[15];
@@ -402,6 +451,10 @@ int main(int argc, char **argv)
test_rach_ext(0x1a, i);
}
+ for (i = 0; i < ARRAY_SIZE(test_rach_11bit); i++)
+ test_rach_11bit_sample(0x3f, test_rach_11bit[i]);
+ printf("\n");
+
for (i = 0; i < len_l2; i++)
test_sch(test_l2[i]);
diff --git a/tests/coding/coding_test.ok b/tests/coding/coding_test.ok
index 2005f6e5..496ce897 100644
--- a/tests/coding/coding_test.ok
+++ b/tests/coding/coding_test.ok
@@ -40,6 +40,13 @@ 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
+
Encoding: 03 03 01 00
U-Bits: 111001110011000011100111001100001101001111000000000011010000011010110111111100
S-Bits: 81 81 81 7f 7f 81 81 81 7f 7f 81 81 7f 7f 7f 7f 81 81 81 7f 7f 81 81 81 7f 7f 81 81 7f 7f 7f 7f 81 81 7f 81 7f 7f 81 81 81 81 7f 7f 7f 7f 7f 7f 7f 7f 7f 7f 81 81 7f 81 7f 7f 7f 7f 7f 81 81 7f 81 7f 81 81 7f 81 81 81 81 81 81 81 7f 7f