Revert a internal API 07/89007/1
authorTaejin Woo <tt.woo@samsung.com>
Wed, 21 Sep 2016 11:12:49 +0000 (20:12 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Wed, 21 Sep 2016 11:13:34 +0000 (20:13 +0900)
Change-Id: Ida51834443c986398e26349b9a925a144f28a8a9
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
src/bluetooth-gatt.c

index 5969f4205e5f676d9f7ea740d592ae941ea70899..b5d6b54faf4b91cfdfa699adbb0cfd8eb089550c 100644 (file)
@@ -1068,6 +1068,28 @@ static int __get_data_type_int_size(bt_data_type_int_e format)
        }
 }
 
+int bt_gatt_destroy(bt_gatt_h gatt_handle)
+{
+       bt_gatt_common_s *handle = (bt_gatt_common_s *)gatt_handle;
+
+       BT_CHECK_GATT_SUPPORT();
+       BT_CHECK_INIT_STATUS();
+       BT_CHECK_INPUT_PARAMETER(gatt_handle);
+
+       if (handle->type == BT_GATT_TYPE_SERVICE)
+               __bt_gatt_destroy_service(gatt_handle);
+       else if (handle->type == BT_GATT_TYPE_CHARACTERISTIC)
+               __bt_gatt_destroy_characteristic(gatt_handle);
+       else if (handle->type == BT_GATT_TYPE_DESCRIPTOR)
+               __bt_gatt_destroy_descriptor(gatt_handle);
+       else {
+               BT_ERR("Type is invalid(type:%d)", handle->type);
+               return BT_ERROR_INVALID_PARAMETER;
+       }
+
+       return BT_ERROR_NONE;
+}
+
 int bt_gatt_service_destroy(bt_gatt_h gatt_handle)
 {
        bt_gatt_common_s *handle = (bt_gatt_common_s *)gatt_handle;