[WiFi] Add WiFiAP.Update 75/162275/2
authorchleun.moon <chleun.moon@samsung.com>
Thu, 30 Nov 2017 06:00:02 +0000 (15:00 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 30 Nov 2017 07:46:08 +0000 (16:46 +0900)
Change-Id: Ie8df6c02181ea15e8bcf20bba8b34537de0452b7
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs
src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs
src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs
src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs
src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs

index 96f75fe..d07116c 100755 (executable)
@@ -80,6 +80,8 @@ internal static partial class Interop
         internal static extern int ConnectByWpsPinWithoutSsid(SafeWiFiManagerHandle wifi, string pin, VoidCallback callback, IntPtr userData);
         [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_forget_ap")]
         internal static extern int RemoveAP(SafeWiFiManagerHandle wifi, IntPtr ap);
+        [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_update_ap")]
+        internal static extern int UpdateAP(SafeWiFiManagerHandle wifi, IntPtr ap);
 
         //Wi-Fi Monitor
         [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_get_connection_state")]
index 004c8a9..e170b25 100755 (executable)
@@ -17,6 +17,7 @@
 using System;
 using System.Threading.Tasks;
 using System.Collections.Generic;
+using System.ComponentModel;
 
 namespace Tizen.Network.WiFi
 {
@@ -490,7 +491,7 @@ namespace Tizen.Network.WiFi
                 WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
             }
         }
-    }
+   }
 
     /// <summary>
     /// An abstract class which is used to represent the WPS information of the access point.
index 07506f0..f9419af 100755 (executable)
@@ -57,6 +57,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set first dns address, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -85,6 +86,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set second dns address, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -113,6 +115,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set gateway address, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -141,6 +144,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set subnet mask, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -169,6 +173,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set ip address, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -192,6 +197,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set ip config type, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -217,6 +223,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "It failed to set prefix length, " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
@@ -240,6 +247,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_handle);
             }
         }
 
index 1058ddd..03c138e 100755 (executable)
@@ -453,5 +453,15 @@ namespace Tizen.Network.WiFi
             }
             return task.Task;
         }
+
+        internal void UpdateAP(Interop.WiFi.SafeWiFiAPHandle apHandle)
+        {
+            int ret = Interop.WiFi.UpdateAP(GetSafeHandle(), apHandle.DangerousGetHandle());
+            if (ret != (int)WiFiError.None)
+            {
+                Log.Error(Globals.LogTag, "Failed to update AP, Error - " + (WiFiError)ret);
+                WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), apHandle.DangerousGetHandle());
+            }
+        }
     }
 }
index d77be57..c7b9aae 100755 (executable)
@@ -135,6 +135,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set proxy address, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_apHandle);
             }
         }
 
@@ -166,6 +167,7 @@ namespace Tizen.Network.WiFi
                     Log.Error(Globals.LogTag, "Failed to set proxy type, Error - " + (WiFiError)ret);
                     WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
                 }
+                WiFiManagerImpl.Instance.UpdateAP(_apHandle);
             }
         }