Return proper error code in TDLS disconnect operation 44/247744/1
authorNishant Chaprana <n.chaprana@samsung.com>
Fri, 9 Oct 2020 13:36:47 +0000 (19:06 +0530)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 16 Nov 2020 05:25:20 +0000 (14:25 +0900)
Change-Id: I2fc0391a500912a49157c0de014b5f85f615ab15
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_dbus.c

index 0884437adbd2d6497e7c07a2a286e934dc9bcbfd..558c226f16c49afc0b5339a8f2330e1bd7f36941 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.2.5
+Version:       1.2.6
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 2e5e6c7cd500d00a59943d6df89540ecae6d683b..728bde93191cce0e1b9fe33442e3540c32374e0d 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;