Add gatt service changed callback APIs 90/87190/5
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 7 Sep 2016 01:34:43 +0000 (10:34 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Mon, 12 Sep 2016 10:12:12 +0000 (03:12 -0700)
Change-Id: I455f1e8015e1a09d57248db1be450344a012a5ca
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bluetooth_private.h
include/mobile/bluetooth.h
include/mobile/bluetooth_type.h
include/tv/bluetooth.h
include/tv/bluetooth_type.h
include/wearable/bluetooth.h
include/wearable/bluetooth_type.h

index c774406..87981db 100644 (file)
@@ -262,15 +262,6 @@ int bt_adapter_set_passkey_notification(bt_adapter_passkey_notification_cb callb
  */
 int bt_adapter_unset_passkey_notification(void);
 
-typedef enum {
-       BT_GATT_CLIENT_SERVICE_ADDED,
-       BT_GATT_CLIENT_SERVICE_REMOVED,
-} bt_gatt_client_service_change_type_e;
-
-typedef void (*bt_gatt_client_service_changed_cb) (bt_gatt_client_h client,
-               bt_gatt_client_service_change_type_e change_type,
-               const char* service_uuid, void *user_data);
-
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
  * @brief  Enumerations of the Bluetooth device's LE connection mode.
@@ -1029,39 +1020,6 @@ int bt_passkey_reply(char *passkey, bool authentication_reply);
 int bt_passkey_confirmation_reply(bool confirmation_reply);
 
 /**
- * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
- * @brief  Registers a callback function to be invoked when service is changed from a remote device(GATT server).
- * @since_tizen 3.0
- *
- * @param[in] client The GATT client's handle
- * @param[in] callback The callback to be invoked
- * @param[in] user_data The user data to be passed to @a callback function
- * @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_client_unset_service_changed_cb()
- */
-int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
-               bt_gatt_client_service_changed_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
- * @brief  Unregisters a callback function
- * @since_tizen 3.0
- *
- * @param[in] client The GATT client's handle
- * @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_client_unset_service_changed_cb()
- */
-int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
-
-/**
  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
  * @brief Sends the custom event data.
  * @since_tizen 3.0
index a712b3e..2d10b81 100644 (file)
@@ -4509,6 +4509,39 @@ int bt_gatt_client_foreach_services(bt_gatt_client_h client,
 
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Registers a callback function to be invoked when service is changed from a remote device(GATT server).
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @param[in] callback The callback to be invoked
+ * @param[in] user_data The user data to be passed to @a callback function
+ * @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_client_unset_service_changed_cb()
+ */
+int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
+               bt_gatt_client_service_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Unregisters a callback function
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @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_client_set_service_changed_cb()
+ */
+int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Connect to a specific LE based service on a remote bluetooth device address, asynchronously.
  * @since_tizen 2.3
  * @privlevel public
index a167214..6318f98 100644 (file)
@@ -697,6 +697,16 @@ typedef enum {
 } bt_gatt_property_e;
 
 /**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Enumerations of gatt server's service changing mode.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       BT_GATT_CLIENT_SERVICE_ADDED,   /**< Service added */
+       BT_GATT_CLIENT_SERVICE_REMOVED, /**< Service removed */
+} bt_gatt_client_service_change_type_e;
+
+/**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
  * @brief  Enumerations of the attribute's permission.
  * @since_tizen 3.0
@@ -1718,6 +1728,22 @@ typedef void (*bt_gatt_client_characteristic_value_changed_cb) (bt_gatt_h charac
 
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Called when a service of a remote GATT server has been changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] client The handle of a GATT client which is associated with a remote device.
+ * @param[in] change_type The changed type
+ * @param[in] service_uuid The changed service uuid
+ * @param[in] user_data The user data passed from the registering function
+ *
+ * @see bt_gatt_client_set_characteristic_value_changed_cb()
+ */
+typedef void (*bt_gatt_client_service_changed_cb) (bt_gatt_client_h client,
+               bt_gatt_client_service_change_type_e change_type,
+               const char* service_uuid, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Called when the connection state is changed.
  * @since_tizen 2.3
  *
index 31eab35..ef9bce7 100644 (file)
@@ -4512,6 +4512,39 @@ int bt_gatt_client_foreach_services(bt_gatt_client_h client,
 
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Registers a callback function to be invoked when service is changed from a remote device(GATT server).
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @param[in] callback The callback to be invoked
+ * @param[in] user_data The user data to be passed to @a callback function
+ * @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_client_unset_service_changed_cb()
+ */
+int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
+               bt_gatt_client_service_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Unregisters a callback function
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @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_client_set_service_changed_cb()
+ */
+int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Connect to a specific LE based service on a remote bluetooth device address, asynchronously.
  * @since_tizen 2.3
  * @privlevel public
index b5b1fde..e498338 100644 (file)
@@ -697,6 +697,16 @@ typedef enum {
 } bt_gatt_property_e;
 
 /**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Enumerations of gatt server's service changing mode.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       BT_GATT_CLIENT_SERVICE_ADDED,   /**< Service added */
+       BT_GATT_CLIENT_SERVICE_REMOVED, /**< Service removed */
+} bt_gatt_client_service_change_type_e;
+
+/**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
  * @brief  Enumerations of the attribute's permission.
  * @since_tizen 3.0
@@ -1716,6 +1726,23 @@ typedef void (*bt_gatt_client_request_completed_cb) (int result,
 typedef void (*bt_gatt_client_characteristic_value_changed_cb) (bt_gatt_h characteristic,
                char *value, int len, void *user_data);
 
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Called when a service of a remote GATT server has been changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] client The handle of a GATT client which is associated with a remote device.
+ * @param[in] change_type The changed type
+ * @param[in] service_uuid The changed service uuid
+ * @param[in] user_data The user data passed from the registering function
+ *
+ * @see bt_gatt_client_set_characteristic_value_changed_cb()
+ */
+typedef void (*bt_gatt_client_service_changed_cb) (bt_gatt_client_h client,
+               bt_gatt_client_service_change_type_e change_type,
+               const char* service_uuid, void *user_data);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Called when the connection state is changed.
index c4bd766..2c5efc6 100644 (file)
@@ -4162,6 +4162,39 @@ int bt_gatt_client_foreach_services(bt_gatt_client_h client,
 
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Registers a callback function to be invoked when service is changed from a remote device(GATT server).
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @param[in] callback The callback to be invoked
+ * @param[in] user_data The user data to be passed to @a callback function
+ * @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_client_unset_service_changed_cb()
+ */
+int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
+               bt_gatt_client_service_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Unregisters a callback function
+ * @since_tizen 3.0
+ *
+ * @param[in] client The GATT client's handle
+ * @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_client_set_service_changed_cb()
+ */
+int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Connect to a specific LE based service on a remote bluetooth device address, asynchronously.
  * @since_tizen 2.3.1
  * @privlevel public
index 10a6767..37c47e7 100644 (file)
@@ -696,6 +696,16 @@ typedef enum {
 } bt_gatt_property_e;
 
 /**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Enumerations of gatt server's service changing mode.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       BT_GATT_CLIENT_SERVICE_ADDED,   /**< Service added */
+       BT_GATT_CLIENT_SERVICE_REMOVED, /**< Service removed */
+} bt_gatt_client_service_change_type_e;
+
+/**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
  * @brief  Enumerations of the attribute's permission.
  * @since_tizen 3.0
@@ -1591,6 +1601,23 @@ typedef void (*bt_gatt_client_request_completed_cb) (int result,
 typedef void (*bt_gatt_client_characteristic_value_changed_cb) (bt_gatt_h characteristic,
                char *value, int len, void *user_data);
 
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
+ * @brief  Called when a service of a remote GATT server has been changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] client The handle of a GATT client which is associated with a remote device.
+ * @param[in] change_type The changed type
+ * @param[in] service_uuid The changed service uuid
+ * @param[in] user_data The user data passed from the registering function
+ *
+ * @see bt_gatt_client_set_characteristic_value_changed_cb()
+ */
+typedef void (*bt_gatt_client_service_changed_cb) (bt_gatt_client_h client,
+               bt_gatt_client_service_change_type_e change_type,
+               const char* service_uuid, void *user_data);
+
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
  * @brief Called when the connection state is changed.