diff mbox series

[BlueZ] a2dp: Fix connection error message

Message ID 20240821075714.357691-1-frederic.danis@collabora.com
State New
Headers show
Series [BlueZ] a2dp: Fix connection error message | expand

Commit Message

Frédéric Danis Aug. 21, 2024, 7:57 a.m. UTC
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 mbox series

Patch

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:
 		/*