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.
This commit is contained in:
Dan Williams
2010-03-10 10:58:27 -08:00
parent 611e832d0e
commit b7858ba235

View File

@@ -48,13 +48,27 @@ mm_modem_novatel_gsm_new (const char *device,
/* Modem class override functions */ /* Modem class override functions */
/*****************************************************************************/ /*****************************************************************************/
static void
dmat_callback2 (MMSerialPort *port,
GString *response,
GError *error,
gpointer user_data)
{
mm_serial_port_close (port);
}
static void static void
dmat_callback (MMSerialPort *port, dmat_callback (MMSerialPort *port,
GString *response, GString *response,
GError *error, GError *error,
gpointer user_data) 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 static gboolean