Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/2] bearer: Fix auto-connect handling of LE Connect and Disconnect
@ 2026-11-07  1:56 Kevin Dewald
  2026-11-07  1:56 ` [PATCH BlueZ 1/2] device: Add functions to pause and resume auto-connect Kevin Dewald
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kevin Dewald @ 2026-11-07  1:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Kevin Dewald

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)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-09 16:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07  1:56 [PATCH BlueZ 0/2] bearer: Fix auto-connect handling of LE Connect and Disconnect Kevin Dewald
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox