aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2011-03-27 16:01:10 -0500
committerDan Williams <dcbw@redhat.com>2011-03-27 16:01:10 -0500
commit29b7ac3ddb17619a101d8bdb989286e786c3b475 (patch)
tree32c1a427868b22a2f7ac8ddeb7f3eab04bf0c906
parent4b15737f8d3e5f96bc6c59f3735754800bd8b246 (diff)
samsung: fix up disconnect
Two issues here, first we dont' need to chain up to the parent because it's not doing anything we need (it's mainly for PPP-based devices) and second we need to wait a bit for the disconnect command to complete by specifying a callback, otherwise the command may get discarded when the port is shut down afterward.
-rwxr-xr-xplugins/mm-modem-samsung-gsm.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/mm-modem-samsung-gsm.c b/plugins/mm-modem-samsung-gsm.c
index effd0f75..6566b0fe 100755
--- a/plugins/mm-modem-samsung-gsm.c
+++ b/plugins/mm-modem-samsung-gsm.c
@@ -673,23 +673,32 @@ do_connect (MMModem *modem,
}
static void
+disconnect_ipdpact_done (MMAtSerialPort *port,
+ GString *response,
+ GError *error,
+ gpointer user_data)
+{
+ mm_callback_info_schedule ((MMCallbackInfo *) user_data);
+}
+
+static void
do_disconnect (MMGenericGsm *gsm,
gint cid,
MMModemFn callback,
gpointer user_data)
{
+ MMCallbackInfo *info;
MMAtSerialPort *primary;
char *command;
+ info = mm_callback_info_new (MM_MODEM (gsm), callback, user_data);
+
primary = mm_generic_gsm_get_at_port (gsm, MM_PORT_TYPE_PRIMARY);
g_assert (primary);
command = g_strdup_printf ("AT%%IPDPACT=%d,0", cid);
-
- mm_at_serial_port_queue_command (primary, command, 3, NULL, NULL);
+ mm_at_serial_port_queue_command (primary, command, 3, disconnect_ipdpact_done, info);
g_free (command);
-
- MM_GENERIC_GSM_CLASS (mm_modem_samsung_gsm_parent_class)->do_disconnect (gsm, cid, callback, user_data);
}
static void