internal BluetoothDevice GetBondedDevice(string address)
{
IntPtr deviceInfo;
+ BluetoothDevice btDevice;
int ret = Interop.Bluetooth.GetBondedDeviceByAddress(address, out deviceInfo);
if(ret != (int)BluetoothError.None)
{
BluetoothErrorFactory.ThrowBluetoothException(ret);
}
BluetoothDeviceStruct device = (BluetoothDeviceStruct)Marshal.PtrToStructure(deviceInfo, typeof(BluetoothDeviceStruct));
-
+ btDevice = BluetoothUtils.ConvertStructToDeviceClass(device);
Interop.Bluetooth.FreeDeviceInfo(deviceInfo);
- return BluetoothUtils.ConvertStructToDeviceClass(device);
+ return btDevice;
}
internal bool IsServiceUsed(string serviceUuid)