aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-12-18 10:59:05 +0100
committerDan Williams <dcbw@redhat.com>2020-01-06 20:17:08 +0000
commit1722915f5eae0efa7b02540dadfbcaef4f513633 (patch)
tree63ca4bf6042be1cd94cc7d0134315dd825df2fda /src/mm-modem-helpers.c
parenta23040756b3aeae0fd202b77cfe29d8a272582fe (diff)
broadband-modem: +COPS=? response may give strings in UCS2
If the charset selected via CSCS is UCS2, the modem may decide to return all the strings in the +COPS=? response in UCS2: <debug> (ttyACM0): --> 'AT+COPS=?<CR>' <debug> (ttyACM0): <-- '<CR><LF>+COPS: (2,"004D006F007600690073007400610072","004D006F007600690073007400610072","00320031003400300037",7) <debug> Found network '00320031003400300037' ('004D006F007600690073007400610072','004D006F007600690073007400610072'); availability: current, access tech: lte
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index ec07aada..98adb87f 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -1268,8 +1268,9 @@ parse_access_tech (const gchar *str)
}
GList *
-mm_3gpp_parse_cops_test_response (const gchar *reply,
- GError **error)
+mm_3gpp_parse_cops_test_response (const gchar *reply,
+ MMModemCharset cur_charset,
+ GError **error)
{
GRegex *r;
GList *info_list = NULL;
@@ -1363,6 +1364,11 @@ mm_3gpp_parse_cops_test_response (const gchar *reply,
info->operator_short = mm_get_string_unquoted_from_match_info (match_info, 3);
info->operator_code = mm_get_string_unquoted_from_match_info (match_info, 4);
+ /* The returned strings may be given in e.g. UCS2 */
+ mm_3gpp_normalize_operator (&info->operator_long, cur_charset);
+ mm_3gpp_normalize_operator (&info->operator_short, cur_charset);
+ mm_3gpp_normalize_operator (&info->operator_code, cur_charset);
+
/* Only try for access technology with UMTS-format matches.
* If none give, assume GSM */
tmp = (umts_format ?