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.
This commit is contained in:
@@ -672,24 +672,33 @@ do_connect (MMModem *modem,
|
||||
Samsung_call_control (MM_MODEM_SAMSUNG_GSM (info->modem), FALSE, old_context_clear_done, info);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user