Fix Provision Discovery Request event logic 89/105089/2 accepted/tizen/common/20161216.124346 submit/tizen/20161216.015417
authorYu Jiung <jiung.yu@samsung.com>
Thu, 15 Dec 2016 10:25:42 +0000 (19:25 +0900)
committerYu Jiung <jiung.yu@samsung.com>
Fri, 16 Dec 2016 01:49:34 +0000 (10:49 +0900)
Description : If the device is GO which sent the Invitation Request
to the peer and that peer sends the provision discovery request,
that request can't be accepted because the condition on event handler.
Replace it with checking the peer is already on the members of the
Wi-Fi Direct group.

Change-Id: I1e7636a6ab4abf51ef30ccd12215a6f115884132
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
packaging/wifi-direct-manager.spec
src/wifi-direct-event.c
src/wifi-direct-iface.c
src/wifi-direct-session.c

index f98275b..bd99d4a 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:          wifi-direct-manager
 Summary:       Wi-Fi Direct manger
-Version:       1.2.216
+Version:       1.2.217
 Release:       1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
@@ -128,6 +128,17 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=$ARCH \
        -DTIZEN_DEBUG_DBUS_VALUE=1 \
        -DTIZEN_WIFI_MODULE_BUNDLE=0 \
        -DTIZEN_PROFILE_TV=1 \
+%else
+%if "%{profile}" == "ivi"
+       -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
+       -DTIZEN_FEATURE_SERVICE_DISCOVERY=0 \
+       -DTIZEN_WLAN_CONCURRENT_ENABLE=0 \
+       -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
+       -DTIZEN_FEATURE_IP_OVER_EAPOL=1 \
+       -DCTRL_IFACE_DBUS=1 \
+       -DTIZEN_DEBUG_DBUS_VALUE=1 \
+       -DTIZEN_WIFI_MODULE_BUNDLE=1 \
+%endif
 %endif
 %endif
 %endif
index 252ca4d..c451b53 100644 (file)
@@ -320,6 +320,7 @@ void wfd_event_prov_disc_req(wfd_oem_event_s *event)
 
        wfd_manager_s *manager = wfd_get_manager();
        wfd_device_s *peer = NULL;
+       wfd_device_s *member = NULL;
        int res = 0;
        wfd_group_s *group = (wfd_group_s*) manager->group;
 
@@ -329,6 +330,15 @@ void wfd_event_prov_disc_req(wfd_oem_event_s *event)
                return;
        }
 
+       member = wfd_group_find_member_by_addr(group,  event->dev_addr);
+       if (member) {
+               /* PD request can be arrived from peer device
+                *      when connection is timeout to close connection*/
+               WDS_LOGE("Unexpected Event - Member already exist");
+               __WDS_LOG_FUNC_EXIT__;
+               return;
+       }
+
 #ifdef CTRL_IFACE_DBUS
        wfd_oem_dev_data_s *edata = NULL;
 
@@ -367,15 +377,8 @@ void wfd_event_prov_disc_req(wfd_oem_event_s *event)
                }
        }
 
-       if (peer) {
-               if (WFD_PEER_STATE_DISCOVERED < peer->state) {
-                       WDS_LOGD("Peer already connected/connecting, ignore this provision request");
-                       __WDS_LOG_FUNC_EXIT__;
-                       return;
-               }
-
+       if (peer)
                peer->state = WFD_PEER_STATE_CONNECTING;
-       }
 
        res = wfd_session_process_event(manager, event);
        if (res < 0)
index 6e684e3..d6a3c43 100644 (file)
@@ -1634,8 +1634,9 @@ static void __wfd_manager_config_iface_handler(const gchar *method_name,
                goto done;
 
        } else if (!g_strcmp0(method_name, "SetAutoConnectionPeer")) {
-               ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;
-               goto failed;
+               ret = WIFI_DIRECT_ERROR_NONE;
+               return_parameters = g_variant_new("(i)", ret);
+               goto done;
 
        } else if (!g_strcmp0(method_name, "GetInterfaceName")) {
                wfd_group_s *group = (wfd_group_s *)manager->group;
index 908baf8..5407ab4 100644 (file)
@@ -907,6 +907,11 @@ int wfd_session_process_event(wfd_manager_s *manager, wfd_oem_event_s *event)
                                break;
                        }
                        WDS_LOGD("=====> session already exist. (invitation session)");
+                       if (session->state > SESSION_STATE_WPS) {
+                               WDS_LOGE("Session already starts WPS");
+                               break;
+                       }
+
                        session->req_wps_mode = req_wps_mode;
                        session->wps_mode = event->wps_mode;
                } else {