From b7858ba235c046a514fbc79e18ac9faa75982032 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Mar 2010 10:58:27 -0800 Subject: [PATCH] novatel: fix GSM secondary port enabling after PIN changes With the PIN changes, the primary port would already be closed by the time the Novatel modem class was able to send the DMAT command to enable the secondary ports. Just try again later. --- plugins/mm-modem-novatel-gsm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/mm-modem-novatel-gsm.c b/plugins/mm-modem-novatel-gsm.c index 4a846269..c8c28d1f 100644 --- a/plugins/mm-modem-novatel-gsm.c +++ b/plugins/mm-modem-novatel-gsm.c @@ -48,13 +48,27 @@ mm_modem_novatel_gsm_new (const char *device, /* Modem class override functions */ /*****************************************************************************/ +static void +dmat_callback2 (MMSerialPort *port, + GString *response, + GError *error, + gpointer user_data) +{ + mm_serial_port_close (port); +} + static void dmat_callback (MMSerialPort *port, GString *response, GError *error, gpointer user_data) { - mm_serial_port_close (port); + if (error) { + /* Try it again */ + if (mm_serial_port_open (port, NULL)) + mm_serial_port_queue_command (port, "$NWDMAT=1", 2, dmat_callback2, NULL); + } else + mm_serial_port_close (port); } static gboolean