Name: csapi-network-wifi
Summary: Tizen Wi-Fi API for C#
-Version: 1.0.13
+Version: 1.0.14
Release: 1
Group: Development/Libraries
License: Apache-2.0
using System;
using System.Runtime.InteropServices;
+using Tizen.Network.WiFi;
+using Tizen.Network.Connection;
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)
using System;
using System.Collections.Generic;
+using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using System.ComponentModel;
namespace Tizen.Network.WiFi
{
/// <summary>
+ /// A class for managing WiFiManager handle.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public sealed class SafeWiFiManagerHandle : SafeHandle
+ {
+ internal SafeWiFiManagerHandle() : base(IntPtr.Zero, true)
+ {
+ }
+
+ /// <summary>
+ /// Checks the validity of the handle.
+ /// </summary>
+ 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;
+ }
+ }
+
+ /// <summary>
/// A manager class which allows applications to connect to a Wireless Local Area Network (WLAN) and to transfer data over the network.<br>
/// 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.
/// </summary>
}
/// <summary>
+ /// Gets the WiFi safe handle.
+ /// </summary>
+ /// <returns>The instance of SafeWiFiManagerHandle</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static SafeWiFiManagerHandle GetWiFiHandle()
+ {
+ return WiFiManagerImpl.Instance.GetSafeHandle();
+ }
+
+ /// <summary>
/// Gets the result of the scan.
/// </summary>
/// <returns> A list of WiFiAP objects.</returns>
internal class HandleHolder
{
- private Interop.WiFi.SafeWiFiManagerHandle _handle;
+ private SafeWiFiManagerHandle _handle;
internal HandleHolder()
{
Log.Debug(Globals.LogTag, "Handle: " + _handle);
}
- internal Interop.WiFi.SafeWiFiManagerHandle GetSafeHandle()
+ internal SafeWiFiManagerHandle GetSafeHandle()
{
Log.Debug(Globals.LogTag, "Handleholder safehandle = " + _handle);
return _handle;
{
}
- internal Interop.WiFi.SafeWiFiManagerHandle GetSafeHandle()
+ internal SafeWiFiManagerHandle GetSafeHandle()
{
return s_threadName.Value.GetSafeHandle();
}
- internal Interop.WiFi.SafeWiFiManagerHandle Initialize()
+ internal SafeWiFiManagerHandle Initialize()
{
- Interop.WiFi.SafeWiFiManagerHandle handle;
+ SafeWiFiManagerHandle handle;
int ret = Interop.WiFi.Initialize(out handle);
if (ret != (int)WiFiError.None)
{