diff options
author | Giacinto Cifelli <gciofono@gmail.com> | 2020-07-27 10:29:14 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-08-11 07:17:07 +0000 |
commit | e2ab49db0f5078716156c70a23f8f5d5b6d27848 (patch) | |
tree | 3488ee14c329a6fcb9c2f2539b1753d2e909fb9b /plugins/cinterion/tests/test-modem-helpers-cinterion.c | |
parent | 28ad994e372dc58e474567c70adbb0f58022cb22 (diff) |
cinterion: setup initial LTE parameters
Diffstat (limited to 'plugins/cinterion/tests/test-modem-helpers-cinterion.c')
-rw-r--r-- | plugins/cinterion/tests/test-modem-helpers-cinterion.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/cinterion/tests/test-modem-helpers-cinterion.c b/plugins/cinterion/tests/test-modem-helpers-cinterion.c index 35123283..14ce4c38 100644 --- a/plugins/cinterion/tests/test-modem-helpers-cinterion.c +++ b/plugins/cinterion/tests/test-modem-helpers-cinterion.c @@ -1596,6 +1596,71 @@ test_smoni_response_to_signal (void) } } +/*****************************************************************************/ +/* Test ^SCFG="MEopMode/Prov/Cfg" responses */ + +typedef struct { + const gchar *str; + MMCinterionModemFamily modem_family; + guint initial_cid; + gdouble expected_cid; +} ProvcfgResponseTest; + + +static const ProvcfgResponseTest provcfg_response_tests[] = { + { + + .str = "^SCFG: \"MEopMode/Prov/Cfg\",\"vdfde\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, + .initial_cid = 1, + .expected_cid = 1, + }, + { + + .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"attus\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_IMT, + .initial_cid = 1, + .expected_cid = 1, + }, + { + + .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"2\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, + .initial_cid = 1, + .expected_cid = 3, + }, + { + + .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"vzwdcus\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, + .initial_cid = 1, + .expected_cid = 3, + }, + { + + .str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"tmode\"", + .modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT, + .initial_cid = 1, + .expected_cid = 2, + } +}; + +static void +test_provcfg_response (void) +{ + guint i; + + for (i = 0; i < G_N_ELEMENTS (provcfg_response_tests); i++) { + guint cid = provcfg_response_tests[i].initial_cid; + + mm_cinterion_provcfg_response_to_cid (provcfg_response_tests[i].str, + provcfg_response_tests[i].modem_family, + MM_MODEM_CHARSET_GSM, + NULL, + &cid); + g_assert_cmpuint (cid, ==, provcfg_response_tests[i].expected_cid); + } +} /*****************************************************************************/ @@ -1629,6 +1694,7 @@ int main (int argc, char **argv) g_test_add_func ("/MM/cinterion/ctzu/urc/full", test_ctzu_urc_full); g_test_add_func ("/MM/cinterion/smoni/query_response", test_smoni_response); g_test_add_func ("/MM/cinterion/smoni/query_response_to_signal", test_smoni_response_to_signal); + g_test_add_func ("/MM/cinterion/scfg/provcfg", test_provcfg_response); return g_test_run (); } |