r2705 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src
njp at sita.openmoko.org
njp at sita.openmoko.org
Wed Aug 15 15:26:58 CEST 2007
Author: njp
Date: 2007-08-15 15:26:57 +0200 (Wed, 15 Aug 2007)
New Revision: 2705
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
Log:
2007-08-15 Neil J. Patel <njp at o-hand.com>
* src/moko-dialer.c: (on_keypad_pin_entry),
(on_network_registered), (moko_dialer_init):
Check for registration type, and take the right action.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-08-15 12:41:06 UTC (rev 2704)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-08-15 13:26:57 UTC (rev 2705)
@@ -1,5 +1,11 @@
2007-08-15 Neil J. Patel <njp at o-hand.com>
+ * src/moko-dialer.c: (on_keypad_pin_entry),
+ (on_network_registered), (moko_dialer_init):
+ Check for registration type, and take the right action.
+
+2007-08-15 Neil J. Patel <njp at o-hand.com>
+
* src/moko-dialer.c: (on_network_registered):
Print the type of registration information.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-08-15 12:41:06 UTC (rev 2704)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-08-15 13:26:57 UTC (rev 2705)
@@ -68,6 +68,7 @@
MokoTime *time;
/* Registration variables */
+ guint reg_timeout;
gboolean reg_request;
gboolean registered;
};
@@ -295,9 +296,9 @@
priv->reg_request = TRUE;
priv->registered = FALSE;
- g_timeout_add (GSM_REGISTER_TIMEOUT,
- (GSourceFunc)register_network_cb,
- dialer);
+ priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
+ (GSourceFunc)register_network_cb,
+ dialer);
}
@@ -417,9 +418,25 @@
g_return_if_fail (MOKO_IS_DIALER (dialer));
priv = dialer->priv;
- g_print ("Register type = %d\n");
-
- priv->registered = TRUE;
+ switch (type)
+ {
+ case MOKO_GSMD_CONNECTION_NETREG_NONE:
+ case MOKO_GSMD_CONNECTION_NETREG_SEARCHING:
+ /* Do nothing */
+ break;
+ case MOKO_GSMD_CONNECTION_NETREG_DENIED:
+ /* This may be a pin issue*/
+ g_print ("Registration denied, the SIM pin may need to be entered\n");
+ moko_keypad_set_pin_mode (MOKO_KEYPAD (priv->keypad), TRUE);
+ g_source_remove (priv->reg_timeout);
+ break;
+ case MOKO_GSMD_CONNECTION_NETREG_HOME:
+ case MOKO_GSMD_CONNECTION_NETREG_ROAMING:
+ priv->registered = TRUE;
+ break;
+ default:
+ g_warning ("Unhandled register event type = %d\n", type);
+ };
}
static void
@@ -727,9 +744,9 @@
* antenna*/
priv->reg_request = TRUE;
priv->registered = FALSE;
- g_timeout_add (GSM_REGISTER_TIMEOUT,
- (GSourceFunc)register_network_cb,
- dialer);
+ priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
+ (GSourceFunc)register_network_cb,
+ dialer);
/* Connect to the gsmd signals */
g_signal_connect (G_OBJECT (conn), "network-registration",
More information about the commitlog
mailing list