diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-06-06 20:01:16 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-06-07 13:41:18 -0700 |
commit | cd1eab1f790e3b7cda86dd28ae658d7bbe5a7894 (patch) | |
tree | df849f7393ccaf34ec479a177cf74350288ed72c /binding-bluetooth/bluez-client.c | |
parent | 950280341c4bf12b1f85ab730a061f7a9c893a92 (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 'binding-bluetooth/bluez-client.c')
-rw-r--r-- | binding-bluetooth/bluez-client.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/binding-bluetooth/bluez-client.c b/binding-bluetooth/bluez-client.c index 334a2b6..d078d06 100644 --- a/binding-bluetooth/bluez-client.c +++ b/binding-bluetooth/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)); + } } } |