summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-error.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-03-09 17:57:09 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-03-09 17:57:09 +0000
commit4bac26fbcf785c3a438ac3b2c2edb1227a800023 (patch)
treedef7373f622713fb89e30d96a3b3d6ab5dbbed55 /hcid/dbus-error.c
parent148aa53876853a637e5b94f3c6aae5fb2d788c90 (diff)
Cleanup the error definitions and add some new ones
Diffstat (limited to 'hcid/dbus-error.c')
-rw-r--r--hcid/dbus-error.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c
index 88e5bd7f..ae8af500 100644
--- a/hcid/dbus-error.c
+++ b/hcid/dbus-error.c
@@ -157,11 +157,23 @@ DBusMessage *bluez_new_failure_msg(DBusMessage *msg, const uint32_t ecode)
return reply;
}
-DBusMessage *error_generic(DBusMessage *msg, int err)
+DBusMessage *error_failed(DBusMessage *msg, int err)
{
const char *str = strerror(err);
- return dbus_message_new_error(msg, ERROR_INTERFACE ".UnknownError", str);
+ return dbus_message_new_error(msg, ERROR_INTERFACE ".Failed", str);
+}
+
+DBusMessage *error_invalid_arguments(DBusMessage *msg)
+{
+ return dbus_message_new_error(msg, ERROR_INTERFACE ".InvalidArguments",
+ "Invalid arguments");
+}
+
+DBusMessage *error_not_authorized(DBusMessage *msg)
+{
+ return dbus_message_new_error(msg, ERROR_INTERFACE ".NotAuthorized",
+ "Not authorized");
}
DBusMessage *error_out_of_memory(DBusMessage *msg)
@@ -170,8 +182,14 @@ DBusMessage *error_out_of_memory(DBusMessage *msg)
"Out of memory");
}
-DBusMessage *error_no_such_device(DBusMessage *msg)
+DBusMessage *error_no_such_adapter(DBusMessage *msg)
+{
+ return dbus_message_new_error(msg, ERROR_INTERFACE ".NoSuchAdapter",
+ "No such adapter");
+}
+
+DBusMessage *error_unknown_address(DBusMessage *msg)
{
- return dbus_message_new_error(msg, ERROR_INTERFACE ".NoSuchDevice",
- "No such device");
+ return dbus_message_new_error(msg, ERROR_INTERFACE ".UnknownAddress",
+ "Device address is unknown");
}