Emit Failed Signal in case of connect failure 07/190507/1 accepted/tizen/unified/20181115.151609 submit/tizen/20181115.005500
authorShagun Garg <shagun1.garg@samsung.com>
Wed, 3 Oct 2018 06:35:42 +0000 (12:05 +0530)
committerShagun Garg <shagun1.garg@samsung.com>
Wed, 3 Oct 2018 06:42:57 +0000 (12:12 +0530)
This patch Emits Connect response signal with status "WIFI_DIRECT_ERROR_OPERATION_FAILED" in case wfd_manager_connect() call fails.
Therefore, application is aware of status of connection request.

Signed-off-by: Shagun Garg <shagun1.garg@samsung.com>
Change-Id: Ibe102a1ebefa97d7137f26c5399558d5df56de08

src/wifi-direct-method.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 1246633..fcb6b0b
@@ -337,12 +337,19 @@ void connect_handler(GVariant *parameters, void *dest)
 
        macaddr_atoe(peer_mac_address, mac_addr);
        ret = wfd_manager_connect(manager, mac_addr);
-       if (ret == WIFI_DIRECT_ERROR_NONE)
+       if (ret == WIFI_DIRECT_ERROR_NONE) {
                wfd_manager_dbus_emit_signal(WFD_MANAGER_MANAGE_INTERFACE,
                                             "Connection",
                                             g_variant_new("(iis)", WIFI_DIRECT_ERROR_NONE,
                                                                    WFD_EVENT_CONNECTION_IN_PROGRESS,
                                                                    peer_mac_address));
+       } else {
+               wfd_manager_dbus_emit_signal(WFD_MANAGER_MANAGE_INTERFACE,
+                                                "Connection",
+                                                g_variant_new("(iis)", WIFI_DIRECT_ERROR_OPERATION_FAILED,
+                                                                       WFD_EVENT_CONNECTION_RSP,
+                                                                       peer_mac_address));
+       }
 
        __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
        return;