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/mm-modem-helpers-cinterion.c | |
parent | 28ad994e372dc58e474567c70adbb0f58022cb22 (diff) |
cinterion: setup initial LTE parameters
Diffstat (limited to 'plugins/cinterion/mm-modem-helpers-cinterion.c')
-rw-r--r-- | plugins/cinterion/mm-modem-helpers-cinterion.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.c b/plugins/cinterion/mm-modem-helpers-cinterion.c index 095e396c..bff03a90 100644 --- a/plugins/cinterion/mm-modem-helpers-cinterion.c +++ b/plugins/cinterion/mm-modem-helpers-cinterion.c @@ -1398,3 +1398,55 @@ mm_cinterion_smoni_response_to_signal_info (const gchar *response, return TRUE; } + +/*****************************************************************************/ +/* provider cfg information to CID number for EPS initial settings */ + +/* + * at^scfg="MEopMode/Prov/Cfg" + * ^SCFG: "MEopMode/Prov/Cfg","vdfde" + * ^SCFG: "MEopMode/Prov/Cfg","attus" + * ^SCFG: "MEopMode/Prov/Cfg","2" -> PLS8-X vzw + * ^SCFG: "MEopMode/Prov/Cfg","vzwdcus" -> PLAS9-x vzw + * ^SCFG: "MEopMode/Prov/Cfg","tmode" -> t-mob germany + * OK + */ +void +mm_cinterion_provcfg_response_to_cid (const gchar *response, + MMCinterionModemFamily modem_family, + MMModemCharset charset, + gpointer log_object, + guint *cid) +{ + g_autoptr(GRegex) r = NULL; + g_autoptr(GMatchInfo) match_info = NULL; + g_autofree GError *inner_error = NULL; + + r = g_regex_new ("\\^SCFG:\\s*\"MEopMode/Prov/Cfg\",\\s*\"([0-9a-zA-Z]*)\"", 0, 0, NULL); + g_assert (r != NULL); + g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error); + if (inner_error) + return; + if (g_match_info_matches (match_info)) { + g_autofree gchar *mno = NULL; + + mno = mm_get_string_unquoted_from_match_info (match_info, 1); + if (mno && modem_family == MM_CINTERION_MODEM_FAMILY_IMT) { + mno = mm_charset_take_and_convert_to_utf8 (mno, charset); + mm_obj_dbg (log_object, "current mno: %s", mno); + } + + /* for Cinterion LTE modules, some CID numbers have special meaning. + * This is dictated by the chipset and by the MNO: + * - the chipset uses a special one, CID 1, as a LTE combined attach chipset + * - the MNOs can define the sequence and number of APN to be used for their network. + * This takes priority over the chipset preferences, and therefore for some of them + * the CID for the initial EPS context must be changed. + */ + if (g_strcmp0 (mno, "2") == 0 || g_strcmp0 (mno, "vzwdcus") == 0) + *cid = 3; + else if (g_strcmp0 (mno, "tmode") == 0) + *cid = 2; + /* in all other cases no change to the preset value */ + } +} |