RxBleClient#scanBleDevices
emits a sequence of ScanResult
objects. In turn, ScanResult#getBleDevice
provides the RxBleDevice
instance from one of these emitted item.
Are there any issues with caching a RxBleDevice
instance to avoid having to perform future scans?
A couple of potential use cases:
There are at least two options:
RxBleDevice
instance yourself, as long as you keep the client instance. It internally keeps some references to objects scoped with the lifecycle of the client.RxBleClient#getBleDevice
passing the MAC address. RxBleDevice
instances are cached across the client and you shouldn't expect performance issues with creating the device.