summaryrefslogtreecommitdiff
path: root/plugins/mm-modem-linktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mm-modem-linktop.c')
-rw-r--r--plugins/mm-modem-linktop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/mm-modem-linktop.c b/plugins/mm-modem-linktop.c
index 923c219..cfe0c0d 100644
--- a/plugins/mm-modem-linktop.c
+++ b/plugins/mm-modem-linktop.c
@@ -104,6 +104,11 @@ linktop_set_allowed_mode_done (MMAtSerialPort *port,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error)
info->error = g_error_copy (error);
@@ -127,7 +132,7 @@ set_allowed_mode (MMGenericGsm *gsm,
mm_callback_info_schedule (info);
return;
}
-
+
command = g_strdup_printf ("+CFUN=%d", linktop_parse_allowed_mode (mode));
mm_at_serial_port_queue_command (port, command, 3, linktop_set_allowed_mode_done, info);
g_free (command);
@@ -142,6 +147,11 @@ get_allowed_mode_done (MMAtSerialPort *port,
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
gboolean parsed = FALSE;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error)
info->error = g_error_copy (error);
else if (!g_str_has_prefix (response->str, "CFUN: ")) {