using System;
using System.Threading.Tasks;
using System.Collections.Generic;
-using System.ComponentModel;
namespace Tizen.Network.WiFi
{
WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
}
}
+
+ /// <summary>
+ /// Update the information of a stored access point.
+ /// When a AP information is changed, the change will not be applied until this method is called.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/network.wifi</feature>
+ /// <privilege>http://tizen.org/privilege/network.profile</privilege>
+ /// <privilege>http://tizen.org/privilege/network.get</privilege>
+ /// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
+ /// <exception cref="ObjectDisposedException">Thrown when the object instance is disposed or released.</exception>
+ /// <exception cref="OutOfMemoryException">Thrown when the system is out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
+ public void Update()
+ {
+ Log.Debug(Globals.LogTag, "Update");
+ if (_disposed)
+ {
+ throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)");
+ }
+ int ret = Interop.WiFi.UpdateAP(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle);
+ if (ret != (int)WiFiError.None)
+ {
+ Log.Error(Globals.LogTag, "Failed to update AP, Error - " + (WiFiError)ret);
+ WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
+ }
+ }
}
/// <summary>
Log.Error(Globals.LogTag, "Failed to set first dns address, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "Failed to set second dns address, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "Failed to set gateway address, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "Failed to set subnet mask, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "Failed to set ip address, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "Failed to set ip config type, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "It failed to set prefix length, " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_handle);
}
}
}
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());
- }
- }
}
}
Log.Error(Globals.LogTag, "Failed to set proxy address, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_apHandle);
}
}
Log.Error(Globals.LogTag, "Failed to set proxy type, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
- WiFiManagerImpl.Instance.UpdateAP(_apHandle);
}
}