Closed HausBJB closed 3 months ago
I do absolutely nothing special here. This is entirely on the platform to figure out.
I have never seen anything remotely close to this in any of my projects. The only thing I can see is that you're not cancelling out of your scan wave in the most appropriate way.
public ConnectionState Status => this.Native.State switch
{
CBPeripheralState.Connected => ConnectionState.Connected,
CBPeripheralState.Connecting => ConnectionState.Connecting,
CBPeripheralState.Disconnected => ConnectionState.Disconnected,
CBPeripheralState.Disconnecting => ConnectionState.Disconnecting,
_ => ConnectionState.Disconnected
};
public void CancelConnection()
{
this.autoReconnectSub?.Dispose();
this.manager.Manager.CancelPeripheralConnection(this.Native);
}
I'd suggest pulling down the code to see what might be happening. There isn't really anything for me to solve here.
Component/Nuget
BluetoothLE Client (Shiny.BluetoothLE)
What operating system(s) are effected?
Version(s) of Operation Systems
iOS-Version 16.6 Unfortunately, I was unable to test Android and other platforms
Hosting Model
Steps To Reproduce
Expected Behavior
I expect the connection to be disconnected after calling CancelConnection()
Actual Behavior
At the moment, if two devices are connected and then you disconnect from both devices, it will automatically reconnect a short time later and then it repeats itself over and over again, disconnecting and reconnecting, look at the logs
Exception or Log output
2024-05-24 14:54:35.380 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Disconnected
2024-05-24 14:54:35.379 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Disconnected
2024-05-24 14:54:35.947 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Connected
2024-05-24 14:54:35.947 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Connected
2024-05-24 14:54:35.952 Xamarin.PreBuilt.iOS[902:140454] All connections successfully established
2024-05-24 14:54:45.488 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Disconnected
2024-05-24 14:54:45.487 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Disconnected
2024-05-24 14:54:45.958 Xamarin.PreBuilt.iOS[902:140454] Try to interrupt all connections
2024-05-24 14:54:45.990 Xamarin.PreBuilt.iOS[902:140454] GATT is not connected
2024-05-24 14:54:46.025 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Connected
2024-05-24 14:54:46.025 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Connected
Thread finished: #4
Der Thread 4 hat mit Code 0 (0x0) geendet.
2024-05-24 14:54:55.567 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Disconnected
2024-05-24 14:54:55.567 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Disconnected
2024-05-24 14:54:56.104 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Connected
2024-05-24 14:54:56.103 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Connected
2024-05-24 14:55:05.647 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Disconnected
2024-05-24 14:55:05.646 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Disconnected
2024-05-24 14:55:06.185 Xamarin.PreBuilt.iOS[902:140454] The status of device number 2 has changed to Connected
2024-05-24 14:55:06.184 Xamarin.PreBuilt.iOS[902:140454] The status of device number 1 has changed to Connected
Code Sample
https://github.com/HausBJB/MauiApp1
Code of Conduct