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")]
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")]
}
}
}
+
+ internal static partial class Libc
+ {
+ [DllImport(Libraries.Libc, EntryPoint = "free")]
+ public static extern void Free(IntPtr userData);
+ }
}
-{
- "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": {}
- }
-}
+{\r
+ "dependencies": {\r
+ "NETStandard.Library": "1.6.1",\r
+ "System.Threading.Thread": "4.3.0",\r
+ "Tizen": "1.0.2",\r
+ "Tizen.Network.Connection": "1.0.14"\r
+ },\r
+ "frameworks": {\r
+ "netstandard1.3": {}\r
+ }\r
+}\r
}
}
}
+
+ 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);
+ }
+ }
+ }
}
}
}
}
+ /// <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;
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