From 5c8dea74d0f1d0ac352827f6adc8761caa161e90 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 16 Mar 2006 19:08:52 +0000 Subject: Add some new D-Bus errors --- hcid/dbus-error.c | 16 ++++++++++++++++ hcid/dbus.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c index 28cc9328..dc672a92 100644 --- a/hcid/dbus-error.c +++ b/hcid/dbus-error.c @@ -122,6 +122,17 @@ static DBusHandlerResult error_in_progress(DBusConnection *conn, DBusMessage *ms dbus_message_new_error(msg, ERROR_INTERFACE ".InProgress", str)); } +static DBusHandlerResult error_canceled(DBusConnection *conn, DBusMessage *msg, const char *str) +{ + return send_reply_and_unref(conn, + dbus_message_new_error(msg, ERROR_INTERFACE ".Canceled", str)); +} + +DBusHandlerResult error_connect_canceled(DBusConnection *conn, DBusMessage *msg) +{ + return error_canceled(conn, msg, "Connection creation was canceled"); +} + DBusHandlerResult error_bonding_already_exists(DBusConnection *conn, DBusMessage *msg) { return error_already_exists(conn, msg, "Bonding already exists"); @@ -142,6 +153,11 @@ DBusHandlerResult error_discover_in_progress(DBusConnection *conn, DBusMessage * return error_in_progress(conn, msg, "Discover in progress"); } +DBusHandlerResult error_connect_in_progress(DBusConnection *conn, DBusMessage *msg) +{ + return error_in_progress(conn, msg, "Connection creation in progress"); +} + DBusHandlerResult error_record_does_not_exist(DBusConnection *conn, DBusMessage *msg) { return error_does_not_exist(conn, msg, "Record does not exist"); diff --git a/hcid/dbus.h b/hcid/dbus.h index 16fe2ab3..78c23aa1 100644 --- a/hcid/dbus.h +++ b/hcid/dbus.h @@ -136,10 +136,12 @@ DBusHandlerResult error_bonding_already_exists(DBusConnection *conn, DBusMessage DBusHandlerResult error_bonding_does_not_exist(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_bonding_in_progress(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_discover_in_progress(DBusConnection *conn, DBusMessage *msg); +DBusHandlerResult error_connect_in_progress(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_record_does_not_exist(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_passkey_agent_already_exists(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_passkey_agent_does_not_exist(DBusConnection *conn, DBusMessage *msg); DBusHandlerResult error_binding_does_not_exist(DBusConnection *conn, DBusMessage *msg); +DBusHandlerResult error_connect_canceled(DBusConnection *conn, DBusMessage *msg); typedef void (*name_cb_t)(const char *name, void *user_data); -- cgit