Advertising
- openmoko-dialer2 fix
- Monday, August 27th, 2007 at 1:39:55am MDT
- --- openmoko/trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c.orig 2007-08-24 09:45:22.000000000 +0930
- +++ openmoko/trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-08-27 16:56:55.000000000 +0930
- @@ -69,8 +69,7 @@
- /* Registration variables */
- guint reg_timeout;
- - gboolean reg_request;
- - gboolean registered;
- + MokoGsmdConnectionNetregType registered;
- };
- enum
- @@ -292,8 +291,7 @@
- moko_keypad_set_pin_mode (MOKO_KEYPAD (priv->keypad), FALSE);
- - priv->reg_request = TRUE;
- - priv->registered = FALSE;
- + priv->registered = MOKO_GSMD_CONNECTION_NETREG_NONE;
- priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
- (GSourceFunc)register_network_cb,
- dialer);
- @@ -424,14 +422,14 @@
- g_return_if_fail (MOKO_IS_DIALER (dialer));
- priv = dialer->priv;
- + g_warning ("on_network_registered: type is %d\n", type);
- +
- switch (type)
- {
- case MOKO_GSMD_CONNECTION_NETREG_NONE:
- case MOKO_GSMD_CONNECTION_NETREG_SEARCHING:
- /* Do nothing */
- g_print ("NetReg: Searching for network\n");
- - g_source_remove (priv->reg_timeout);
- - priv->registered = TRUE;
- break;
- case MOKO_GSMD_CONNECTION_NETREG_DENIED:
- /* This may be a pin issue*/
- @@ -441,11 +439,12 @@
- g_print ("NetReg: Network registered\n");
- g_print("\tLocationAreaCode = %x\n\tCellID = %x\n", lac, cell);
- g_source_remove (priv->reg_timeout);
- - priv->registered = TRUE;
- break;
- default:
- g_warning ("Unhandled register event type = %d\n", type);
- };
- +
- + priv->registered = type;
- }
- static void
- @@ -619,28 +618,30 @@
- g_return_val_if_fail (MOKO_DIALER (dialer), TRUE);
- priv = MOKO_DIALER_GET_PRIVATE (dialer);
- - if (!priv->reg_request)
- + /* We check whether we've been registered yet, otherwise keep poking
- + * gsmd
- + */
- + switch (priv->registered)
- {
- - /* We have yet to request registration, so lets do it */
- - /* FIXME: do the pin stuff */
- - g_print ("Requesting registration\n");
- - moko_gsmd_connection_network_register (priv->connection);
- - }
- - else
- - {
- - /* We check whether we've been registered yet, otherwise keep poking
- - * gsmd
- - */
- - if (priv->registered)
- - {
- - g_print ("Network Registered\n");
- - return FALSE;
- - }
- - else
- - {
- + case MOKO_GSMD_CONNECTION_NETREG_NONE:
- + /* We have yet to request registration, so lets do it */
- + /* FIXME: do the pin stuff */
- g_print ("Requesting registration\n");
- moko_gsmd_connection_network_register (priv->connection);
- - }
- + break;
- + case MOKO_GSMD_CONNECTION_NETREG_SEARCHING:
- + g_print ("Waiting for registration\n");
- + break;
- + case MOKO_GSMD_CONNECTION_NETREG_DENIED:
- + g_print ("Registration denied, retrying\n");
- + moko_gsmd_connection_network_register (priv->connection);
- + break;
- + case MOKO_GSMD_CONNECTION_NETREG_HOME:
- + case MOKO_GSMD_CONNECTION_NETREG_ROAMING:
- + g_print ("Network Registered\n");
- + return FALSE;
- + default:
- + g_warning ("Unhandled register event type = %d\n", priv->registered);
- }
- return TRUE;
- @@ -754,8 +755,7 @@
- /* Handle network registration a few seconds after powering up the
- * antenna*/
- - priv->reg_request = TRUE;
- - priv->registered = FALSE;
- + priv->registered = MOKO_GSMD_CONNECTION_NETREG_NONE;
- priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
- (GSourceFunc)register_network_cb,
- dialer);
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.