From: Kevin Dewald <kevin@simpleble.org>
To: linux-bluetooth@vger.kernel.org
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Kevin Dewald <kevin@simpleble.org>
Subject: [PATCH BlueZ 0/2] bearer: Fix auto-connect handling of LE Connect and Disconnect
Date: Fri, 6 Nov 2026 17:56:47 -0800 [thread overview]
Message-ID: <20261107015649.84892-1-kevin@simpleble.org> (raw)
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
--
2.54.0 (Apple Git-157)
next reply other threads:[~2026-11-07 1:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 1:56 Kevin Dewald [this message]
2026-11-07 1:56 ` [PATCH BlueZ 1/2] device: Add functions to pause and resume auto-connect Kevin Dewald
2026-11-07 8:43 ` bearer: Fix auto-connect handling of LE Connect and Disconnect bluez.test.bot
2026-11-07 1:56 ` [PATCH BlueZ 2/2] bearer: Fix LE Connect and Disconnect ignoring auto-connect Kevin Dewald
2026-11-09 16:00 ` [PATCH BlueZ 0/2] bearer: Fix auto-connect handling of LE Connect and Disconnect patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261107015649.84892-1-kevin@simpleble.org \
--to=kevin@simpleble.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox