From 033a2a17580b0811d58b28c37c54d1bb3fef99dc Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Mon, 15 May 2017 17:10:07 +0900 Subject: [PATCH] Revert before adding new apis Change-Id: I71cd75c57253284fa2f3ff7b63ebe43b5db3d0eb Signed-off-by: cheoleun --- Tizen.Network.WiFi/Interop/Interop.WiFi.cs | 35 ++++++++++------ Tizen.Network.WiFi/Tizen.Network.WiFi.project.json | 22 +++++----- .../Tizen.Network.WiFi/WiFiAddressInformation.cs | 49 ---------------------- .../Tizen.Network.WiFi/WiFiManager.cs | 41 ------------------ .../Tizen.Network.WiFi/WiFiManagerImpl.cs | 10 ++--- .../Tizen.Network.WiFi/WiFiNetwork.cs | 30 ------------- packaging/csapi-network-wifi.spec | 2 +- 7 files changed, 40 insertions(+), 149 deletions(-) diff --git a/Tizen.Network.WiFi/Interop/Interop.WiFi.cs b/Tizen.Network.WiFi/Interop/Interop.WiFi.cs index 79642e3..049462d 100755 --- a/Tizen.Network.WiFi/Interop/Interop.WiFi.cs +++ b/Tizen.Network.WiFi/Interop/Interop.WiFi.cs @@ -16,8 +16,6 @@ using System; using System.Runtime.InteropServices; -using Tizen.Network.WiFi; -using Tizen.Network.Connection; internal static partial class Interop { @@ -137,8 +135,6 @@ internal static partial class Interop internal static extern int SetIPConfigType(SafeWiFiAPHandle ap, int addressFamily, int ipConfigType); [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_ip_address")] internal static extern int GetIPAddress(SafeWiFiAPHandle ap, int addressFamily, out IntPtr ipAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_foreach_ipv6_address")] - internal static extern int GetAllIPv6Addresses(SafeWiFiAPHandle ap, HandleCallback callback, IntPtr userData); [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_ip_address")] internal static extern int SetIPAddress(SafeWiFiAPHandle ap, int addressFamily, string ipAddress); [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_subnet_mask")] @@ -161,14 +157,6 @@ internal static partial class Interop internal static extern int GetDnsAddress(SafeWiFiAPHandle ap, int order, int addressFamily, out IntPtr dnsAddress); [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_dns_address")] internal static extern int SetDnsAddress(SafeWiFiAPHandle ap, int order, int addressFamily, string dnsAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_prefix_length")] - internal static extern int GetPrefixLength(SafeWiFiAPHandle ap, int addressFamily, out int length); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_prefix_length")] - internal static extern int SetPrefixLength(SafeWiFiAPHandle ap, int addressFamily, int length); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_dns_config_type")] - internal static extern int GetDnsConfigType(SafeWiFiAPHandle ap, int addressFamily, out int type); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_dns_config_type")] - internal static extern int SetDnsConfigType(SafeWiFiAPHandle ap, int addressFamily, int type); ////Security Information [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_security_type")] @@ -267,6 +255,28 @@ internal static partial class Interop internal static extern int SetEapSubjectMatch(SafeWiFiConfigHandle config, string subjectMatch); } + internal sealed class SafeWiFiManagerHandle : SafeHandle + { + public SafeWiFiManagerHandle() : base(IntPtr.Zero, true) + { + } + + public override bool IsInvalid + { + get + { + return this.handle == IntPtr.Zero; + } + } + + protected override bool ReleaseHandle() + { + WiFi.Deinitialize(this.handle); + this.SetHandle(IntPtr.Zero); + return true; + } + } + internal sealed class SafeWiFiAPHandle : SafeHandle { public SafeWiFiAPHandle() : base(IntPtr.Zero, true) @@ -318,6 +328,7 @@ internal static partial class Interop return true; } } + } internal static partial class Libc diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json b/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json index 69c861e..94f003c 100644 --- a/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json +++ b/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json @@ -1,11 +1,11 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Threading.Thread": "4.3.0", - "Tizen": "1.0.2", - "Tizen.Network.Connection": "1.0.14" - }, - "frameworks": { - "netstandard1.3": {} - } -} +{ + "dependencies": { + "NETStandard.Library": "1.6.1", + "System.Threading.Thread": "4.3.0", + "Tizen": "1.0.2", + "Tizen.Network.Connection": "1.0.10" + }, + "frameworks": { + "netstandard1.3": {} + } +} diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs index fb6c63d..716a5df 100755 --- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs +++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs @@ -187,54 +187,5 @@ namespace Tizen.Network.WiFi } } } - - public int PrefixLength - { - get - { - int Value; - int ret = Interop.WiFi.AP.GetPrefixLength(_handle, (int)_family, out Value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to get prefix length, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret); - } - return Value; - } - - set - { - int ret = Interop.WiFi.AP.SetPrefixLength(_handle, (int)_family, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to set prefix length, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret); - } - } - } - - public DnsConfigType DnsConfigType - { - get - { - int Value; - int ret = Interop.WiFi.AP.GetDnsConfigType(_handle, (int)_family, out Value); - if ((WiFiError)ret != WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to get DNS config type, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret); - } - return (DnsConfigType)Value; - } - set - { - int ret = Interop.WiFi.AP.SetDnsConfigType(_handle, (int)_family, (int)value); - if ((WiFiError)ret != WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret); - } - } - } } } diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs index 9befdaa..5767956 100755 --- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs +++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs @@ -16,42 +16,11 @@ using System; using System.Collections.Generic; -using System.Runtime.InteropServices; using System.Threading.Tasks; -using System.ComponentModel; namespace Tizen.Network.WiFi { /// - /// A class for managing WiFiManager handle. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class SafeWiFiManagerHandle : SafeHandle - { - internal SafeWiFiManagerHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Checks the validity of the handle. - /// - public override bool IsInvalid - { - get - { - return this.handle == IntPtr.Zero; - } - } - - protected override bool ReleaseHandle() - { - Interop.WiFi.Deinitialize(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - /// /// A manager class which allows applications to connect to a Wireless Local Area Network (WLAN) and to transfer data over the network.
/// The Wi-Fi Manager enables your application to activate and deactivate a local Wi-Fi device, and to connect to a WLAN network in the infrastructure mode. ///
@@ -163,16 +132,6 @@ namespace Tizen.Network.WiFi } /// - /// Gets the WiFi safe handle. - /// - /// The instance of SafeWiFiManagerHandle - [EditorBrowsable(EditorBrowsableState.Never)] - public static SafeWiFiManagerHandle GetWiFiHandle() - { - return WiFiManagerImpl.Instance.GetSafeHandle(); - } - - /// /// Gets the result of the scan. /// /// A list of WiFiAP objects. diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs index 5625159..2472463 100755 --- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs +++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs @@ -29,7 +29,7 @@ namespace Tizen.Network.WiFi internal class HandleHolder { - private SafeWiFiManagerHandle _handle; + private Interop.WiFi.SafeWiFiManagerHandle _handle; internal HandleHolder() { @@ -37,7 +37,7 @@ namespace Tizen.Network.WiFi Log.Debug(Globals.LogTag, "Handle: " + _handle); } - internal SafeWiFiManagerHandle GetSafeHandle() + internal Interop.WiFi.SafeWiFiManagerHandle GetSafeHandle() { Log.Debug(Globals.LogTag, "Handleholder safehandle = " + _handle); return _handle; @@ -141,14 +141,14 @@ namespace Tizen.Network.WiFi { } - internal SafeWiFiManagerHandle GetSafeHandle() + internal Interop.WiFi.SafeWiFiManagerHandle GetSafeHandle() { return s_threadName.Value.GetSafeHandle(); } - internal SafeWiFiManagerHandle Initialize() + internal Interop.WiFi.SafeWiFiManagerHandle Initialize() { - SafeWiFiManagerHandle handle; + Interop.WiFi.SafeWiFiManagerHandle handle; int ret = Interop.WiFi.Initialize(out handle); if (ret != (int)WiFiError.None) { diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs index 652a924..49319bc 100755 --- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs +++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs @@ -251,36 +251,6 @@ namespace Tizen.Network.WiFi } } - /// - /// Gets the all IPv6 addresses of the access point - /// - /// A list of IPv6 addresses of the access point. - /// Thrown when method failed due to invalid operation - public IEnumerable GetAllIPv6Addresses() - { - Log.Debug(Globals.LogTag, "GetAllIPv6Addresses"); - List ipList = new List(); - Interop.WiFi.HandleCallback callback = (IntPtr ipv6Address, IntPtr userData) => - { - if (ipv6Address != IntPtr.Zero) - { - string ipv6 = Marshal.PtrToStringAnsi(ipv6Address); - ipList.Add(System.Net.IPAddress.Parse(ipv6)); - return true; - } - return false; - }; - - int ret = Interop.WiFi.AP.GetAllIPv6Addresses(_apHandle, callback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret); - } - - return ipList; - } - internal WiFiNetwork(Interop.WiFi.SafeWiFiAPHandle apHandle) { _apHandle = apHandle; diff --git a/packaging/csapi-network-wifi.spec b/packaging/csapi-network-wifi.spec index b12519e..22ea531 100755 --- a/packaging/csapi-network-wifi.spec +++ b/packaging/csapi-network-wifi.spec @@ -1,6 +1,6 @@ Name: csapi-network-wifi Summary: Tizen Wi-Fi API for C# -Version: 1.0.14 +Version: 1.0.15 Release: 1 Group: Development/Libraries License: Apache-2.0 -- 2.7.4