diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-04-27 14:18:09 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-04-27 14:18:09 +0000 |
commit | 6ecc27526933015c672c305669e6f09c68a0b573 (patch) | |
tree | 4c72b5347e3c28dbac0d3393ba2a05336dfd888d /audio | |
parent | 999a1b2c1ff51119806d16430adbc5d7677ac4c4 (diff) |
Use org.bluez.audio.Error interface for D-Bus error returns
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 11 | ||||
-rw-r--r-- | audio/manager.c | 13 |
2 files changed, 14 insertions, 10 deletions
diff --git a/audio/headset.c b/audio/headset.c index 81115915..04a24ca0 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -140,30 +140,31 @@ static DBusHandlerResult error_reply(DBusConnection *conn, DBusMessage *msg, static DBusHandlerResult err_already_connected(DBusConnection *conn, DBusMessage *msg) { - return error_reply(conn, msg, "org.bluez.Error.AlreadyConnected", + return error_reply(conn, msg, "org.bluez.audio.Error.AlreadyConnected", "Already connected to a device"); } static DBusHandlerResult err_not_connected(DBusConnection *conn, DBusMessage *msg) { - return error_reply(conn, msg, "org.bluez.Error.NotConnected", + return error_reply(conn, msg, "org.bluez.audio.Error.NotConnected", "Not connected to any device"); } static DBusHandlerResult err_not_supported(DBusConnection *conn, DBusMessage *msg) { - return error_reply(conn, msg, "org.bluez.Error.NotSupported", + return error_reply(conn, msg, "org.bluez.audio.Error.NotSupported", "The service is not supported by the remote device"); } static DBusHandlerResult err_connect_failed(DBusConnection *conn, DBusMessage *msg, int err) { - return error_reply(conn, msg, "org.bluez.Error.ConnectFailed", strerror(err)); + return error_reply(conn, msg, "org.bluez.audio.Error.ConnectFailed", + strerror(err)); } static DBusHandlerResult err_failed(DBusConnection *conn, DBusMessage *msg) { - return error_reply(conn, msg, "org.bluez.Error.Failed", "Failed"); + return error_reply(conn, msg, "org.bluez.audio.Error.Failed", "Failed"); } static gint headset_bda_cmp(gconstpointer headset, gconstpointer bda) diff --git a/audio/manager.c b/audio/manager.c index 1512218f..04bb3b96 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -82,7 +82,7 @@ static DBusHandlerResult error_reply(DBusConnection *conn, DBusMessage *msg, static DBusHandlerResult err_invalid_args(DBusConnection *conn, DBusMessage *msg, const char *descr) { - return error_reply(conn, msg, "org.bluez.Error.InvalidArguments", + return error_reply(conn, msg, "org.bluez.audio.Error.InvalidArguments", descr ? descr : "Invalid arguments in method call"); } @@ -186,7 +186,7 @@ static DBusHandlerResult am_create_headset(DBusMessage *msg) hs_path = headset_add(&bda); if (!hs_path) return error_reply(connection, msg, - "org.bluez.Error.Failed", + "org.bluez.audio.Error.Failed", "Unable to create new headset object"); manager_add_headset(hs_path); } @@ -219,7 +219,8 @@ static DBusHandlerResult am_remove_headset(DBusMessage *msg) match = g_slist_find_custom(headsets, path, (GCompareFunc) strcmp); if (!match) - return error_reply(connection, msg, "org.bluez.Error.DoesNotExist", + return error_reply(connection, msg, + "org.bluez.audio.Error.DoesNotExist", "The headset does not exist"); reply = dbus_message_new_method_return(msg); @@ -279,7 +280,8 @@ static DBusHandlerResult am_get_default_headset(DBusMessage *msg) DBusMessage *reply; if (!default_hs) - return error_reply(connection, msg, "org.bluez.Error.DoesNotExist", + return error_reply(connection, msg, + "org.bluez.audio.Error.DoesNotExist", "There is no default headset"); reply = dbus_message_new_method_return(msg); @@ -314,7 +316,8 @@ static DBusHandlerResult am_change_default_headset(DBusMessage *msg) match = g_slist_find_custom(headsets, path, (GCompareFunc) strcmp); if (!match) - return error_reply(connection, msg, "org.bluez.Error.DoesNotExist", + return error_reply(connection, msg, + "org.bluez.audio.Error.DoesNotExist", "The headset does not exist"); reply = dbus_message_new_method_return(msg); |