summaryrefslogtreecommitdiffstats
path: root/audio/headset.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-05-18 18:26:56 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-05-18 18:26:56 +0000
commitfb1612c37310e09e8503a113c0114c0ba9584c99 (patch)
treefb20e401b193bb9d3966b5787d25bcb6d492e12e /audio/headset.c
parent00a7a482ac18b339a311c0afb89741d6b3978f0e (diff)
Update code to match more closely to API description
Diffstat (limited to 'audio/headset.c')
-rw-r--r--audio/headset.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/audio/headset.c b/audio/headset.c
index edd59b4b..dbebf67c 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1202,20 +1202,14 @@ static DBusHandlerResult hs_is_connected(DBusConnection *conn, DBusMessage *msg,
void *data)
{
audio_device_t *device = data;
- struct headset *hs = device->headset;
DBusMessage *reply;
dbus_bool_t connected;
- assert(hs);
-
reply = dbus_message_new_method_return(msg);
if (!reply)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
- if (hs->state >= HEADSET_STATE_CONNECTED)
- connected = TRUE;
- else
- connected = FALSE;
+ connected = headset_is_connected(device->headset);
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &connected,
DBUS_TYPE_INVALID);
@@ -1746,6 +1740,14 @@ static GIOChannel *server_socket(uint8_t *channel)
return io;
}
+gboolean headset_is_connected(headset_t *headset)
+{
+ if (headset->state >= HEADSET_STATE_CONNECTED)
+ return TRUE;
+ else
+ return FALSE;
+}
+
int headset_server_init(DBusConnection *conn)
{
uint8_t chan = DEFAULT_HS_AG_CHANNEL;