Closed sleushunou closed 8 months ago
Do you have a good business case for this? This potential fix may seem "easy" here, but it definitely is not?
According to the Apple guide, scanning should be active only when it is really needed to save battery power.
business case: Once we have found all of our expected devices, we stop scanning. But, if we want to add another device to the device list, we run the scan again.
Are you actually connected to the devices while running a scan though?
No response from user.
You can't keep a reference to an unconnected device and then run a scan. iOS emits new peripheral.
Component/Nuget
BluetoothLE Client (Shiny.BluetoothLE)
What operating system(s) are effected?
Version(s) of Operation Systems
Tested on iOS 16 iPhone 12
Hosting Model
Steps To Reproduce
Expected Behavior
IPeripheral::WhenStatusChanged() - status changed when peripheral is connected
Actual Behavior
IPeripheral::WhenStatusChanged() - status not changed when peripheral is connected, subscription handler is not called when BUT IBleDelegate::OnPeripheralStateChanged() - state changed when peripheral is connected ✔️
Exception or Log output
instead of logs. seems like problem is here: this.Clear(); List of cached IPeripheral's on BleManager cleared every time after starting a new scan, and when connection status is changed, BleManager calls p.ReceiveStateChange(status);, where p - another, newly created, instance of IPeripheral that refers on the same physical device, and first instance of IPeripheral does not receive state change
Code Sample
Code of Conduct