Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

openmoko-dialer2 fix
Monday, August 27th, 2007 at 7:39:55am UTC 

  1. --- openmoko/trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c.orig    2007-08-24 09:45:22.000000000 +0930
  2. +++ openmoko/trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c 2007-08-27 16:56:55.000000000 +0930
  3. @@ -69,8 +69,7 @@
  4.  
  5.    /* Registration variables */
  6.    guint               reg_timeout;
  7. -  gboolean            reg_request;
  8. -  gboolean            registered;
  9. +  MokoGsmdConnectionNetregType registered;
  10.  };
  11.  
  12.  enum
  13. @@ -292,8 +291,7 @@
  14.  
  15.    moko_keypad_set_pin_mode (MOKO_KEYPAD (priv->keypad), FALSE);
  16.  
  17. -  priv->reg_request = TRUE;
  18. -  priv->registered = FALSE;
  19. +  priv->registered = MOKO_GSMD_CONNECTION_NETREG_NONE;
  20.    priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
  21.                                       (GSourceFunc)register_network_cb,
  22.                                       dialer);
  23. @@ -424,14 +422,14 @@
  24.    g_return_if_fail (MOKO_IS_DIALER (dialer));
  25.    priv = dialer->priv;
  26.  
  27. +  g_warning ("on_network_registered: type is %d\n", type);
  28. +
  29.    switch (type)
  30.    {
  31.      case MOKO_GSMD_CONNECTION_NETREG_NONE:
  32.      case MOKO_GSMD_CONNECTION_NETREG_SEARCHING:
  33.        /* Do nothing */
  34.        g_print ("NetReg: Searching for network\n");
  35. -      g_source_remove (priv->reg_timeout);
  36. -      priv->registered = TRUE;
  37.        break;
  38.      case MOKO_GSMD_CONNECTION_NETREG_DENIED:
  39.        /* This may be a pin issue*/
  40. @@ -441,11 +439,12 @@
  41.        g_print ("NetReg: Network registered\n");
  42.        g_print("\tLocationAreaCode = %x\n\tCellID = %x\n", lac, cell);
  43.        g_source_remove (priv->reg_timeout);
  44. -      priv->registered = TRUE;
  45.        break;
  46.      default:
  47.        g_warning ("Unhandled register event type = %d\n", type);
  48.     };
  49. +
  50. +  priv->registered = type;
  51.  }
  52.  
  53.  static void
  54. @@ -619,28 +618,30 @@
  55.    g_return_val_if_fail (MOKO_DIALER (dialer), TRUE);
  56.    priv = MOKO_DIALER_GET_PRIVATE (dialer);
  57.  
  58. -  if (!priv->reg_request)
  59. +  /* We check whether we've been registered yet, otherwise keep poking
  60. +   * gsmd
  61. +   */
  62. +  switch (priv->registered)
  63.    {
  64. -    /* We have yet to request registration, so lets do it */
  65. -    /* FIXME: do the pin stuff */
  66. -    g_print ("Requesting registration\n");
  67. -    moko_gsmd_connection_network_register (priv->connection);
  68. }
  69. -  else
  70. {
  71. -    /* We check whether we've been registered yet, otherwise keep poking
  72. -     * gsmd
  73. -     */
  74. -    if (priv->registered)
  75. -    {
  76. -      g_print ("Network Registered\n");
  77. -      return FALSE;
  78. -    }
  79. -    else
  80. -    {
  81. +    case MOKO_GSMD_CONNECTION_NETREG_NONE:
  82. +      /* We have yet to request registration, so lets do it */
  83. +      /* FIXME: do the pin stuff */
  84.        g_print ("Requesting registration\n");
  85.        moko_gsmd_connection_network_register (priv->connection);
  86. -    }
  87. +      break;
  88. +    case MOKO_GSMD_CONNECTION_NETREG_SEARCHING:
  89. +      g_print ("Waiting for registration\n");
  90. +      break;
  91. +    case MOKO_GSMD_CONNECTION_NETREG_DENIED:
  92. +      g_print ("Registration denied, retrying\n");
  93. +      moko_gsmd_connection_network_register (priv->connection);
  94. +      break;
  95. +    case MOKO_GSMD_CONNECTION_NETREG_HOME:
  96. +    case MOKO_GSMD_CONNECTION_NETREG_ROAMING:
  97. +      g_print ("Network Registered\n");
  98. +       return FALSE;
  99. +    default:
  100. +      g_warning ("Unhandled register event type = %d\n", priv->registered);
  101.    }
  102.  
  103.    return TRUE;
  104. @@ -754,8 +755,7 @@
  105.  
  106.    /* Handle network registration a few seconds after powering up the
  107.     * antenna*/
  108. -  priv->reg_request = TRUE;
  109. -  priv->registered = FALSE;
  110. +  priv->registered = MOKO_GSMD_CONNECTION_NETREG_NONE;
  111.    priv->reg_timeout = g_timeout_add (GSM_REGISTER_TIMEOUT,
  112.                                       (GSourceFunc)register_network_cb,
  113.                                       dialer);

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

comments powered by Disqus