From: chleun.moon Date: Mon, 30 Oct 2017 06:24:32 +0000 (+0900) Subject: [WiFi] GetConnectedAP() Returns null if there is no connected AP X-Git-Tag: 4.0.1-preview1-00016~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F158744%2F1;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [WiFi] GetConnectedAP() Returns null if there is no connected AP Change-Id: Ib2b9a1806a93d1f42a6116c5baaf4b845135fda3 Signed-off-by: Cheoleun Moon --- diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs index bd56b97..3a40168 100755 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs +++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs @@ -264,8 +264,16 @@ namespace Tizen.Network.WiFi int ret = Interop.WiFi.GetConnectedAP(GetSafeHandle(), out apHandle); if (ret != (int)WiFiError.None) { - Log.Error(Globals.LogTag, "Failed to connect with AP, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); + if (ret == (int)WiFiError.NoConnectionError) + { + Log.Error(Globals.LogTag, "No connection " + (WiFiError)ret); + return null; + } + else + { + Log.Error(Globals.LogTag, "Failed to connect with AP, Error - " + (WiFiError)ret); + WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); + } } WiFiAP ap = new WiFiAP(apHandle); return ap;