From: h.sandeep Date: Fri, 24 Mar 2017 10:42:18 +0000 (+0530) Subject: GATT-Client: Fix Primary list overwrite issue. X-Git-Tag: accepted/tizen/common/20170327.142440^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F41%2F120841%2F1;p=platform%2Fupstream%2Fbluez.git GATT-Client: Fix Primary list overwrite issue. This patch fixes the primary list getting overwrite while registering the gatt services in client role of bluez code when the gatt plugins are enabled. This isuue was leading to CAPI layer failure to fetch the primary service after connection. Change-Id: Ib8bceab634c23520828d10010641647243a6aac5 Signed-off-by: h.sandeep --- diff --git a/src/device.c b/src/device.c index c87a0f6..430f165 100644 --- a/src/device.c +++ b/src/device.c @@ -6411,8 +6411,14 @@ static void register_gatt_services(struct btd_device *device) update_gatt_uuids(req, device->primaries, services); #endif +#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + /* do not delete existing primary list, + * just append the new primary uuids, + * the list will be modifed when service changed + * indication is received during connection */ g_slist_free_full(device->primaries, g_free); device->primaries = NULL; +#endif device_register_primaries(device, services, -1); @@ -6435,10 +6441,19 @@ static void gatt_client_ready_cb(bool success, uint8_t att_ecode, return; } +#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + /* Register the services after setting the client is ready + * and exporting all the services and characteristics paths. + */ register_gatt_services(device); +#endif btd_gatt_client_ready(device->client_dbus); +#ifdef TIZEN_FEATURE_BLUEZ_MODIFY + register_gatt_services(device); +#endif + /* * Update the GattServices property. Do this asynchronously since this * should happen after the "Characteristics" and "Descriptors"