From 94d79fdeef612bcc3216813e5d6ef3eaf6f652b1 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 1 Mar 2019 10:40:48 +0100 Subject: gsm0808_utils: fix gsm48 multirate to S-bit converter The function gsm0808_sc_cfg_from_gsm48_mr_cfg() is used to convert a gsm48 multirate struct into a set of S-bits (S0 to S15). However, the conversion function currently does not take into account that bit S1 actually stands for four rates at once (Config-NB-Code = 1). Lets make sure that S1 is only set when the multirate configuration permits all four required rates. Change-Id: I6ad531d4e70c2252e32e2bbaca8e14a7ec6d9840 Related: SYS#4470 --- tests/gsm0808/gsm0808_test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/gsm0808/gsm0808_test.c') diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index 87f5d2a5..8f1e2993 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -1902,6 +1902,27 @@ static void test_gsm0808_sc_cfg_from_gsm48_mr_cfg(void) cfg.m10_2 = 1; cfg.m12_2 = 1; test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + + cfg.m4_75 = 1; + cfg.m5_15 = 0; + cfg.m5_90 = 1; + cfg.m6_70 = 0; + cfg.m7_40 = 1; + cfg.m7_95 = 0; + cfg.m10_2 = 0; + cfg.m12_2 = 1; + test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + + cfg.m4_75 = 1; + cfg.m5_15 = 0; + cfg.m5_90 = 1; + cfg.m6_70 = 0; + cfg.m7_40 = 1; + cfg.m7_95 = 0; + cfg.m10_2 = 0; + cfg.m12_2 = 0; + test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg); + } static void test_gsm48_mr_cfg_from_gsm0808_sc_cfg_single(uint16_t s15_s0) -- cgit v1.2.3