From e79cf9c0d726fd624b61230b009a89aee3cc13f2 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 25 Dec 2014 12:51:38 +0100 Subject: [PATCH] =?UTF-8?q?nokia:=2020s=20for=20CSCS=3D=3F=20test=20comman?= =?UTF-8?q?d?= Nokia N9 via Bluetooth DUN requires up to 20s for the supported charsets query; so update the timeout in the Nokia plugin. https://bugs.freedesktop.org/show_bug.cgi?id=87635 https://bugzilla.gnome.org/show_bug.cgi?id=741813 --- plugins/nokia/mm-broadband-modem-nokia.c | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/plugins/nokia/mm-broadband-modem-nokia.c b/plugins/nokia/mm-broadband-modem-nokia.c index 21e76dd..7b1438c 100644 --- a/plugins/nokia/mm-broadband-modem-nokia.c +++ b/plugins/nokia/mm-broadband-modem-nokia.c @@ -184,6 +184,43 @@ load_access_technologies (MMIfaceModem *self, } /*****************************************************************************/ +/* Loading supported charsets (Modem interface) */ + +static MMModemCharset +load_supported_charsets_finish (MMIfaceModem *self, + GAsyncResult *res, + GError **error) +{ + const gchar *response; + MMModemCharset charsets = MM_MODEM_CHARSET_UNKNOWN; + + response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error); + if (!response) + return MM_MODEM_CHARSET_UNKNOWN; + + if (!mm_3gpp_parse_cscs_test_response (response, &charsets)) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Failed to parse the supported character sets response"); + return MM_MODEM_CHARSET_UNKNOWN; + } + + return charsets; +} + +static void +load_supported_charsets (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + mm_base_modem_at_command (MM_BASE_MODEM (self), + "+CSCS=?", + 20, + TRUE, + callback, + user_data); +} + +/*****************************************************************************/ /* Initializing the modem (during first enabling) */ typedef struct { @@ -367,6 +404,8 @@ iface_modem_init (MMIfaceModem *iface) iface->modem_power_up_finish = NULL; iface->modem_power_down = NULL; iface->modem_power_down_finish = NULL; + iface->load_supported_charsets = load_supported_charsets; + iface->load_supported_charsets_finish = load_supported_charsets_finish; iface->load_access_technologies = load_access_technologies; iface->load_access_technologies_finish = load_access_technologies_finish; -- 2.2.1