Add filter to paired device retrieval #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello - thanks for your work on this library, it's been useful for my project. For my use case I want to be able to have connections to multiple devices connecting and disconnecting without user intervention, and regularly check for previously known ('Paired') devices, in addition to scanning for new BLE devices which match my service UUIDs.
An unexpected issue I've encountered using this code is that
retrieveConnectedPeripherals(withServices:)unconditionally callsConnectedPeripheral(...)which sets a newcbPeripheral.delegateinstance on the CBPeripheral object, leaving my prior ConnectedPeripheral objects in a zombie state where they still write data without error but cannot receive data or notifications.A filter on this call, like you already have on
scanAndConnect(...)helps my code prevent this case. Feel free to change the approach here or ignore it but submitting this because it's useful for my scenario.