public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] a2dp: Fix connection error message
@ 2024-08-21  7:57 Frédéric Danis
  2024-08-21  9:47 ` [BlueZ] " bluez.test.bot
  2024-08-21 15:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2024-08-21  7:57 UTC (permalink / raw)
  To: linux-bluetooth

When trying to connect to a phone which has removed the pairing, the
DBus error message is:
- if A2DP only is supported: br-connection-key-missing (EBADE)
- if HFP only is supported: br-connection-refused (ECONNREFUSED)
- if both are supported: br-connection-unknown, while the trace shows
  ECONNREFUSED in avdtp_connect_cb()

This patch allows to return the correct error message.
---
 profiles/audio/a2dp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 43da38051..a6489a763 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -326,6 +326,7 @@ static int error_to_errno(struct avdtp_error *err)
 	case EHOSTDOWN:
 	case ECONNABORTED:
 	case EBADE:
+	case ECONNREFUSED:
 		return -perr;
 	default:
 		/*
-- 
2.34.1


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

end of thread, other threads:[~2024-08-21 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21  7:57 [PATCH BlueZ] a2dp: Fix connection error message Frédéric Danis
2024-08-21  9:47 ` [BlueZ] " bluez.test.bot
2024-08-21 15:00 ` [PATCH BlueZ] " 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