--------------------------------------------------
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>
/**
* @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
/**
* @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
*/
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
} 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
}
-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,} };
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);
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;
}