diff options
author | Marc-André Lureau <marc-andre.lureau@nokia.com> | 2009-03-27 13:56:26 +0200 |
---|---|---|
committer | Marc-André Lureau <marc-andre.lureau@nokia.com> | 2009-03-27 22:59:56 +0200 |
commit | 38825d79123678bf0c5d156aaea4bedb888a7fcd (patch) | |
tree | fb7a1489b03837151b892efd59513f2c3fb0733f /src/modules/bluetooth/bluetooth-util.c | |
parent | 20bd1c686ca3facb647db7189470ab1bcdae48b5 (diff) |
bluetooth: GetProperties after profile UUID show up
Diffstat (limited to 'src/modules/bluetooth/bluetooth-util.c')
-rw-r--r-- | src/modules/bluetooth/bluetooth-util.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 3d410c52..dfebf663 100644 --- a/src/modules/bluetooth/bluetooth-util.c +++ b/src/modules/bluetooth/bluetooth-util.c @@ -39,6 +39,9 @@ struct pa_bluetooth_discovery { pa_hook hook; }; +static void get_properties_reply(DBusPendingCall *pending, void *userdata); +static pa_dbus_pending* send_and_add_to_pending(pa_bluetooth_discovery *y, pa_bluetooth_device *d, DBusMessage *m, DBusPendingCallNotifyFunction func); + static pa_bluetooth_uuid *uuid_new(const char *uuid) { pa_bluetooth_uuid *u; @@ -213,11 +216,20 @@ static int parse_device_property(pa_bluetooth_discovery *y, pa_bluetooth_device while (dbus_message_iter_get_arg_type(&ai) != DBUS_TYPE_INVALID) { pa_bluetooth_uuid *node; const char *value; + DBusMessage *m; dbus_message_iter_get_basic(&ai, &value); node = uuid_new(value); PA_LLIST_PREPEND(pa_bluetooth_uuid, d->uuids, node); + if (strcasecmp(HSP_HS_UUID, value) == 0 || strcasecmp(HFP_HS_UUID, value) == 0) { + pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.Headset", "GetProperties")); + send_and_add_to_pending(y, d, m, get_properties_reply); + } else if (strcasecmp(A2DP_SINK_UUID, value) == 0) { + pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.AudioSink", "GetProperties")); + send_and_add_to_pending(y, d, m, get_properties_reply); + } + if (!dbus_message_iter_next(&ai)) break; } |