summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-03-16 20:31:56 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-03-16 20:31:56 +0000
commite6edccc19224e03227351de839e02637516bf6f9 (patch)
treebee579ae2d22bc139f7cd750cbcc68da223ef942 /hcid
parent5c8dea74d0f1d0ac352827f6adc8761caa161e90 (diff)
Add a couple of new errors
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-error.c18
-rw-r--r--hcid/dbus.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c
index dc672a92..d126d11b 100644
--- a/hcid/dbus-error.c
+++ b/hcid/dbus-error.c
@@ -104,6 +104,13 @@ DBusHandlerResult error_unsupported_major_class(DBusConnection *conn, DBusMessag
"Unsupported Major Class"));
}
+DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn, DBusMessage *msg, int err)
+{
+ return send_reply_and_unref(conn,
+ dbus_message_new_error(msg, ERROR_INTERFACE ".ConnectionAttemptFailed",
+ err ? "Connection attempt failed" : strerror(err)));
+}
+
static DBusHandlerResult error_already_exists(DBusConnection *conn, DBusMessage *msg, const char *str)
{
return send_reply_and_unref(conn,
@@ -122,6 +129,12 @@ static DBusHandlerResult error_in_progress(DBusConnection *conn, DBusMessage *ms
dbus_message_new_error(msg, ERROR_INTERFACE ".InProgress", str));
}
+static DBusHandlerResult error_not_in_progress(DBusConnection *conn, DBusMessage *msg, const char *str)
+{
+ return send_reply_and_unref(conn,
+ dbus_message_new_error(msg, ERROR_INTERFACE ".NotInProgress", str));
+}
+
static DBusHandlerResult error_canceled(DBusConnection *conn, DBusMessage *msg, const char *str)
{
return send_reply_and_unref(conn,
@@ -158,6 +171,11 @@ DBusHandlerResult error_connect_in_progress(DBusConnection *conn, DBusMessage *m
return error_in_progress(conn, msg, "Connection creation in progress");
}
+DBusHandlerResult error_connect_not_in_progress(DBusConnection *conn, DBusMessage *msg)
+{
+ return error_not_in_progress(conn, msg, "Connection creation not 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 78c23aa1..7635b122 100644
--- a/hcid/dbus.h
+++ b/hcid/dbus.h
@@ -132,11 +132,13 @@ DBusHandlerResult error_unknown_address(DBusConnection *conn, DBusMessage *msg);
DBusHandlerResult error_not_available(DBusConnection *conn, DBusMessage *msg);
DBusHandlerResult error_not_connected(DBusConnection *conn, DBusMessage *msg);
DBusHandlerResult error_unsupported_major_class(DBusConnection *conn, DBusMessage *msg);
+DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn, DBusMessage *msg, int err);
DBusHandlerResult error_bonding_already_exists(DBusConnection *conn, DBusMessage *msg);
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_connect_not_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);