From a4bca115557feb0268e6cfda30238ded16328ae6 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 21 Feb 2018 16:58:08 +0100 Subject: bts: use feature list instead of speech codec table osmo-bts has a table of pchan/channel mode combinations for every bts. This table models the codec capabilitys of the BTS hardware. However, having the speech codec apabilities modeled inside the BTS feature list would be much more comfortable and since the feature list is communicated back to the BSC we would get the codec capabilities inside the BSC domain as well. - remove the pchan/channel mode tables - set speech codec variants for each BTS type - fix bts_supports_cm so that it queries the feature list Change-Id: I977dc729ba856631245aedf76afd48eac92166f7 --- tests/misc/misc_test.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c index 00744a6b..e4542354 100644 --- a/tests/misc/misc_test.c +++ b/tests/misc/misc_test.c @@ -157,29 +157,29 @@ static void test_sacch_get(void) } } -static const struct bts_cm bts_model_supported_cm[] = { - {GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1}, - {GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1}, - {GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR}, - {GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR}, - {_GSM_PCHAN_MAX, 0} -}; - static void test_bts_supports_cm(void) { - struct gsm_bts_role_bts bts; - bts.support.cm = bts_model_supported_cm; + struct gsm_bts *bts; + + bts = gsm_bts_alloc(NULL, 0); + + gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_V1); + gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_V1); + gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR); + gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR); OSMO_ASSERT(bts_supports_cm - (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1) == 1); + (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1) == 1); OSMO_ASSERT(bts_supports_cm - (&bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1) == 1); + (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1) == 1); OSMO_ASSERT(bts_supports_cm - (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR) == 0); + (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR) == 0); OSMO_ASSERT(bts_supports_cm - (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR) == 1); + (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR) == 1); OSMO_ASSERT(bts_supports_cm - (&bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR) == 1); + (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR) == 1); + + talloc_free(bts); } int main(int argc, char **argv) -- cgit v1.2.3