NetworkManager r3696 - in trunk: . src
- From: tambeti svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3696 - in trunk: . src
- Date: Wed, 28 May 2008 15:08:52 +0000 (UTC)
Author: tambeti
Date: Wed May 28 15:08:51 2008
New Revision: 3696
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3696&view=rev
Log:
2008-05-28 Tambet Ingo <tambet gmail com>
Patch from Dennis Noordsij <dennis noordsij helsinki fi>.
* src/nm-gsm-device.c: Don't try to reset the modem before PIN is
checked, it doesn't work on some devices.
Modified:
trunk/ChangeLog
trunk/src/nm-gsm-device.c
Modified: trunk/src/nm-gsm-device.c
==============================================================================
--- trunk/src/nm-gsm-device.c (original)
+++ trunk/src/nm-gsm-device.c Wed May 28 15:08:51 2008
@@ -311,6 +311,49 @@
}
static void
+init_full_done (NMSerialDevice *device,
+ int reply_index,
+ gpointer user_data)
+{
+ gsm_device_set_pending (NM_GSM_DEVICE (device), 0);
+
+ switch (reply_index) {
+ case 0:
+ do_register (device);
+ break;
+ case -1:
+ nm_warning ("Modem second stage initialization timed out");
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ break;
+ default:
+ nm_warning ("Modem second stage initialization failed");
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ return;
+ }
+}
+
+static void
+init_modem_full (NMSerialDevice *device)
+{
+ guint id;
+ char *responses[] = { "OK", "ERROR", "ERR", NULL };
+
+ /* At this point we know that SIM has been unlocked, and we can safely
+ * initialize the modem
+ */
+ if (!nm_serial_device_send_command_string (device, "ATZ")) {
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+ return;
+ }
+
+ id = nm_serial_device_wait_for_reply (device, 10, responses, responses, init_full_done, NULL);
+ if (id)
+ gsm_device_set_pending (NM_GSM_DEVICE (device), id);
+ else
+ nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
+}
+
+static void
enter_pin_done (NMSerialDevice *device,
int reply_index,
gpointer user_data)
@@ -318,10 +361,9 @@
NMSettingGsm *setting;
gsm_device_set_pending (NM_GSM_DEVICE (device), 0);
-
switch (reply_index) {
case 0:
- do_register (device);
+ init_modem_full (device);
break;
case -1:
nm_warning ("Did not receive response for secret");
@@ -484,7 +526,6 @@
{
guint id;
char *responses[] = { "OK", "ERROR", "ERR", NULL };
-
if (!nm_serial_device_send_command_string (device, "ATZ E0")) {
nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]