Name: csapi-network-wifi
Summary: Tizen Wi-Fi API for C#
-Version: 1.0.16
+Version: 1.0.17
Release: 1
Group: Development/Libraries
License: Apache-2.0
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")]
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<ItemGroup>
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
<PackageReference Include="Tizen" Version="1.0.5" />
- <PackageReference Include="Tizen.Network.Connection" Version="1.0.10" />
+ <PackageReference Include="Tizen.Network.Connection" Version="1.0.18" />
</ItemGroup>
</Project>
}
}
}
+
+ 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);
+ return -1;
+ }
+ 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, _handle.DangerousGetHandle());
+ }
+ }
+ }
+
+ 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);
+ }
+ 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, _handle.DangerousGetHandle());
+ }
+ }
+ }
}
}
}
}
+ /// <summary>
+ /// Gets the all IPv6 addresses of the access point
+ /// </summary>
+ /// <returns>A list of IPv6 addresses of the access point.</returns>
+ /// <feature>http://tizen.org/feature/network.wifi</feature>
+ /// <exception cref="NotSupportedException">Thrown when WiFi is not supported.</exception>
+ /// <exception cref="ArgumentException">Thrown when method is failed due to an invalid parameter.</exception>
+ /// <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, _apHandle.DangerousGetHandle());
+ }
+
+ return ipList;
+ }
+
internal WiFiNetwork(Interop.WiFi.SafeWiFiAPHandle apHandle)
{
_apHandle = apHandle;