summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-04-08 20:08:48 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-04-08 20:08:48 +0000
commitebfe5886d05091a0d2398182a432241435ae2956 (patch)
treeeca70552386570638adba767c930f80a20c19a76 /audio
parentfa83abed5f41a567175c9b734fba55fa979f455a (diff)
Call it audio service
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 81d25550..fcff8174 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2,7 +2,7 @@
*
* BlueZ - Bluetooth protocol stack for Linux
*
- * Copyright (C) 2005-2006 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
*
*
* This program is free software; you can redistribute it and/or modify
@@ -1963,38 +1963,6 @@ void audio_manager_free(struct manager *manager)
g_free(manager);
}
-static gboolean register_service(const char *ident, const char *name,
- const char *desc)
-{
- DBusMessage *msg, *reply;
- DBusError derr;
-
- msg = dbus_message_new_method_call("org.bluez", "/org/bluez",
- "org.bluez.Database", "RegisterService");
-
- if (!msg) {
- error("Unable to allocate new message");
- return FALSE;
- }
-
- dbus_message_append_args(msg, DBUS_TYPE_STRING, &ident,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_STRING, &desc,
- DBUS_TYPE_INVALID);
-
- dbus_error_init(&derr);
- reply = dbus_connection_send_with_reply_and_block(connection, msg, -1, &derr);
- if (dbus_error_is_set(&derr)) {
- error("RegisterService: %s", derr.message);
- dbus_error_free(&derr);
- return FALSE;
- }
-
- dbus_message_unref(reply);
-
- return TRUE;
-}
-
static void sig_term(int sig)
{
g_main_loop_quit(main_loop);
@@ -2044,7 +2012,7 @@ int main(int argc, char *argv[])
if (optind < argc && argv[optind])
opt_bda = argv[optind];
- start_logging("headset", "Bluetooth headset service daemon");
+ start_logging("audio", "Bluetooth audio service daemon");
memset(&sa, 0, sizeof(sa));
sa.sa_flags = SA_NOCLDSTOP;
@@ -2065,13 +2033,8 @@ int main(int argc, char *argv[])
exit(1);
}
- if (register_svc && !register_service("headset", "Headset service",
- "Headset service")) {
- error("Unable to register service");
- dbus_connection_unref(connection);
- g_main_loop_unref(main_loop);
- exit(1);
- }
+ if (register_svc)
+ register_external_service(connection, "audio", "Audio service", "");
manager = audio_manager_new(connection);
if (!manager) {