public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] error: Add dedicated error domain for BREDR
@ 2025-07-01 20:34 Luiz Augusto von Dentz
  2025-07-01 21:52 ` [BlueZ,v1] " bluez.test.bot
  2025-07-02 13:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-01 20:34 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds dedicated error domain org.bluez.Error.BREDR for BREDR bearer
and then use it on the likes of btd_error_profile_unavailable.
---
 doc/org.bluez.Device.rst | 1 +
 src/device.c             | 3 +--
 src/error.c              | 5 ++---
 src/error.h              | 1 +
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/org.bluez.Device.rst b/doc/org.bluez.Device.rst
index 646e2c77ec2d..61c394dd2d0b 100644
--- a/doc/org.bluez.Device.rst
+++ b/doc/org.bluez.Device.rst
@@ -49,6 +49,7 @@ Possible errors:
 :org.bluez.Error.Failed:
 :org.bluez.Error.InProgress:
 :org.bluez.Error.AlreadyConnected:
+:org.bluez.Error.BREDR.ProfileUnavailable:
 
 void Disconnect()
 `````````````````
diff --git a/src/device.c b/src/device.c
index 2c741d3913e4..2892b75e7e25 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2685,8 +2685,7 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 						BTD_SERVICE_STATE_CONNECTED)) {
 				return dbus_message_new_method_return(msg);
 			} else {
-				return btd_error_not_available_str(msg,
-					ERR_BREDR_CONN_PROFILE_UNAVAILABLE);
+				return btd_error_profile_unavailable(msg);
 			}
 		}
 
diff --git a/src/error.c b/src/error.c
index 41dd90400426..e61baeef7928 100644
--- a/src/error.c
+++ b/src/error.c
@@ -130,10 +130,9 @@ DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str)
 
 DBusMessage *btd_error_profile_unavailable(DBusMessage *msg)
 {
-	return g_dbus_create_error(msg, ERROR_INTERFACE
+	return g_dbus_create_error(msg, ERROR_INTERFACE_BREDR
 					".ProfileUnavailable",
-					"Exhausted the list of BR/EDR "
-					"profiles to connect to");
+					"No more profiles to connect to");
 }
 
 DBusMessage *btd_error_failed(DBusMessage *msg, const char *str)
diff --git a/src/error.h b/src/error.h
index 64297f4376d0..47602d39ba81 100644
--- a/src/error.h
+++ b/src/error.h
@@ -14,6 +14,7 @@
 #include <stdint.h>
 
 #define ERROR_INTERFACE "org.bluez.Error"
+#define ERROR_INTERFACE_BREDR "org.bluez.Error.BREDR"
 
 /* BR/EDR connection failure reasons */
 #define ERR_BREDR_CONN_ALREADY_CONNECTED	"br-connection-already-"\
-- 
2.49.0


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

end of thread, other threads:[~2025-07-02 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 20:34 [PATCH BlueZ v1] error: Add dedicated error domain for BREDR Luiz Augusto von Dentz
2025-07-01 21:52 ` [BlueZ,v1] " bluez.test.bot
2025-07-02 13:00 ` [PATCH BlueZ v1] " 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