From a54b5364d9108fb467d392f841eb5015fe473aba Mon Sep 17 00:00:00 2001 From: Ask Bojesen Date: Wed, 8 May 2024 17:59:49 +0200 Subject: [PATCH] Fixed connection lost --- Source/Plugin.BLE/Windows/Adapter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Plugin.BLE/Windows/Adapter.cs b/Source/Plugin.BLE/Windows/Adapter.cs index 232a4569..77ea6070 100644 --- a/Source/Plugin.BLE/Windows/Adapter.cs +++ b/Source/Plugin.BLE/Windows/Adapter.cs @@ -153,7 +153,7 @@ private void Device_ConnectionStatusChanged(BluetoothLEDevice nativeDevice, obje { // device was powered off or went out of range. Call DisconnectDeviceNative to cleanup // resources otherwise windows will not disconnect on a subsequent connect-disconnect. - DisconnectDeviceNative(disconnectedDevice); + ((Device)disconnectedDevice).DisconnectInternal(); } ConnectedDeviceRegistry.Remove(id, out _); nativeDevice.ConnectionStatusChanged -= Device_ConnectionStatusChanged; @@ -199,7 +199,7 @@ protected override IReadOnlyList GetBondedDevices() this, bluetoothLeDevice, 0, id); - devlist.Add(device); + devlist.Add(device); Trace.Message("GetBondedDevices: {0}: {1}", dev.Id, dev.Name); } else