using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
+using System.Reflection;
+using System.ComponentModel;
namespace Tizen.Network.Bluetooth
{
}
/// <summary>
+ /// The constructor
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public BluetoothDevice(BluetoothLeDevice leDevice)
+ {
+ RemoteDeviceAddress = leDevice?.RemoteAddress;
+ }
+
+ /// <summary>
/// The address of the device.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <since_tizen> 3 </since_tizen>
public T GetProfile<T>() where T : BluetoothProfile
{
- // TODO : Need to check capability of supporting profiles
- var profile = (T)Activator.CreateInstance(typeof(T), true);
- profile.RemoteAddress = RemoteDeviceAddress;
- return profile;
+ try
+ {
+ // TODO : Need to check capability of supporting profiles
+ var profile = (T)Activator.CreateInstance(typeof(T), true);
+ profile.RemoteAddress = RemoteDeviceAddress;
+ return profile;
+ }
+ catch (TargetInvocationException err)
+ {
+ throw err.InnerException;
+ }
}
/// <summary>