From 99f11aef6e94064b872eb4928ba0acad0b399217 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 29 Dec 2014 11:05:06 -0200 Subject: [PATCH] core/gatt: Don't export claimed services GattService1 objects for services which are claimed by an internal profile are no longer exported. This is to prevent conflicts that may arise between internal plugins and external applications that wish to access the same GATT service. --- src/device.c | 3 +++ src/gatt-client.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/device.c b/src/device.c index f13d9aa7f..0abed9b06 100644 --- a/src/device.c +++ b/src/device.c @@ -2483,6 +2483,9 @@ static void dev_probe_gatt(struct btd_profile *p, void *user_data) return; } + /* Mark service as claimed */ + gatt_db_service_set_active(data->cur_attr, false); + data->dev->services = g_slist_append(data->dev->services, service); if (data->all_services) diff --git a/src/gatt-client.c b/src/gatt-client.c index 809aca5a0..47faf86d4 100644 --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -1251,6 +1251,9 @@ static void export_service(struct gatt_db_attribute *attr, void *user_data) struct btd_gatt_client *client = user_data; struct service *service; + if (!gatt_db_service_get_active(attr)) + return; + service = service_create(attr, client); if (!service) return; -- 2.47.3