Apply tizen 3.0 based product patchsets 03/148103/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 6 Sep 2017 23:10:46 +0000 (08:10 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Tue, 12 Sep 2017 08:12:51 +0000 (08:12 +0000)
--------------------------------------------------
commit b1f1e05c0d97e98479b60a435eabb3419d23387d
Author: Deokhyun Kim <dukan.kim@samsung.com>
Date:   Wed Aug 30 14:33:26 2017 +0900

Change API name from bt_device_get_ida() to bt_device_get_id_address()
---------------------------------------------------

Change-Id: Ieb9d5e7ad8692bdc6e5db9116f00f0aec1c1d8c7
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bluetooth_internal.h
include/bluetooth_type_internal.h
src/bluetooth-device.c

index c8836f8a4c0dc072339a624653c7b96fa262677f..01b8061c4ced1d4391150a4f31a30d2d8bb6cdb2 100644 (file)
@@ -947,6 +947,7 @@ int bt_device_get_connection_state(const char *remote_address, bt_device_connect
 
 /**
  * @internal
+ * @deprecated Deprecated since 4.0. Use bt_device_set_profile_trusted instead.
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
  * @brief Sets a profile restricted connection for a device
  * @since_tizen 3.0
@@ -967,6 +968,7 @@ int bt_device_set_profile_restricted(const char *device_address, bt_restricted_p
 
 /**
  * @internal
+ * @deprecated Deprecated since 4.0. Use bt_device_get_profile_trusted instead.
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
  * @brief Gets a profile restricted connection for a device
  * @since_tizen 3.0
@@ -983,6 +985,36 @@ int bt_device_set_profile_restricted(const char *device_address, bt_restricted_p
  */
 int bt_device_get_profile_restricted(const char *device_address, bt_restricted_profile_t profile, int *restricted);
 
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief   Set a profile trusted or untrusted for a device.
+ * @since_tizen 4.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INTERNAL Internal Error
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not supported
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #BT_ERROR_NOT_ENABLED Invalid Parameter
+ */
+int bt_device_set_profile_trusted(const char *device_address,bt_trusted_profile_t profile, bool trust);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief   Get a profile is trusted or untrusted for a device.
+ * @since_tizen 4.0
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INTERNAL Internal Error
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not supported
+ * @retval #BT_ERROR_NOT_ENABLED Invalid Parameter
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid Parameter
+ */
+int bt_device_get_profile_trusted(const char *device_address,bt_trusted_profile_t profile, int *trust);
+
 /**
  * @internal
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
index a61821bb2f8b4a7902f06b651f34f3962027356a..da3eee105ffba38a13e74294cce84b16f780d50d 100644 (file)
@@ -650,6 +650,7 @@ typedef enum {
 } bt_trusted_profile_t;
 
 /**
+ * @deprecated Deprecated since 4.0. Use bt_trusted_profile_t instead.
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
  * @brief Restricted Profile enumeration.
  * @since_tizen 3.0
index 974eb55051b3af508a57698905205d042f7c26ec..98edb2c8ff4ecfd23e9411fcb65808fe46da0ce4 100644 (file)
@@ -802,7 +802,7 @@ int bt_device_get_att_mtu(const char *remote_address, unsigned int *mtu)
 
 }
 
-int bt_device_get_ida(const char *remote_rpa, char **id_address)
+int bt_device_get_id_address(const char *remote_rpa, char **id_address)
 {
        bluetooth_device_address_t id_addr = { {0} };
        bluetooth_device_address_t addr_hex = { {0,} };
@@ -896,8 +896,8 @@ int bt_device_set_profile_restricted(const char *device_address,
        BT_CHECK_INPUT_PARAMETER(device_address);
 
        _bt_convert_address_to_hex(&addr_hex, device_address);
-       error_code = _bt_get_error_code(bluetooth_set_profile_restricted(&addr_hex,
-                       profile, restricted));
+       error_code = _bt_get_error_code(bluetooth_set_profile_trusted(&addr_hex,
+                       profile, !restricted));
 
        if (error_code != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
@@ -909,21 +909,21 @@ int bt_device_get_profile_restricted(const char *device_address,
                bt_restricted_profile_t profile, int *restricted)
 {
        bluetooth_device_address_t addr_hex = { {0,} };
-       int profile_restricted;
+       int profile_trusted;
        int error_code = BT_ERROR_NONE;
 
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(device_address);
 
        _bt_convert_address_to_hex(&addr_hex, device_address);
-       error_code = _bt_get_error_code(bluetooth_get_profile_restricted(&addr_hex,
-                       profile, &profile_restricted));
+       error_code = _bt_get_error_code(bluetooth_get_profile_trusted(&addr_hex,
+                       profile, &profile_trusted));
 
        if (error_code != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
 
        if (restricted)
-               *restricted = profile_restricted;
+               *restricted = !profile_trusted;
        return error_code;
 }