Timeout for searching modem
authoradre.chang <adre.chang@samsung.com>
Tue, 4 Sep 2012 11:49:47 +0000 (20:49 +0900)
committeradre.chang <adre.chang@samsung.com>
Tue, 4 Sep 2012 11:50:51 +0000 (20:50 +0900)
Signed-off-by: adre.chang <adre.chang@samsung.com>
Change-Id: I59921e77160aeaaac3cd642de4c86539707dfa9c

src/desc-imcmodem.c
src/vnet.c

index 168f87def2df441228d36bd096d0648517267a3a..7a60133e6b97c9623d259141edfd5b5ac1c9269d 100755 (executable)
@@ -224,20 +224,16 @@ static gboolean _do_exception_operation( TcoreHal *h, int fd, GIOCondition con )
        return TRUE;
 }
 
-static TReturn hal_power(TcoreHal *h, gboolean flag)
+static gboolean _power_on( gpointer data )
 {
-       //TcorePlugin *p = 0;
        struct custom_data *user_data = 0;
-
+       TcoreHal *h = (TcoreHal*)data;
        gboolean ret = 0;
 
        user_data = tcore_hal_ref_user_data(h);
-       if (!user_data)
-               return TCORE_RETURN_FAILURE;
-
-       if (flag == FALSE) {
-               /* power off not support */
-               return TCORE_RETURN_FAILURE;
+       if (!user_data) {
+               dbg("[ error ] tcore_hal_ref_user_data()");
+               return FALSE;
        }
 
        ret = _ipc0_init( h, &user_data->ipc0, on_recv_ipc_message );
@@ -246,6 +242,18 @@ static TReturn hal_power(TcoreHal *h, gboolean flag)
 
        tcore_hal_set_power_state(h, TRUE);
 
+       return FALSE;
+}
+
+static TReturn hal_power(TcoreHal *h, gboolean flag)
+{
+       if (flag == FALSE) {
+               /* power off not support */
+               return TCORE_RETURN_FAILURE;
+       }
+
+       g_timeout_add_full( G_PRIORITY_HIGH, 500, _power_on, h, 0 );
+
        return TCORE_RETURN_SUCCESS;
 }
 
index 09f9d50cae747c977d41394d261d7d817cdcf47c..4255131746130dc566aaadc12f82c78ddfbe38ee 100755 (executable)
@@ -142,7 +142,7 @@ int vnet_ipc0_open()
                        break ;
                }
 
-               if ( ++cnt > 1000 )
+               if ( ++cnt > 20 )
                        return -1;
        }