From 0b784a75274149c0994d9bdd39dcde804676fcfa Mon Sep 17 00:00:00 2001 From: "injun.yang" Date: Mon, 4 May 2020 20:35:57 +0900 Subject: [PATCH] Remove the duplicated service from gatt_list_service [Model] All [BinType] AP [Customer] OPEN [Issue#] P200428-01509 [Request] Internal [Occurrence Version] N/A [Problem] bt-service access to the removed GATT service to get service information [Cause & Measure] Whenever client app registered, duplicated service added to gatt_list_serice. Eventhough GATT service removed from server, all of the duplicated service is not removed from the list. So gatt_list_service should have a unique service for each device. [Checking Method] n/a [Team] Convergence BT [Developer] Injun Yang [Solution company] Samsung [Change Type] Specification change Change-Id: If7898b33a572f4b446b04b5d788c6360c3e8fbab Signed-off-by: Wootak Jung --- bt-oal/bluez_hal/src/bt-hal-gatt-client.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c index 641d324..bc8ba93 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c @@ -691,6 +691,14 @@ static void _gattc_create_new_service(hal_gattc_server_info_t *conn_info, gboole hal_gattc_service_t* gatt_svc = NULL; int i; gchar *gp_char_path = NULL; + uint8_t uuid[BT_HAL_STACK_UUID_SIZE]; + + _bt_hal_convert_uuid_string_to_type(uuid, uuid_str); + gatt_svc = _gattc_find_service_from_uuid(conn_info, (bt_uuid_t *)uuid); + if (gatt_svc) { + DBG("Aleady added to gatt_list_services"); + return; + } /* add the service */ gatt_svc = _hal_gatt_client_add_service(conn_info, uuid_str, object_path, is_primary); -- 2.7.4