summaryrefslogtreecommitdiffstats
path: root/audio/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-27 23:07:19 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-27 23:07:19 +0000
commit7299869ac79b76564cd68411acb18f4233ddbbb7 (patch)
tree6773d52943cb4e6cf04e51f5ed0702bd37dc8169 /audio/device.c
parentbec69df1c6672579961d96b718b8703650d01322 (diff)
Convert audio service into a plugin.
Diffstat (limited to 'audio/device.c')
-rw-r--r--audio/device.c57
1 files changed, 2 insertions, 55 deletions
diff --git a/audio/device.c b/audio/device.c
index 7510d9a4..7e25fe90 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -218,60 +218,6 @@ static void device_unregister(DBusConnection *conn, void *data)
device_free(device);
}
-char *find_adapter(DBusConnection *conn, bdaddr_t *src)
-{
- DBusMessage *msg, *reply;
- DBusError derr;
- char address[18], *addr_ptr = address;
- char *path, *ret;
-
- msg = dbus_message_new_method_call("org.bluez", "/org/bluez",
- "org.bluez.Manager",
- "FindAdapter");
- if (!msg) {
- error("Unable to allocate new method call");
- return NULL;
- }
-
- ba2str(src, address);
-
- dbus_message_append_args(msg, DBUS_TYPE_STRING, &addr_ptr,
- DBUS_TYPE_INVALID);
-
- dbus_error_init(&derr);
- reply = dbus_connection_send_with_reply_and_block(conn, msg, -1,
- &derr);
-
- dbus_message_unref(msg);
-
- if (dbus_error_is_set(&derr) ||
- dbus_set_error_from_message(&derr, reply)) {
- error("FindAdapter(%s) failed: %s", address, derr.message);
- dbus_error_free(&derr);
- return NULL;
- }
-
- dbus_error_init(&derr);
- dbus_message_get_args(reply, &derr,
- DBUS_TYPE_STRING, &path,
- DBUS_TYPE_INVALID);
-
- if (dbus_error_is_set(&derr)) {
- error("Unable to get message args");
- dbus_message_unref(reply);
- dbus_error_free(&derr);
- return FALSE;
- }
-
- ret = g_strdup(path);
-
- dbus_message_unref(reply);
-
- debug("Got path %s for adapter with address %s", ret, address);
-
- return ret;
-}
-
struct device *device_register(DBusConnection *conn,
const char *path, bdaddr_t *bda)
{
@@ -289,7 +235,8 @@ struct device *device_register(DBusConnection *conn,
dev = g_new0(struct device, 1);
- dev->adapter_path = find_adapter(conn, &src);
+ /* FIXME just to maintain compatibility */
+ dev->adapter_path = g_strdup_printf("/org/bluez/hci%d", dev_id);
if (!dev->adapter_path) {
device_free(dev);
return NULL;