[Bluetooth][Non-ACR] GetBondedDevice converting issue (#2517)
authorWootak Jung <wootak.jung@samsung.com>
Wed, 10 Mar 2021 02:32:52 +0000 (11:32 +0900)
committerGitHub <noreply@github.com>
Wed, 10 Mar 2021 02:32:52 +0000 (11:32 +0900)
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Co-authored-by: dh79pyun <31202060+dh79pyun@users.noreply.github.com>
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs

index e57754347f55e8f5f14b52988893f187644bcb87..b2788c5fc5e81a7dabe7f0237ae2b0039885b84c 100644 (file)
@@ -492,6 +492,7 @@ namespace Tizen.Network.Bluetooth
         internal BluetoothDevice GetBondedDevice(string address)
         {
             IntPtr deviceInfo;
+            BluetoothDevice btDevice;
             int ret = Interop.Bluetooth.GetBondedDeviceByAddress(address, out deviceInfo);
             if(ret != (int)BluetoothError.None)
             {
@@ -499,9 +500,9 @@ namespace Tizen.Network.Bluetooth
                 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)