Fix bug N_SE-30232(Retry connection during 120 secs)
authorKim Gibyoung <lastkgb.kim@samsung.com>
Fri, 29 Mar 2013 12:48:21 +0000 (21:48 +0900)
committerKim Gibyoung <lastkgb.kim@samsung.com>
Fri, 29 Mar 2013 12:48:21 +0000 (21:48 +0900)
Change-Id: Ia7013712b8ebac91d3361276314f58772988ac0c

debian/changelog
packaging/wifi-direct-manager.spec
plugin/wpasupplicant/src/wifi-direct-plugin.c
src/include/wifi-direct-event-handler.h
src/include/wifi-direct-service.h
src/wifi-direct-event-handler.c
src/wifi-direct-main.c

index 28640b5..63e5033 100644 (file)
@@ -1,3 +1,11 @@
+wfi-direct-manager (0.6.13) precise; urgency=low
+
+  * Flush discovered peer data when starting new scan
+  * Git : framework/connectivity/wifi-direct-manager
+  * Tag : wifi-direct-manager_0.6.13
+
+ -- Gibyoung Kim <lastkgb.kim@samsung.com>  Fri, 29 Mar 2013 21:46:28 +0900
+
 wfi-direct-manager (0.6.12) precise; urgency=low
 
   * Flush discovered peer data when starting new scan
index 114d65f..2138706 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wifi-direct-manager
 Summary:    Wi-Fi Direct manger
-Version:    0.6.12
+Version:    0.6.13
 Release:    1
 Group:      TO_BE_FILLED
 License:    Apache License Version 2.0
index 5c5fdef..e6fa962 100644 (file)
@@ -1157,7 +1157,11 @@ void __parsing_ws_event(char* buf, ws_event_s *event)
                case WS_EVENT_GO_NEG_FAILURE:
                        {
                                WDP_LOGD("WS EVENT : [WS_EVENT_GO_NEG_FAILURE]");
+                               char status[16] = {0, };
                                event->id = WS_EVENT_GO_NEG_FAILURE;
+                               ptr = __extract_value_str(ptr, "status", status);
+                               event->msg = atoi(status);
+                               WDP_LOGD("Status [%d]", event->msg);
                        }
                break;
 
@@ -1806,6 +1810,10 @@ static gboolean __ws_event_callback(GIOChannel * source,
 
                case WS_EVENT_GO_NEG_FAILURE:
                        {
+                               if (event.msg == -1) {
+                                       g_noti_cb(WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT);
+                                       break;
+                               }
                                wfd_ws_cancel();
                                wfd_ws_flush();
                                g_noti_cb(WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL);
index ee877bb..9782eb7 100644 (file)
@@ -55,6 +55,7 @@ typedef enum {
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_COMPLETE,
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_ALREADY_CONNECTED,
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL,
+       WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT,
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_NO_PROV_INFO,
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_INFO_UNAVAIL,
        WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_INTENT,
index d1dafcb..a2d943b 100755 (executable)
@@ -97,6 +97,7 @@ typedef struct
        wfd_config_data_s       config_data;
 
        wifi_direct_state_e     state;
+       int connecting_120;
 
        wfd_discovery_entry_s current_peer;   // it is used during connecting/disconnecting
 
index 727b4f4..d4460a3 100644 (file)
@@ -601,10 +601,24 @@ void wfd_server_process_event(wfd_event_t event)
                        //case WFD_EVENT_GROUP_OWNER_NEGOTIATION_INFO_UNAVAIL:\r
                case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL:\r
                case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_INTENT:\r
+               case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT:\r
                case WFD_EVENT_WPS_WRONG_PIN:\r
                case WFD_EVENT_WPS_TIMEOUT:\r
                case WFD_EVENT_WPS_SESSION_OVERLAP:\r
                case WFD_EVENT_CREATE_LINK_CANCEL:\r
+                       if (event == WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT) {\r
+                               if (wfd_server->connecting_120) {\r
+                                       int wps_config = wfd_server->config_data.wps_config;\r
+\r
+                                       if (wfd_server->config_data.want_persistent_group == true)\r
+                                               wfd_oem_connect_for_persistent_group(wfd_server->current_peer.mac_address, wps_config);\r
+                                       else\r
+                                               wfd_oem_connect(wfd_server->current_peer.mac_address, wps_config);\r
+                                       WDS_LOGD("Retry connection with " MACSTR, MAC2STR(wfd_server->current_peer.mac_address));\r
+                                       break;\r
+                               }\r
+                       }\r
+\r
                        if (wfd_oem_is_groupowner())\r
                        {\r
                                wfd_server_set_state(WIFI_DIRECT_STATE_GROUP_OWNER);\r
index 914acf0..4cadcd0 100644 (file)
@@ -389,7 +389,7 @@ static gboolean wfd_connection_timeout_cb(void *user_data)
 
        g_source_remove(wfd_server->connection_timer);
        wfd_server->connection_timer = 0;
-
+       wfd_server->connecting_120 = 0;
 
        if (wfd_oem_is_groupowner())
        {
@@ -428,8 +428,6 @@ static gboolean wfd_connection_timeout_cb(void *user_data)
 #endif
 
        memset(&noti, 0, sizeof(wifi_direct_client_noti_s));
-
-
        snprintf(noti.param1, sizeof(noti.param1),MACSTR, MAC2STR(wfd_server->current_peer.mac_address));
 
        noti.event = WIFI_DIRECT_CLI_EVENT_CONNECTION_RSP;
@@ -454,6 +452,7 @@ void wfd_timer_connection_start()
                g_source_remove(wfd_server->connection_timer);
 
        wfd_server->connection_timer = 0;
+       wfd_server->connecting_120 = 1;
 
        wfd_server->connection_timer = g_timeout_add(120000 /* 120 seconds*/, (GSourceFunc)wfd_connection_timeout_cb , NULL);