API addition for destroying Gatt service, characteristic or descritor handle 98/70098/1
authorHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 18 May 2016 06:00:51 +0000 (15:00 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 18 May 2016 06:00:51 +0000 (15:00 +0900)
Change-Id: I63c4d63482c1d9c267eb3e751ea651e8b9d33a20
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
include/mobile/bluetooth_internal.h
include/tv/bluetooth_internal.h
include/wearable/bluetooth_internal.h
src/bluetooth-gatt.c

index b0a1db98c2db7e2e48a5175bdf6f7b9ce03c7dd7..01d488171ad240e497b66804daacb1c296ac8b33 100644 (file)
@@ -1768,6 +1768,51 @@ int bt_gatt_get_uuid_specification_name(const char *uuid, char **name);
  */
 int bt_gatt_destroy(bt_gatt_h gatt_handle);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of service
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_service_create()
+ */
+int bt_gatt_service_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of characteristic
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_characteristic_create()
+ */
+int bt_gatt_characteristic_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of descriptor
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_descriptor_create()
+ */
+int bt_gatt_descriptor_destroy(bt_gatt_h gatt_handle);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief  Gets the permissions which a characteristic or descriptor's GATT handle has
index 9e0072a9bd78e594f861d50e43556067aaa9498e..3666d282a7acb987090d017d350d7f35a7736785 100644 (file)
@@ -1768,6 +1768,51 @@ int bt_gatt_get_uuid_specification_name(const char *uuid, char **name);
  */
 int bt_gatt_destroy(bt_gatt_h gatt_handle);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of service
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_service_create()
+ */
+int bt_gatt_service_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of characteristic
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_characteristic_create()
+ */
+int bt_gatt_characteristic_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of descriptor
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_descriptor_create()
+ */
+int bt_gatt_descriptor_destroy(bt_gatt_h gatt_handle);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief  Gets the permissions which a characteristic or descriptor's GATT handle has
index 772e75f46d829b8632100bd0cf7046ed7b3b75da..32018d989cc90aec726b3b4a2ec4409b394fd1da 100644 (file)
@@ -2413,6 +2413,51 @@ int bt_gatt_get_uuid_specification_name(const char *uuid, char **name);
  */
 int bt_gatt_destroy(bt_gatt_h gatt_handle);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of service
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_service_create()
+ */
+int bt_gatt_service_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of characteristic
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_characteristic_create()
+ */
+int bt_gatt_characteristic_destroy(bt_gatt_h gatt_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief Destroys the GATT handle
+ * @since_tizen 2.4
+ *
+ * @param[in] gatt_handle The handle of descriptor
+ * @return  0 on success, otherwise a negative error value
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @see bt_gatt_descriptor_create()
+ */
+int bt_gatt_descriptor_destroy(bt_gatt_h gatt_handle);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief  Gets the permissions which a characteristic or descriptor's GATT handle has
index 80af36189e7e3abd30ca6c654edd45679ad5d856..db2fe7030c1a8e4ac161f5ad96de3827d8088571 100644 (file)
@@ -898,6 +898,61 @@ int bt_gatt_destroy(bt_gatt_h gatt_handle)
 
        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;
+
+       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 {
+               BT_ERR("Type is invalid(type:%d)", handle->type);
+               return BT_ERROR_INVALID_PARAMETER;
+       }
+
+       return BT_ERROR_NONE;
+}
+
+int bt_gatt_characteristic_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_CHARACTERISTIC)
+               __bt_gatt_destroy_characteristic(gatt_handle);
+       else {
+               BT_ERR("Type is invalid(type:%d)", handle->type);
+               return BT_ERROR_INVALID_PARAMETER;
+       }
+
+       return BT_ERROR_NONE;
+}
+
+int bt_gatt_descriptor_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_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;
+}
+
 /* LCOV_EXCL_STOP */
 
 int bt_gatt_get_value(bt_gatt_h gatt_handle, char **value, int *value_length)