diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 665668f5..c8c1f4bd 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++ b/plugins/telit/mm-modem-helpers-telit.c @@ -161,11 +161,8 @@ mm_telit_parse_csim_response (const guint step, return retries; } - -#define SUPP_BAND_RESPONSE_REGEX "#BND:\\s*\\((?P[0-9\\-,]*)\\)(,\\s*\\((?P.*)\\))?" -#define SUPP_BAND_4G_MODEM_RESPONSE_REGEX "#BND:\\s*\\((?P.*)\\),\\s*\\((?P.*)\\),\\s*\\((?P\\d+-\\d+)\\)" -#define CURR_BAND_RESPONSE_REGEX "#BND:\\s*(?P\\d+)(,\\s*(?P\\d+))?" -#define CURR_BAND_4G_MODEM_RESPONSE_REGEX "#BND:\\s*(?P\\d+),\\s*(?P\\d+),\\s*(?P\\d+)" +#define SUPP_BAND_RESPONSE_REGEX "#BND:\\s*\\((?P[0-9\\-,]*)\\)(,\\s*\\((?P[0-9\\-,]*)\\))?(,\\s*\\((?P[0-9\\-,]*)\\))?" +#define CURR_BAND_RESPONSE_REGEX "#BND:\\s*(?P\\d+)(,\\s*(?P\\d+))?(,\\s*(?P\\d+))?" /*****************************************************************************/ /* #BND response parser @@ -235,18 +232,11 @@ mm_telit_parse_bnd_response (const gchar *response, switch (band_type) { case LOAD_SUPPORTED_BANDS: /* Parse #BND=? response */ - if (modem_is_4g) - r = g_regex_new (SUPP_BAND_4G_MODEM_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); - else - r = g_regex_new (SUPP_BAND_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); + r = g_regex_new (SUPP_BAND_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); break; case LOAD_CURRENT_BANDS: /* Parse #BND? response */ - if (modem_is_4g) - r = g_regex_new (CURR_BAND_4G_MODEM_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); - else - r = g_regex_new (CURR_BAND_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); - break; + r = g_regex_new (CURR_BAND_RESPONSE_REGEX, G_REGEX_RAW, 0, NULL); default: break; } diff --git a/plugins/telit/tests/test-mm-modem-helpers-telit.c b/plugins/telit/tests/test-mm-modem-helpers-telit.c index 03b1bc7a..2da60c11 100644 --- a/plugins/telit/tests/test-mm-modem-helpers-telit.c +++ b/plugins/telit/tests/test-mm-modem-helpers-telit.c @@ -117,7 +117,7 @@ typedef struct { static BNDFlagsTest band_flag_test[] = { {"0-3", 4, {0, 1, 2, 3} }, {"0,3", 2, {0, 3} }, - {"0,2-3,5-7,9", 2, {0, 2, 3, 5, 6, 7, 9} }, + {"0,2-3,5-7,9", 7, {0, 2, 3, 5, 6, 7, 9} }, { NULL, 0, {}}, };