#define BT_CHECK_INPUT_PARAMETER(arg) \
if (arg == NULL) { \
- LOGE("[%s] INVALID_PARAMETER(0%s=NULL)", __FUNCTION__, #arg); \
+ LOGE("[%s] INVALID_PARAMETER(%s=NULL)", __FUNCTION__, #arg); \
return BT_ERROR_INVALID_PARAMETER; \
}
break;
}
- if (service_change->change_type
- == BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD) {
+ if (service_change->change_type == BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD) {
for (l = client->services; l; l = g_slist_next(l)) {
svc = l->data;
#ifdef TIZEN_GATT_CLIENT
#endif
}
if (l) {
- BT_INFO("already added service : %s", svc->path);
+ BT_INFO("already added service");
break;
}
#ifdef TIZEN_GATT_CLIENT
break;
}
#else
- svc = _bt_gatt_client_add_service(client,
- service_change->svc_path);
+ svc = _bt_gatt_client_add_service(client, service_change->svc_path);
if (svc == NULL) {
BT_ERR("_bt_gatt_client_add_service is failed");
break;
BT_GATT_CLIENT_SERVICE_ADDED,
service_change->uuid,
client->service_changed_user_data);
- } else {
- char *removed_uuid = NULL;
-
+ } else { /* BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE */
for (l = client->services; l; l = g_slist_next(l)) {
svc = l->data;
#ifdef TIZEN_GATT_CLIENT
break;
}
+#ifdef TIZEN_GATT_CLIENT
BT_INFO("Service(%s) is removed", svc->uuid);
- removed_uuid = g_strdup(svc->uuid);
+ client->services_discovered = false;
+ ret = _bt_gatt_client_update_services(client);
+ if (ret != BT_ERROR_NONE) {
+ BT_ERR("_bt_gatt_client_update_services is failed");
+ break;
+ }
+#else
bt_gatt_service_destroy((bt_gatt_h)svc);
+#endif
if (client->connected && client->service_changed_cb)
client->service_changed_cb(client,
BT_GATT_CLIENT_SERVICE_REMOVED,
- removed_uuid,
+ service_change->uuid,
client->service_changed_user_data);
- g_free(removed_uuid);
}
break;
}