summaryrefslogtreecommitdiffstats
path: root/binding-bluetooth/bluetooth-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding-bluetooth/bluetooth-api.c')
-rw-r--r--binding-bluetooth/bluetooth-api.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/binding-bluetooth/bluetooth-api.c b/binding-bluetooth/bluetooth-api.c
index cf6e427..61fa204 100644
--- a/binding-bluetooth/bluetooth-api.c
+++ b/binding-bluetooth/bluetooth-api.c
@@ -249,9 +249,13 @@ static json_object *new_json_object_from_device(struct btd_device *BDdevice, uns
if (BD_HFPCONNECTED & filter)
{
- jstring = (TRUE == BDdevice->hfpconnected) ?
- json_object_new_string("True"):json_object_new_string("False");
- json_object_object_add(jresp, "HFPConnected", jstring);
+ gpointer found = NULL;
+
+ if (BDdevice->connected)
+ found = g_list_find_custom(BDdevice->uuids, HFP_UUID, strcmp);
+
+ json_object_object_add(jresp, "HFPConnected",
+ json_object_new_string(found ? "True": "False"));
}
if (BD_UUID_PROFILES & filter)