public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Danis" <frederic.danis@collabora.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v4 0/4] Propagate disconnection reason
Date: Fri, 23 May 2025 09:26:43 +0200	[thread overview]
Message-ID: <20250523072647.689324-1-frederic.danis@collabora.com> (raw)

Currently a client application is informed of the disconnection by the
update of the Connected property to false.
This sends a Disconnected signal with the disconnection reason before
the property is updated.

This will help client application to know the reason for the
disconnection and to take appropriate action.

bluetoothctl is updated to display the disconnection reason on reception
of the signal.

This can be tested in bluetoothctl by disconnecting a device, which
generates:
[SIGNAL] org.bluez.Device1.Disconnected disconnection-local-host

v1->v2: Propagate numerical reason instead of text one
	Improve documentation
	Display disconnect reason in numerical and text in bluetoothctl
v2->v3: Replace numerical value by name and message to be more consistent
        with Device.Connect error reply.
v3->v4: Add MGMT_DEV_DISCONN_AUTH_FAILURE to be in sync with kernel
        definitions

Frédéric Danis (4):
  lib/mgmt: Add MGMT_DEV_DISCONN_AUTH_FAILURE define
  src/device: Add Disconnected signal to propagate disconnection reason
  doc/device: Add Disconnected signal
  client: Display disconnection reason

 client/main.c            | 18 +++++++++++++
 doc/org.bluez.Device.rst | 41 +++++++++++++++++++++++++++++
 lib/mgmt.h               |  1 +
 src/adapter.c            | 13 +++++----
 src/device.c             | 57 ++++++++++++++++++++++++++++++++++++++--
 src/device.h             |  3 ++-
 6 files changed, 125 insertions(+), 8 deletions(-)

-- 
2.43.0


             reply	other threads:[~2025-05-23  7:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  7:26 Frédéric Danis [this message]
2025-05-23  7:26 ` [PATCH BlueZ v4 1/4] lib/mgmt: Add MGMT_DEV_DISCONN_AUTH_FAILURE define Frédéric Danis
2025-05-23  8:46   ` Propagate disconnection reason bluez.test.bot
2025-05-23  7:26 ` [PATCH BlueZ v4 2/4] src/device: Add Disconnected signal to propagate " Frédéric Danis
2025-05-23  7:26 ` [PATCH BlueZ v4 3/4] doc/device: Add Disconnected signal Frédéric Danis
2025-05-23  7:26 ` [PATCH BlueZ v4 4/4] client: Display disconnection reason Frédéric Danis
2025-05-23 15:20 ` [PATCH BlueZ v4 0/4] Propagate " 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=20250523072647.689324-1-frederic.danis@collabora.com \
    --to=frederic.danis@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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