From: dh79pyun Date: Fri, 29 Oct 2021 00:49:53 +0000 (+0900) Subject: Handle BT_GATT_CLIENT_SERVICE_RESYNC event X-Git-Tag: submit/tizen/20211101.044616~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6126dcc85af760ece24228abb62953a027af16a;p=platform%2Fcore%2Fapi%2Fbluetooth.git Handle BT_GATT_CLIENT_SERVICE_RESYNC event Change-Id: I86582b12e6e89e9a3c6fe20ce3aedeabbb333036 Signed-off-by: dh79pyun --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 1cadb78..136c2eb 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -3044,11 +3044,13 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us _bt_convert_address_to_string(&device_addr, &service_change->device_addr); +#if 0 /* Check if TDS Service removed */ _bt_tds_check_service_changed(device_addr, service_change); /* Check if OTS Service removed */ _bt_otp_check_service_changed(device_addr, service_change); +#endif client = _bt_gatt_get_client(device_addr); if (device_addr != NULL) @@ -3096,7 +3098,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us BT_GATT_CLIENT_SERVICE_ADDED, service_change->uuid, client->service_changed_user_data); - } else { /* BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE */ + } else if (service_change->change_type == BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE) { for (l = client->services; l; l = g_slist_next(l)) { svc = l->data; #ifdef TIZEN_GATT_CLIENT @@ -3129,6 +3131,16 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us BT_GATT_CLIENT_SERVICE_REMOVED, service_change->uuid, client->service_changed_user_data); + } else { + BT_INFO("Service resync is required"); + + client->services_discovered = false; + + if (client->connected && client->service_changed_cb) + client->service_changed_cb(client, + BT_GATT_CLIENT_SERVICE_RESYNC, + service_change->uuid, + client->service_changed_user_data); } break; }