summaryrefslogtreecommitdiffstats
path: root/bluez-client.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-06-06 20:01:16 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-06-07 13:41:18 -0700
commitd074104294bf19d9bda3ddd6ddb110d3563472a7 (patch)
tree6f9ec2b63bbbd454a9da90ee27ba20b4423031b0 /bluez-client.c
parent8ee62398d467a4031a4307199687812f5105e500 (diff)
binding: bluetooth: available BT UUID profiles reporting
Since selection connect/disconnect can be done to a certain BT UUID profiles the available ones need to be listed to subscribers. Change-Id: I4497838ef2f9dd5e6fc40f1364a8b5f165a1831d Bug-AGL: SPEC-638 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'bluez-client.c')
-rw-r--r--bluez-client.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/bluez-client.c b/bluez-client.c
index 334a2b6..d078d06 100644
--- a/bluez-client.c
+++ b/bluez-client.c
@@ -58,7 +58,7 @@ static struct bt_device *bluez_device_copy(struct bt_device* device)
temp->avconnected = device->avconnected;
temp->legacypairing = device->legacypairing;
temp->rssi = device->rssi;
- temp->uuids = g_variant_ref(device->uuids);
+ temp->uuids = g_list_copy(device->uuids);
return temp;
}
@@ -96,7 +96,7 @@ static void bluez_device_free(struct bt_device* device)
if (device->uuids){
D_PRINTF("uuids xxx\n");
- g_variant_unref(device->uuids);
+ g_list_free_full(device->uuids, g_free);
device->uuids = NULL;
}
@@ -310,11 +310,19 @@ bluez_device1_properties_update(struct bt_device *device, GVariant *value)
device->rssi = value_n;
}else if (0==g_strcmp0(key,"UUIDs")) {
- //g_print ("type '%s'\n", g_variant_get_type_string (subValue));
- if (device->uuids)
- g_variant_unref(device->uuids);
- device->uuids = g_variant_new_variant(subValue);
+ GVariantIter iter;
+ gchar *val;
+ //g_print ("type '%s'\n", g_variant_get_type_string (subValue));
+ if (device->uuids) {
+ g_list_free_full(device->uuids, g_free);
+ }
+
+ g_variant_iter_init (&iter, subValue);
+ while (g_variant_iter_next (&iter, "s", &val))
+ {
+ device->uuids = g_list_append(device->uuids, g_strdup(val));
+ }
}
}