From 48c78f0835aaa14cdded296323036ea384cb181d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= Date: Tue, 11 Sep 2018 15:46:36 -0700 Subject: [PATCH] bluetooth: Add debug logging to profile creation Part-of: --- src/modules/bluetooth/module-bluez5-device.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 3ceda9713..0e49843c3 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -2195,11 +2195,18 @@ static int add_card(struct userdata *u) { if (uuid_to_profile(uuid, &profile) < 0) continue; - if (pa_hashmap_get(data.profiles, pa_bluetooth_profile_to_string(profile))) - continue; + pa_log_debug("Trying to create profile %s (%s) for device %s (%s)", + pa_bluetooth_profile_to_string(profile), uuid, d->alias, d->address); - if (!pa_bluetooth_device_supports_profile(d, profile)) + if (pa_hashmap_get(data.profiles, pa_bluetooth_profile_to_string(profile))) { + pa_log_debug("%s already exists", pa_bluetooth_profile_to_string(profile)); continue; + } + + if (!pa_bluetooth_device_supports_profile(d, profile)) { + pa_log_debug("%s is not supported by the device or adapter", pa_bluetooth_profile_to_string(profile)); + continue; + } cp = create_card_profile(u, profile, data.ports); pa_hashmap_put(data.profiles, cp->name, cp);