From fa45b93a8ed60784e13e5c480603d56c46dc0998 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 29 Jul 2008 20:27:09 +0000 Subject: [PATCH] 2008-07-29 Dan Williams * src/nm-gsm-device.c - (automatic_registration_response, automatic_registration): recognize denied registration and reorder responses git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3872 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 6 ++++++ src/nm-gsm-device.c | 16 +++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14292064f5..d65f901c00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-29 Dan Williams + + * src/nm-gsm-device.c + - (automatic_registration_response, automatic_registration): recognize + denied registration and reorder responses + 2008-07-29 Dan Williams * src/nm-serial-device.c diff --git a/src/nm-gsm-device.c b/src/nm-gsm-device.c index 218ddfc355..f291863901 100644 --- a/src/nm-gsm-device.c +++ b/src/nm-gsm-device.c @@ -301,22 +301,28 @@ automatic_registration_response (NMSerialDevice *device, { switch (reply_index) { case 0: - nm_info ("Registered on Home network"); - automatic_registration_get_network (NM_GSM_DEVICE (device)); + nm_warning ("Automatic registration failed: not registered and not searching."); + nm_device_state_changed (NM_DEVICE (device), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED); break; case 1: - nm_info ("Registered on Roaming network"); + nm_info ("Registered on Home network"); automatic_registration_get_network (NM_GSM_DEVICE (device)); break; case 2: NM_GSM_DEVICE_GET_PRIVATE (device)->pending_id = g_timeout_add (1000, automatic_registration_again, device); break; case 3: - nm_warning ("Automatic registration failed: not registered and not searching."); + nm_warning ("Automatic registration failed: registration denied."); nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED); break; + case 4: + nm_info ("Registered on Roaming network"); + automatic_registration_get_network (NM_GSM_DEVICE (device)); + break; case -1: nm_warning ("Automatic registration timed out"); nm_device_state_changed (NM_DEVICE (device), @@ -335,7 +341,7 @@ automatic_registration_response (NMSerialDevice *device, static void automatic_registration (NMGsmDevice *device) { - char *responses[] = { "+CREG: 0,1", "+CREG: 0,5", "+CREG: 0,2", "+CREG: 0,0", NULL }; + char *responses[] = { "+CREG: 0,0", "+CREG: 0,1", "+CREG: 0,2", "+CREG: 0,3", "+CREG: 0,5", NULL }; char *terminators[] = { "OK", "ERROR", "ERR", NULL }; modem_wait_for_reply (device, "AT+CREG?", 60, responses, terminators, automatic_registration_response);