backends/bluez: don't disconnect devices we did not connect#1984
Open
Vodur wants to merge 1 commit intohbldh:developfrom
Open
backends/bluez: don't disconnect devices we did not connect#1984Vodur wants to merge 1 commit intohbldh:developfrom
Vodur wants to merge 1 commit intohbldh:developfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1984 +/- ##
===========================================
+ Coverage 52.06% 52.30% +0.23%
===========================================
Files 43 43
Lines 4091 4103 +12
Branches 503 505 +2
===========================================
+ Hits 2130 2146 +16
+ Misses 1830 1828 -2
+ Partials 131 129 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
BleakClientBlueZDBus.disconnect() now only calls BlueZ Disconnect when this client initiated the connection. The decision is based on a 'from_connected_devices' marker that BleakAdapterBlueZDBus.get_connected_devices() sets on each returned BLEDevice. If a device is found already connected at connect() time and the user did not opt into the existing connection (no marker), the client still owns the connection so it can clean up an orphan from a crashed previous run. Only when the BLEDevice was retrieved via BleakAdapter.get_connected_devices() does the new client leave the connection up on close. See bluez/bluez#89.
faea97f to
75708ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BleakClientBlueZDBus.disconnect()now only calls BlueZ Disconnect when this client initiated the connection. The decision is based on afrom_connected_devicesmarker thatBleakAdapterBlueZDBus.get_connected_devices()sets on each returnedBLEDevice.If a device is found already connected at connect() time and the user did not opt into the existing connection (no marker), the client still owns the connection so it can clean up an orphan from a crashed previous run. Only when the
BLEDevicewas retrieved viaBleakAdapter.get_connected_devices()does the new client leave the connection up on close.See bluez/bluez#89.