diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-25 21:39:44 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-04-02 10:06:07 +0200 |
commit | f824602bdd922cdc9e15aa83fda545534c0b0542 (patch) | |
tree | ec4485609e19353f559e5b03f365d8d6b7dc3349 /plugins | |
parent | 822bfa4ca163ef17a0fc60d03bfae462091885bf (diff) |
modem-helpers: if operator not in UCS2, see if already valid UTF-8
The method doing the operator name normalization takes as input the
current configured modem charset. If this is UCS2, we will now just
assume this is a hint: the string may or may not come in hex/UCS2.
This logic makes the custom operator name loading in Huawei unneeded,
if the modem is configured in UCS2, we still properly process operator
names coming in plain ASCII.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 49c77e9a..cf22b0d5 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -2172,55 +2172,6 @@ modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *self, } /*****************************************************************************/ -/* Operator Name loading (3GPP interface) */ - -static gchar * -modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self, - GAsyncResult *res, - GError **error) -{ - const gchar *result; - 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. - */ - mm_3gpp_normalize_operator_name (&operator_name, MM_MODEM_CHARSET_IRA); - if (operator_name) - mm_dbg ("loaded Operator Name: %s", operator_name); - - return operator_name; -} - -static void -modem_3gpp_load_operator_name (MMIfaceModem3gpp *self, - GAsyncReadyCallback callback, - gpointer user_data) -{ - mm_dbg ("loading Operator Name (huawei)..."); - mm_base_modem_at_command (MM_BASE_MODEM (self), - "+COPS=3,0;+COPS?", - 3, - FALSE, - callback, - user_data); -} - -/*****************************************************************************/ /* Create Bearer (Modem interface) */ typedef struct { @@ -4603,8 +4554,6 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface) iface->enable_unsolicited_events_finish = modem_3gpp_enable_unsolicited_events_finish; iface->disable_unsolicited_events = modem_3gpp_disable_unsolicited_events; iface->disable_unsolicited_events_finish = modem_3gpp_disable_unsolicited_events_finish; - iface->load_operator_name = modem_3gpp_load_operator_name; - iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish; } static void |