flutter_reactive_ble icon indicating copy to clipboard operation
flutter_reactive_ble copied to clipboard

discoveredDevices is marked as @visibleForTesting, but a method to access that data would be helpful.

Open tony-ditchlabs opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? (please describe) The DiscoveredDevicesRegistry currently has no way to get all or a subset of DiscoveredDevices or their ids. The pattern expected is to listen to the results of a scan and keep a list of ids or devices, then query the DiscoveredDevicesRegistrys deviceIsDiscoveredRecently method later on to see if the device is still active.

Describe the solution you'd like While discoveredDevices should remain marked as @visibleForTesting, a method that returns the device ids from that map would eliminate the need to track them outside of the library.

Describe alternatives you've considered The pattern above is the best workaround at the moment, but it does add some additional code that is probably best managed by the library instead.

Additional context Related: I'm surprised that discoveredDevices is visible for testing, but add and remove are public

tony-ditchlabs avatar Jan 25 '23 16:01 tony-ditchlabs