aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-03-10 10:58:27 -0800
committerDan Williams <dcbw@redhat.com>2010-03-10 10:58:27 -0800
commitb7858ba235c046a514fbc79e18ac9faa75982032 (patch)
tree6b7506a5de39004d01157acd8e15e0404308d0cb
parent611e832d0ed509f862c8ab047cd8faca98f5aec9 (diff)
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.
-rw-r--r--plugins/mm-modem-novatel-gsm.c16
1 files changed, 15 insertions, 1 deletions
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
@@ -49,12 +49,26 @@ mm_modem_novatel_gsm_new (const char *device,
/*****************************************************************************/
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