From: DoHyun Pyun Date: Wed, 6 Sep 2017 23:10:46 +0000 (+0900) Subject: Apply tizen 3.0 based product patchsets X-Git-Tag: submit/tizen/20170906.230917^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F148102%2F1;p=platform%2Fcore%2Fapi%2Fbluetooth.git Apply tizen 3.0 based product patchsets -------------------------------------------------- commit b1f1e05c0d97e98479b60a435eabb3419d23387d Author: Deokhyun Kim 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: I56eff14e0a9afc6fbac6e3d8b914d2846be99ad0 Signed-off-by: DoHyun Pyun --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index c8836f8..01b8061 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -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 diff --git a/include/bluetooth_type_internal.h b/include/bluetooth_type_internal.h index a61821b..da3eee1 100644 --- a/include/bluetooth_type_internal.h +++ b/include/bluetooth_type_internal.h @@ -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 diff --git a/src/bluetooth-device.c b/src/bluetooth-device.c index 974eb55..98edb2c 100644 --- a/src/bluetooth-device.c +++ b/src/bluetooth-device.c @@ -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; }