From: Kim Gibyoung Date: Fri, 29 Mar 2013 12:48:21 +0000 (+0900) Subject: Fix bug N_SE-30232(Retry connection during 120 secs) X-Git-Tag: 2.1b_release~5^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=663cd1a19f2cd96135aa5924a2b6f1476164af9c;p=platform%2Fcore%2Fconnectivity%2Fwifi-direct-manager.git Fix bug N_SE-30232(Retry connection during 120 secs) Change-Id: Ia7013712b8ebac91d3361276314f58772988ac0c --- diff --git a/debian/changelog b/debian/changelog index 28640b5..63e5033 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/packaging/wifi-direct-manager.spec b/packaging/wifi-direct-manager.spec index 114d65f..2138706 100755 --- a/packaging/wifi-direct-manager.spec +++ b/packaging/wifi-direct-manager.spec @@ -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 diff --git a/plugin/wpasupplicant/src/wifi-direct-plugin.c b/plugin/wpasupplicant/src/wifi-direct-plugin.c index 5c5fdef..e6fa962 100644 --- a/plugin/wpasupplicant/src/wifi-direct-plugin.c +++ b/plugin/wpasupplicant/src/wifi-direct-plugin.c @@ -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); diff --git a/src/include/wifi-direct-event-handler.h b/src/include/wifi-direct-event-handler.h index ee877bb..9782eb7 100644 --- a/src/include/wifi-direct-event-handler.h +++ b/src/include/wifi-direct-event-handler.h @@ -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, diff --git a/src/include/wifi-direct-service.h b/src/include/wifi-direct-service.h index d1dafcb..a2d943b 100755 --- a/src/include/wifi-direct-service.h +++ b/src/include/wifi-direct-service.h @@ -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 diff --git a/src/wifi-direct-event-handler.c b/src/wifi-direct-event-handler.c index 727b4f4..d4460a3 100644 --- a/src/wifi-direct-event-handler.c +++ b/src/wifi-direct-event-handler.c @@ -601,10 +601,24 @@ void wfd_server_process_event(wfd_event_t event) //case WFD_EVENT_GROUP_OWNER_NEGOTIATION_INFO_UNAVAIL: case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL: case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_INTENT: + case WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT: case WFD_EVENT_WPS_WRONG_PIN: case WFD_EVENT_WPS_TIMEOUT: case WFD_EVENT_WPS_SESSION_OVERLAP: case WFD_EVENT_CREATE_LINK_CANCEL: + if (event == WFD_EVENT_GROUP_OWNER_NEGOTIATION_FAIL_TIMEOUT) { + if (wfd_server->connecting_120) { + int wps_config = wfd_server->config_data.wps_config; + + if (wfd_server->config_data.want_persistent_group == true) + wfd_oem_connect_for_persistent_group(wfd_server->current_peer.mac_address, wps_config); + else + wfd_oem_connect(wfd_server->current_peer.mac_address, wps_config); + WDS_LOGD("Retry connection with " MACSTR, MAC2STR(wfd_server->current_peer.mac_address)); + break; + } + } + if (wfd_oem_is_groupowner()) { wfd_server_set_state(WIFI_DIRECT_STATE_GROUP_OWNER); diff --git a/src/wifi-direct-main.c b/src/wifi-direct-main.c index 914acf0..4cadcd0 100644 --- a/src/wifi-direct-main.c +++ b/src/wifi-direct-main.c @@ -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(¬i, 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);