aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/altair/mm-broadband-modem-altair-lte.c26
-rw-r--r--plugins/huawei/mm-broadband-modem-huawei.c12
2 files changed, 29 insertions, 9 deletions
diff --git a/plugins/altair/mm-broadband-modem-altair-lte.c b/plugins/altair/mm-broadband-modem-altair-lte.c
index 53d516f8..1155a7a1 100644
--- a/plugins/altair/mm-broadband-modem-altair-lte.c
+++ b/plugins/altair/mm-broadband-modem-altair-lte.c
@@ -1065,16 +1065,21 @@ modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *self,
GError **error)
{
const gchar *result;
- gchar *operator_code;
+ gchar *operator_code = NULL;
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
if (!result)
return NULL;
- operator_code = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_UNKNOWN);
- if (operator_code)
- mm_dbg ("loaded Operator Code: %s", operator_code);
+ if (!mm_3gpp_parse_cops_read_response (result,
+ NULL, /* mode */
+ NULL, /* format */
+ &operator_code,
+ NULL, /* act */
+ error))
+ return NULL;
+ mm_dbg ("loaded Operator Code: %s", operator_code);
return operator_code;
}
@@ -1109,16 +1114,23 @@ modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self,
GError **error)
{
const gchar *result;
- gchar *operator_name;
+ gchar *operator_name = NULL;
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
if (!result)
return NULL;
- operator_name = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_UNKNOWN);
+ if (!mm_3gpp_parse_cops_read_response (result,
+ NULL, /* mode */
+ NULL, /* format */
+ &operator_name,
+ NULL, /* act */
+ error))
+ return NULL;
+
+ mm_3gpp_normalize_operator_name (&operator_name, MM_MODEM_CHARSET_UNKNOWN);
if (operator_name)
mm_dbg ("loaded Operator Name: %s", operator_name);
-
return operator_name;
}
diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
index ac6964ae..607e14ee 100644
--- a/plugins/huawei/mm-broadband-modem-huawei.c
+++ b/plugins/huawei/mm-broadband-modem-huawei.c
@@ -2179,18 +2179,26 @@ modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self,
GError **error)
{
const gchar *result;
- gchar *operator_name;
+ gchar *operator_name = NULL;
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
if (!result)
return NULL;
+ if (!mm_3gpp_parse_cops_read_response (result,
+ NULL, /* mode */
+ NULL, /* format */
+ &operator_name,
+ NULL, /* act */
+ error))
+ return NULL;
+
/* Despite +CSCS? may claim supporting UCS2, Huawei modems always report the
* operator name in ASCII in a +COPS response. Thus, we ignore the current
* charset claimed by the modem and assume the charset is IRA when parsing
* the operator name.
*/
- operator_name = mm_3gpp_parse_operator (result, MM_MODEM_CHARSET_IRA);
+ mm_3gpp_normalize_operator_name (&operator_name, MM_MODEM_CHARSET_IRA);
if (operator_name)
mm_dbg ("loaded Operator Name: %s", operator_name);