diff options
author | Dan Williams <dcbw@redhat.com> | 2011-07-06 13:13:41 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-07-06 15:49:34 -0500 |
commit | 46d757faa768db7d7bb23d51cc2af3196f7a7e30 (patch) | |
tree | 1f84364d988486f496b849374cc056389cc10d38 | |
parent | 2ca045f1781095ed652bc01d0f47cdbe6b0b9775 (diff) |
gsm: send init command twice to make the N900 happy (rh #583691) (lp:765516)
The N900 has some odd serial characteristics in that it appears to
send pieces of the commands back for whatever reason, until you've sent
a few commands down to it. Almost like it's training on whatever
you send and needs a bit of input to figure out the characteristics.
Whatever. Just send the init command twice instead of failing when
the N900 barfs the first time.
-rw-r--r-- | src/mm-generic-gsm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index c8cf7db4..c5c5969a 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -1614,7 +1614,13 @@ enable_flash_done (MMSerialPort *port, GError *error, gpointer user_data) return; } + /* Send the init command twice; some devices (Nokia N900) appear to take a + * few commands before responding correctly. Instead of penalizing them for + * being stupid the first time by failing to enable the device, just + * try again. + */ g_object_get (G_OBJECT (info->modem), MM_GENERIC_GSM_INIT_CMD, &cmd, NULL); + mm_at_serial_port_queue_command (MM_AT_SERIAL_PORT (port), cmd, 3, NULL, NULL); mm_at_serial_port_queue_command (MM_AT_SERIAL_PORT (port), cmd, 3, init_done, user_data); g_free (cmd); } |