summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-08-04 21:41:36 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-08-04 21:41:36 +0200
commit7a6368d26192e81529bc0d39c9c343a822ff175f (patch)
tree06ba97043e674dabd44a17429d3a27b3c1c3f917
parent1f57429a07bbe7021889d9cfad6f4aa270d1d2c2 (diff)
Move error_connection_attempt_failed to its usage places
-rw-r--r--audio/headset.c8
-rw-r--r--common/error.c13
-rw-r--r--common/error.h4
-rw-r--r--src/adapter.c8
4 files changed, 16 insertions, 17 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 1ffa7456..bcbc9e8a 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -152,6 +152,14 @@ static DBusHandlerResult error_not_supported(DBusConnection *conn,
"Not supported");
}
+static DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn,
+ DBusMessage *msg, int err)
+{
+ return error_common_reply(conn, msg,
+ ERROR_INTERFACE ".ConnectionAttemptFailed",
+ err > 0 ? strerror(err) : "Connection attempt failed");
+}
+
static int rfcomm_connect(struct audio_device *device, headset_stream_cb_t cb,
void *user_data, unsigned int *cb_id);
static int get_records(struct audio_device *device, headset_stream_cb_t cb,
diff --git a/common/error.c b/common/error.c
index d6f321bd..825cde4f 100644
--- a/common/error.c
+++ b/common/error.c
@@ -35,19 +35,6 @@
#include "error.h"
-/**
- org.bluez.Error.ConnectionAttemptFailed:
-
- An unexpected error (other than DeviceUnreachable) error has occured while
- attempting a connection to a device
-*/
-DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn, DBusMessage *msg, int err)
-{
- return error_common_reply(conn, msg,
- ERROR_INTERFACE ".ConnectionAttemptFailed",
- err > 0 ? strerror(err) : "Connection attempt failed");
-}
-
/* Helper function - internal use only */
DBusHandlerResult error_common_reply(DBusConnection *conn, DBusMessage *msg,
const char *name, const char *descr)
diff --git a/common/error.h b/common/error.h
index 63ce2069..644e385f 100644
--- a/common/error.h
+++ b/common/error.h
@@ -27,9 +27,5 @@
#define ERROR_INTERFACE "org.bluez.Error"
-DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn,
- DBusMessage *msg,
- int err);
-
DBusHandlerResult error_common_reply(DBusConnection *conn, DBusMessage *msg,
const char *name, const char *descr);
diff --git a/src/adapter.c b/src/adapter.c
index 0adfffd9..a31b47f2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -154,6 +154,14 @@ static DBusHandlerResult error_failed_errno(DBusConnection *conn,
return error_failed(conn, msg, desc);
}
+static DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn,
+ DBusMessage *msg, int err)
+{
+ return error_common_reply(conn, msg,
+ ERROR_INTERFACE ".ConnectionAttemptFailed",
+ err > 0 ? strerror(err) : "Connection attempt failed");
+}
+
static int auth_req_cmp(const void *p1, const void *p2)
{
const struct pending_auth_info *pb1 = p1;