summaryrefslogtreecommitdiffstats
path: root/audio/control.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-02 14:34:58 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-02 14:34:58 +0000
commitb6029c0ffd7facd5f41bd665c84043d08961847d (patch)
tree76de65ffbf222a3f080a5e79c301639761b5ab99 /audio/control.c
parent08e3720b8860a0aef687e841533bd30ee22cc534 (diff)
Make audio service to use libgdbus functions.
Diffstat (limited to 'audio/control.c')
-rw-r--r--audio/control.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/audio/control.c b/audio/control.c
index b10fb1dd..c9663a26 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -920,7 +920,7 @@ void avrcp_exit(void)
connection = NULL;
}
-static DBusHandlerResult control_is_connected(DBusConnection *conn,
+static DBusMessage *control_is_connected(DBusConnection *conn,
DBusMessage *msg,
void *data)
{
@@ -931,24 +931,22 @@ static DBusHandlerResult control_is_connected(DBusConnection *conn,
reply = dbus_message_new_method_return(msg);
if (!reply)
- return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ return NULL;
connected = (control->session != NULL);
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &connected,
DBUS_TYPE_INVALID);
- send_message_and_unref(conn, reply);
-
- return DBUS_HANDLER_RESULT_HANDLED;
+ return reply;
}
-static DBusMethodVTable control_methods[] = {
- { "IsConnected", control_is_connected, "", "b" },
+static GDBusMethodTable control_methods[] = {
+ { "IsConnected", "", "b", control_is_connected },
{ NULL, NULL, NULL, NULL }
};
-static DBusSignalVTable control_signals[] = {
+static GDBusSignalTable control_signals[] = {
{ "Connected", "" },
{ "Disconnected", "" },
{ NULL, NULL }
@@ -956,10 +954,10 @@ static DBusSignalVTable control_signals[] = {
struct control *control_init(struct audio_device *dev)
{
- if (!dbus_connection_register_interface(dev->conn, dev->path,
- AUDIO_CONTROL_INTERFACE,
- control_methods,
- control_signals, NULL))
+ if (!g_dbus_register_interface(dev->conn, dev->path,
+ AUDIO_CONTROL_INTERFACE,
+ control_methods, control_signals, NULL,
+ dev, NULL))
return NULL;
return g_new0(struct control, 1);