Merge fixes from NetworkManager SVN.

This commit is contained in:
Tambet Ingo
2008-07-31 12:24:12 +03:00
parent c7e8eacb1c
commit fa9c303d98
2 changed files with 11 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ flash_done (MMSerial *serial, gpointer user_data)
char *responses[] = { "OK", "ERROR", "ERR", NULL }; char *responses[] = { "OK", "ERROR", "ERR", NULL };
guint id = 0; guint id = 0;
if (mm_serial_send_command_string (serial, "AT E0")) if (mm_serial_send_command_string (serial, "ATZ E0"))
id = mm_serial_wait_for_reply (serial, 10, responses, responses, init_done, user_data); id = mm_serial_wait_for_reply (serial, 10, responses, responses, init_done, user_data);
if (!id) { if (!id) {
@@ -262,10 +262,11 @@ register_auto_done (MMSerial *serial,
switch (reply_index) { switch (reply_index) {
case 0: case 0:
g_message ("Registered on Home network"); info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL,
"%s", "Automatic registration failed: not registered and not searching.");
break; break;
case 1: case 1:
g_message ("Registered on Roaming network"); g_message ("Registered on Home network");
break; break;
case 2: case 2:
mm_callback_info_set_data (info, "modem", g_object_ref (serial), g_object_unref); mm_callback_info_set_data (info, "modem", g_object_ref (serial), g_object_unref);
@@ -273,8 +274,11 @@ register_auto_done (MMSerial *serial,
return; return;
break; break;
case 3: case 3:
info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, "%s",
"%s", "Automatic registration failed: not registered and not searching."); "Automatic registration failed: registration denied");
break;
case 4:
g_message ("Registered on Roaming network");
break; break;
case -1: case -1:
info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, "%s", "Automatic registration timed out"); info->error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, "%s", "Automatic registration timed out");
@@ -290,7 +294,7 @@ register_auto_done (MMSerial *serial,
static void static void
register_auto (MMModem *modem, MMCallbackInfo *info) register_auto (MMModem *modem, MMCallbackInfo *info)
{ {
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 }; char *terminators[] = { "OK", "ERROR", "ERR", NULL };
guint id = 0; guint id = 0;

View File

@@ -746,7 +746,7 @@ mm_serial_wait_for_reply (MMSerial *self,
info->callback = callback; info->callback = callback;
info->user_data = user_data; info->user_data = user_data;
info->reply_index = -1; info->reply_index = -1;
info->timeout = timeout * 1000; info->timeout = timeout;
info->start = time (NULL); info->start = time (NULL);
return mm_serial_set_pending (self, timeout, wait_for_reply_got_data, info, wait_for_reply_done); return mm_serial_set_pending (self, timeout, wait_for_reply_got_data, info, wait_for_reply_done);