From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> 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