/// <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="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public void Refresh()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to refresh ap handle, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle, "http://tizen.org/privilege/network.get");
}
}
/// <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="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public Task ConnectAsync()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to connect wifi, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
}
}
/// <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="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public Task DisconnectAsync()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to disconnect wifi, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
}
}
/// <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="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public void ForgetAP()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to forget AP, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle);
}
}
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due an to invalid operation.</exception>
public string GetClientCertFile()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
return Marshal.PtrToStringAnsi(strPtr);
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public string GetUserName()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get user name in eap passphrase, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
return Marshal.PtrToStringAnsi(strptr);
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public bool IsPasswordSet()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get IsPasswordSet in passphrase, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
return passwordSet;
/// <returns>The certification authority (CA) certificates file of the access point.</returns>
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public string GetClientCertFile()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle());
}
return Marshal.PtrToStringAnsi(strPtr);
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when the permission is denied.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
[EditorBrowsable(EditorBrowsableState.Never)]
public static SafeWiFiManagerHandle GetWiFiHandle()
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public IEnumerable<WiFiAP> GetFoundAPs()
{
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public IEnumerable<WiFiAP> GetFoundSpecificAPs()
{
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when the permission is denied.</exception>
/// <exception cref="OutOfMemoryException">Thrown when system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public IEnumerable<WiFiConfiguration> GetWiFiConfigurations()
{
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when the permission is denied.</exception>
/// <exception cref="OutOfMemoryException">Thrown when system is out of memory.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public WiFiAP GetConnectedAP()
{
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public Task ActivateAsync()
{
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public Task ActivateWithPickerAsync()
{
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public Task DeactivateAsync()
{
/// <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 the permission is denied.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
static public Task ScanAsync()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get all APs, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get");
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get specific APs, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get");
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get bssid APs, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get");
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get configurations, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.profile");
}
Log.Error(Globals.LogTag, "No connection " + (WiFiError)ret);
return null;
}
+ else if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
else
{
Log.Error(Globals.LogTag, "Failed to get connected AP, Error - " + (WiFiError)ret);
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle());
}
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle());
}
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to deactivate wifi, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle());
}
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to scan all AP, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle());
}
}
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to scan Bssid AP, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle());
}
}
/// <returns>A list of IPv6 addresses of the access point.</returns>
/// <feature>http://tizen.org/feature/network.wifi</feature>
/// <exception cref="NotSupportedException">Thrown when the Wi-Fi is not supported.</exception>
- /// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <exception cref="InvalidOperationException">Thrown when the method failed due to an invalid operation.</exception>
public IEnumerable<System.Net.IPAddress> GetAllIPv6Addresses()
{
if (ret != (int)WiFiError.None)
{
Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (WiFiError)ret);
+ if (ret == (int)WiFiError.InvalidParameterError)
+ {
+ throw new InvalidOperationException("Invalid handle");
+ }
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}
int ret = Interop.WiFi.AP.GetBssids(_apHandle, callback, IntPtr.Zero);
if (ret != (int)WiFiError.None)
{
+ Log.Error(Globals.LogTag, "Failed to get BSSIDs, Error - " + (WiFiError)ret);
if (ret == (int)WiFiError.InvalidParameterError)
{
throw new InvalidOperationException("Invalid handle");
}
- Log.Error(Globals.LogTag, "Failed to get BSSIDs, Error - " + (WiFiError)ret);
WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle());
}