From 97ea7dca8a319f287ed355d43f33581f69827ccc Mon Sep 17 00:00:00 2001 From: Nathan Williams Date: Thu, 12 May 2011 15:23:33 -0400 Subject: [PATCH] samsung: split initialization sequence to ensure echo is off Split the Samsung initialization sequence from "ATZ E0 V1" to "ATZ" and "ATE0 V1" - the modem is allowed to ignore the rest of the line after Z, so echoing was not being turned off, leading to getting "AT+CIMI\n\n" as part of the IMSI when it is retrieved at startup. Chromium: Change-Id: Icfd767174e779e472f8cde419acb163128e4715d --- plugins/mm-modem-samsung-gsm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/mm-modem-samsung-gsm.c b/plugins/mm-modem-samsung-gsm.c index 4902e0af..0f63e03f 100755 --- a/plugins/mm-modem-samsung-gsm.c +++ b/plugins/mm-modem-samsung-gsm.c @@ -504,6 +504,21 @@ init_done (MMAtSerialPort *port, } } +static void +init_reset_done (MMAtSerialPort *port, + GString *response, + GError *error, + gpointer user_data) +{ + MMCallbackInfo *info = (MMCallbackInfo *) user_data; + MMModemSamsungGsm *self = MM_MODEM_SAMSUNG_GSM (info->modem); + + if (error) + mm_generic_gsm_enable_complete (MM_GENERIC_GSM (self), error, info); + else + mm_at_serial_port_queue_command (port, "E0 V1", 3, init_done, info); +} + static void do_enable (MMGenericGsm *modem, MMModemFn callback, gpointer user_data) { @@ -514,7 +529,7 @@ do_enable (MMGenericGsm *modem, MMModemFn callback, gpointer user_data) primary = mm_generic_gsm_get_at_port (modem, MM_PORT_TYPE_PRIMARY); g_assert (primary); - mm_at_serial_port_queue_command (primary, "Z E0 V1", 3, init_done, info); + mm_at_serial_port_queue_command (primary, "Z", 3, init_reset_done, info); } static void