diff --git a/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs b/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
index 8142099463f..434d5bd2540 100755
--- a/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
+++ b/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
@@ -92,6 +92,10 @@ internal static partial class WiFi
internal static extern int ForgetAP(SafeWiFiManagerHandle wifi, IntPtr ap, VoidCallback callback, IntPtr userData);
[DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_update_ap")]
internal static extern int UpdateAP(SafeWiFiManagerHandle wifi, IntPtr ap);
+ [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_set_autoscan_mode")]
+ internal static extern int SetAutoScanMode(SafeWiFiManagerHandle wifi, int mode);
+ [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect_hidden_ap")]
+ internal static extern int ConnectHiddenAP(SafeWiFiManagerHandle wifi, string essid, int secType, string passphrase, VoidCallback callback, IntPtr userData);
[DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_specific_scan_create")]
internal static extern int SpecificScanCreate(SafeWiFiManagerHandle wifi, out IntPtr specificScanHandle);
[DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_specific_scan_destroy")]
diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs
index d1101064e55..3b23c4f3f29 100755
--- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs
+++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs
@@ -15,6 +15,7 @@
*/
using System;
+using System.ComponentModel;
namespace Tizen.Network.WiFi
{
@@ -213,4 +214,23 @@ public enum WiFiScanState
/// 6
Scanning = 1
}
+
+ ///
+ /// Enumeration for the Wi-Fi autoscan mode.
+ ///
+ /// 10
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum WiFiAutoScanMode
+ {
+ ///
+ /// Auto scan interval is increased exponentially like 4, 8, 16, ...128secs.
+ ///
+ /// 10
+ Exponential = 0,
+ ///
+ /// Auto scan interval is fixed with 10secs(for mobile) / 15secs(for wearable).
+ ///
+ /// 10
+ Periodic = 1
+ }
}
diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs
index 190a2588156..d7dd257d003 100755
--- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs
+++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs
@@ -446,6 +446,42 @@ static public Task BssidScanAsync()
return WiFiManagerImpl.Instance.BssidScanAsync();
}
+ ///
+ /// Set Auto Scan Mode.
+ ///
+ /// 10
+ /// http://tizen.org/feature/network.wifi
+ /// http://tizen.org/privilege/network.set
+ /// http://tizen.org/privilege/network.get
+ /// Thrown when the Wi-Fi is not supported.
+ /// Thrown when the permission is denied.
+ /// Thrown when the method failed due to an invalid operation.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static public void SetAutoScanMode(WiFiAutoScanMode scanMode)
+ {
+ WiFiManagerImpl.Instance.SetAutoScanMode((int)scanMode);
+ }
+
+ ///
+ /// Hidden Ap connect.
+ ///
+ ///
+ /// This method must be called from MainThread.
+ ///
+ /// 10
+ /// A task indicating whether the HiddenAPConnectAsync method is done or not.
+ /// http://tizen.org/feature/network.wifi
+ /// http://tizen.org/privilege/network.set
+ /// http://tizen.org/privilege/network.get
+ /// Thrown when the Wi-Fi is not supported.
+ /// Thrown when the permission is denied.
+ /// Thrown when the method failed due to an invalid operation.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static public Task HiddenAPConnectAsync(string essid, int secType, string password)
+ {
+ return WiFiManagerImpl.Instance.HiddenAPConnectAsync(essid, secType, password);
+ }
+
///
/// Create Specific scan handle.
///
diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs
index f41de396ae2..64c2740f7d0 100644
--- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs
+++ b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs
@@ -597,6 +597,62 @@ internal Task BssidScanAsync()
return task.Task;
}
+ internal void SetAutoScanMode(int scanMode)
+ {
+ Log.Info(Globals.LogTag, "SetAutoScanMode");
+ int ret = Interop.WiFi.SetAutoScanMode(GetSafeHandle(), scanMode);
+ CheckReturnValue(ret, "GetSafeHandle", PrivilegeNetworkGet);
+ }
+
+ internal Task HiddenAPConnectAsync(string essid, int secType, string passphrase)
+ {
+ Log.Info(Globals.LogTag, "HiddenAPConnect");
+ TaskCompletionSource task = new TaskCompletionSource();
+ IntPtr id;
+ lock (_callback_map)
+ {
+ id = (IntPtr)_requestId++;
+ _callback_map[id] = (error, key) =>
+ {
+ Log.Info(Globals.LogTag, "HiddenAPConnect Done " + essid);
+ if (error != (int)WiFiError.None)
+ {
+ Log.Error(Globals.LogTag, "Error occurs during HiddenAPConnect, " + (WiFiError)error);
+ task.SetException(new InvalidOperationException("Error occurs during HiddenAPConnect, " + (WiFiError)error));
+ }
+ else
+ {
+ task.SetResult(true);
+ }
+ lock (_callback_map)
+ {
+ _callback_map.Remove(key);
+ }
+ };
+ }
+
+ context.Post((x) =>
+ {
+ Log.Info(Globals.LogTag, "Interop.WiFi.HiddenAPConnect");
+ try
+ {
+ int ret = (int)WiFiError.None;
+ lock (_callback_map)
+ {
+ ret = Interop.WiFi.ConnectHiddenAP(GetSafeHandle(), essid, secType, passphrase, _callback_map[id], id);
+ }
+ CheckReturnValue(ret, "HiddenAPConnect", "");
+ }
+ catch (Exception e)
+ {
+ Log.Error(Globals.LogTag, "Exception on HiddenAPConnect\n" + e);
+ task.SetException(e);
+ }
+ }, null);
+
+ return task.Task;
+ }
+
internal void CreateSpecificScanHandle()
{
Log.Debug(Globals.LogTag, "CreateSpecificScanHandle");