bearer: Fix auto-connect handling of LE Connect and Disconnect
Status from this message: This series was applied to bluetooth/bluez.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | device: Add functions to pause and resume auto-connectsrc/ src/ | +27 | 1 reply | |
| 2/2 | bearer: Fix LE Connect and Disconnect ignoring auto-connectsrc/ | +5 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH BlueZ 0/2] bearer: Fix auto-connect handling of LE Connect and Disconnect
org.bluez.Bearer.LE1.Disconnect is documented, like org.bluez.Device1.Disconnect, to disable incoming connections of a device that is not trusted until Connect is called again. Device1 does this by taking the device out of the auto-connect list, but the LE bearer does not: a paired HID device that is not trusted and keeps advertising is connected back right after Bearer.LE1.Disconnect.
Bearer.LE1.Connect does not put a device back in the list either, unlike Device1.Connect, so a device taken out of it by Device1.Disconnect is not reconnected after it loses the connection.
The first patch moves what Device1 does into two functions, and the second one calls them from the LE bearer. The BR/EDR bearer is left as it is, as auto-connect is only done over LE.
I reproduced this with a functional test using the HID device of test_hog.py, on master and bluetooth-next 3f425f95ba39:
Disconnect, untrusted master with the series Device1.Disconnect stays disconnected stays disconnected Bearer.LE1.Disconnect connected back stays disconnected
Connect, then the HID device drops the link
Device1.Connect reconnected reconnected Bearer.LE1.Connect not reconnected reconnected
A trusted device is connected back after Device1.Disconnect in both, as expected. make check and the functional tests using the bearers, HoG, btmgmt, bluetoothctl or the agent pass as before.
I have the test as two test cases for test_bearer.py, documented in doc/functional-bearer.rst, and can send them as a third patch if you want them.
Kevin Dewald (2):
device: Add functions to pause and resume auto-connect
bearer: Fix LE Connect and Disconnect ignoring auto-connect
src/bearer.c | 5 +++++ src/device.c | 42 +++++++++++++++++++++++++----------------- src/device.h | 2 ++ 3 files changed, 32 insertions(+), 17 deletions(-)
base-commit: a8067198717b38391ca183ed7f41a69ec4b81b6e
Signature · 1 line
2.54.0 (Apple Git-157)