summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xTizen.Network.WiFi/Interop/Interop.WiFi.cs16
-rw-r--r--Tizen.Network.WiFi/Tizen.Network.WiFi.project.json22
-rwxr-xr-xTizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs49
-rwxr-xr-xTizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs30
-rwxr-xr-xpackaging/csapi-network-wifi.spec2
5 files changed, 107 insertions, 12 deletions
diff --git a/Tizen.Network.WiFi/Interop/Interop.WiFi.cs b/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
index c204508..85f5418 100755
--- a/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
+++ b/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
@@ -135,6 +135,8 @@ 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")]
@@ -157,6 +159,14 @@ 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")]
@@ -329,4 +339,10 @@ internal static partial class Interop
}
}
}
+
+ internal static partial class Libc
+ {
+ [DllImport(Libraries.Libc, EntryPoint = "free")]
+ public static extern void Free(IntPtr userData);
+ }
}
diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json b/Tizen.Network.WiFi/Tizen.Network.WiFi.project.json
index 94f003c..69c861e 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.10"
- },
- "frameworks": {
- "netstandard1.3": {}
- }
-}
+{
+ "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": {}
+ }
+}
diff --git a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs
index 716a5df..fb6c63d 100755
--- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs
+++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs
@@ -187,5 +187,54 @@ 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/WiFiNetwork.cs b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs
index 49319bc..652a924 100755
--- a/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs
+++ b/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs
@@ -251,6 +251,36 @@ namespace Tizen.Network.WiFi
}
}
+ /// <summary>
+ /// Gets the all IPv6 addresses of the access point
+ /// </summary>
+ /// <returns>A list of IPv6 addresses of the access point.</returns>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
+ public IEnumerable<System.Net.IPAddress> GetAllIPv6Addresses()
+ {
+ Log.Debug(Globals.LogTag, "GetAllIPv6Addresses");
+ List<System.Net.IPAddress> ipList = new List<System.Net.IPAddress>();
+ 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 e3ccc1d..16c078c 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.12
+Version: 1.0.13
Release: 1
Group: Development/Libraries
License: Apache-2.0