diff options
Diffstat (limited to 'hcid/dbus-error.c')
-rw-r--r-- | hcid/dbus-error.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c index df8913ad..88e5bd7f 100644 --- a/hcid/dbus-error.c +++ b/hcid/dbus-error.c @@ -156,3 +156,22 @@ DBusMessage *bluez_new_failure_msg(DBusMessage *msg, const uint32_t ecode) return reply; } + +DBusMessage *error_generic(DBusMessage *msg, int err) +{ + const char *str = strerror(err); + + return dbus_message_new_error(msg, ERROR_INTERFACE ".UnknownError", str); +} + +DBusMessage *error_out_of_memory(DBusMessage *msg) +{ + return dbus_message_new_error(msg, ERROR_INTERFACE ".OutOfMemory", + "Out of memory"); +} + +DBusMessage *error_no_such_device(DBusMessage *msg) +{ + return dbus_message_new_error(msg, ERROR_INTERFACE ".NoSuchDevice", + "No such device"); +} |