[TDLS] Return proper error code in TDLS disconnect operation 81/245481/1
authorNishant Chaprana <n.chaprana@samsung.com>
Fri, 9 Oct 2020 13:36:47 +0000 (19:06 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Fri, 9 Oct 2020 13:48:07 +0000 (19:18 +0530)
Change-Id: I2fc0391a500912a49157c0de014b5f85f615ab15
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_dbus.c

index 44531ce..0884437 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.2.4
+Version:       1.2.5
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 2e5e6c7..728bde9 100755 (executable)
@@ -2940,7 +2940,13 @@ int _net_dbus_tdls_disconnect(network_info_s *network_info, const char* peer_mac
        WIFI_LOG(WIFI_INFO, "[%s] success", method);
        WIFI_LOG(WIFI_INFO, ", status [%d]", ret);
 
-       if (ret)
+       /**
+        * Below are the expected error codes
+        * 0x00 - NETCONFIG_ERROR_TDLS_NO_ERROR
+        * 0x01 - NETCONFIG_ERROR_INTERNAL
+        * 0x04 - NETCONFIG_ERROR_TDLS_ALREADY_DONE
+        */
+       if (ret == 0x00 || ret == 0x04)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
@@ -3017,7 +3023,12 @@ int _net_dbus_tdls_connect(network_info_s *network_info, const char *peer_mac_ad
        WIFI_LOG(WIFI_INFO, "[%s] success", method);
        WIFI_LOG(WIFI_INFO, ", status [%d]", ret);
 
-       if (ret)
+       /**
+        * Below are the expected error codes
+        * 0x00 - NETCONFIG_ERROR_TDLS_NO_ERROR
+        * 0x01 - NETCONFIG_ERROR_INTERNAL
+        */
+       if (ret == 0x00)
                Error = NET_ERR_NONE;
        else
                Error = NET_ERR_UNKNOWN;
@@ -3057,11 +3068,17 @@ int _net_dbus_tdls_discover(network_info_s *network_info, const char *peer_mac_a
        WIFI_LOG(WIFI_INFO, "[%s] success", method);
        WIFI_LOG(WIFI_INFO, ", status [%d]", ret);
 
+       /**
+        * Below are the expected error codes
+        * 0x00 - NETCONFIG_ERROR_TDLS_NO_ERROR
+        * 0x01 - NETCONFIG_ERROR_INTERNAL
+        * 0x04 - NETCONFIG_ERROR_TDLS_ALREADY_DONE
+        */
        if (ret == 0x00)
                Error = NET_ERR_NONE;
        else if (ret == 0x01)
                Error = NET_ERR_FAIL_TDLS_DISCOVER;
-       else if (ret == 0x04) /*0x04: TDLS Discovery in Progress at lower layer*/
+       else if (ret == 0x04) /* 0x04: TDLS Discovery in Progress at lower layer */
                Error = NET_ERR_IN_PROGRESS;
        else
                Error = NET_ERR_UNKNOWN;