From: DoHyun Pyun Date: Wed, 26 Jun 2019 02:22:45 +0000 (+0900) Subject: Remove PBAP client implementation code X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b0fe1fe0d1656e48b35fb02a27520591277dd43;p=platform%2Fcore%2Fapi%2Fbluetooth.git Remove PBAP client implementation code Change-Id: I48269a380f75410499d7e1b0b2c6289ea661a51a Signed-off-by: DoHyun Pyun --- diff --git a/src/bluetooth-pbap.c b/src/bluetooth-pbap.c index f7d17c2..945fd86 100644 --- a/src/bluetooth-pbap.c +++ b/src/bluetooth-pbap.c @@ -14,149 +14,50 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include - #include "bluetooth.h" #include "bluetooth_internal.h" #include "bluetooth_private.h" -#define BT_CHECK_PBAP_CLIENT_SUPPORT() \ -{ \ - BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \ - BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_PBAP_CLIENT); \ -} /* LCOV_EXCL_START */ int bt_pbap_client_initialize(void) { - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - int error_code = BT_ERROR_NONE; - error_code = _bt_get_error_code(bluetooth_pbap_init()); - if (error_code != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_deinitialize(void) { - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - int error_code = BT_ERROR_NONE; - error_code = _bt_get_error_code(bluetooth_pbap_deinit()); - if (error_code != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_set_connection_state_changed_cb(bt_pbap_connection_state_changed_cb callback, void *user_data) { - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(callback); - _bt_set_cb(BT_EVENT_PBAP_CONNECTION_STATUS, callback, user_data); - return BT_ERROR_NONE; - + return BT_ERROR_NOT_SUPPORTED; } + int bt_pbap_client_unset_connection_state_changed_cb(void) { - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - if (_bt_check_cb(BT_EVENT_PBAP_CONNECTION_STATUS) == true) - _bt_unset_cb(BT_EVENT_PBAP_CONNECTION_STATUS); - return BT_ERROR_NONE; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_connect(const char *address) { - bluetooth_device_address_t addr_hex = { {0,} }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - - _bt_convert_address_to_hex(&addr_hex, address); - - error_code = _bt_get_error_code(bluetooth_pbap_connect(&addr_hex)); - if (error_code != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_disconnect(const char *address) { - bluetooth_device_address_t addr_hex = { {0,} }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - - _bt_convert_address_to_hex(&addr_hex, address); - - error_code = _bt_get_error_code(bluetooth_pbap_disconnect(&addr_hex)); - if (error_code != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_is_connected(const char *address, bool *connected_status) { - bluetooth_device_address_t addr_hex = { {0,} }; - int ret; - gboolean is_connected = FALSE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - - _bt_convert_address_to_hex(&addr_hex, address); - - ret = _bt_get_error_code(bluetooth_is_device_connected(&addr_hex, - BLUETOOTH_PBAP_SERVICE, &is_connected)); - *connected_status = is_connected ? true : false; - - if (ret != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); /* LCOV_EXCL_LINE */ - return ret; - } - - return ret; - + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_get_phone_book_size(const char *address, bt_pbap_address_book_source_e source, bt_pbap_folder_type_e folder_type, bt_pbap_phone_book_size_cb callback, void *user_data) { - bluetooth_device_address_t addr_hex = { {0,} }; - bt_pbap_folder_t folder = { 0, }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - BT_CHECK_INPUT_PARAMETER(callback); - - folder.addressbook = source; - folder.folder_type = folder_type; - _bt_convert_address_to_hex(&addr_hex, address); - _bt_set_cb(BT_EVENT_PBAP_PHONEBOOK_SIZE, callback, user_data); - error_code = _bt_get_error_code(bluetooth_pbap_get_phonebook_size(&addr_hex, &folder)); - if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - _bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_SIZE); - } - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_get_phone_book(const char *address, bt_pbap_address_book_source_e source, @@ -165,39 +66,7 @@ int bt_pbap_client_get_phone_book(const char *address, bt_pbap_address_book_sour unsigned short max_list_count, unsigned int fields, bt_pbap_phone_book_received_cb callback, void *user_data) { - bluetooth_device_address_t addr_hex = { {0,} }; - bt_pbap_pull_parameters_t app_param = { 0, }; - bt_pbap_folder_t folder = { 0, }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - BT_CHECK_INPUT_PARAMETER(callback); - - /* To get size of phonebook, a separate API is provided - * Hence, passing max_list_count as 0 is restricted. */ - if (max_list_count <= 0) - return BT_ERROR_INVALID_PARAMETER; - - app_param.format = format; - app_param.order = order; - app_param.offset = offset; - app_param.maxlist = max_list_count; - app_param.fields = fields; - - folder.addressbook = source; - folder.folder_type = folder_type; - - _bt_convert_address_to_hex(&addr_hex, address); - _bt_set_cb(BT_EVENT_PBAP_PHONEBOOK_PULL, callback, user_data); - error_code = _bt_get_error_code(bluetooth_pbap_get_phonebook(&addr_hex, &folder, &app_param)); - if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - _bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_PULL); - } - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_get_list(const char *address, bt_pbap_address_book_source_e source, @@ -205,32 +74,7 @@ int bt_pbap_client_get_list(const char *address, bt_pbap_address_book_source_e s unsigned short offset, unsigned short max_list_count, bt_pbap_list_vcards_cb callback, void *user_data) { - bluetooth_device_address_t addr_hex = { {0,} }; - bt_pbap_list_parameters_t app_param = { 0, }; - bt_pbap_folder_t folder = { 0, }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - BT_CHECK_INPUT_PARAMETER(callback); - - _bt_convert_address_to_hex(&addr_hex, address); - app_param.order = order; - app_param.offset = offset; - app_param.maxlist = max_list_count; - - folder.addressbook = source; - folder.folder_type = folder_type; - - _bt_set_cb(BT_EVENT_PBAP_VCARD_LIST, callback, user_data); - error_code = _bt_get_error_code(bluetooth_pbap_get_list(&addr_hex, &folder, &app_param)); - if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - _bt_unset_cb(BT_EVENT_PBAP_VCARD_LIST); - } - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_pull_vcard(const char *address, bt_pbap_address_book_source_e source, @@ -238,33 +82,7 @@ int bt_pbap_client_pull_vcard(const char *address, bt_pbap_address_book_source_e bt_pbap_vcard_format_e format, unsigned int fields, bt_pbap_phone_book_received_cb callback, void *user_data) { - bluetooth_device_address_t addr_hex = { {0,} }; - bt_pbap_pull_vcard_parameters_t app_param = { 0, }; - bt_pbap_folder_t folder = { 0, }; - - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - BT_CHECK_INPUT_PARAMETER(callback); - - _bt_convert_address_to_hex(&addr_hex, address); - app_param.format = format; - app_param.fields = fields; - app_param.index = index; - - folder.addressbook = source; - folder.folder_type = folder_type; - - _bt_set_cb(BT_EVENT_PBAP_VCARD_PULL, callback, user_data); - error_code = _bt_get_error_code(bluetooth_pbap_pull_vcard(&addr_hex, &folder, &app_param)); - if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - _bt_unset_cb(BT_EVENT_PBAP_VCARD_PULL); - } - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } int bt_pbap_client_search_phone_book(const char *address, @@ -274,34 +92,6 @@ int bt_pbap_client_search_phone_book(const char *address, unsigned short offset, unsigned short max_list_count, bt_pbap_list_vcards_cb callback, void *user_data) { - bluetooth_device_address_t addr_hex = { {0,} }; - bt_pbap_folder_t folder = { 0, }; - bt_pbap_search_parameters_t app_param = { 0, }; - int error_code = BT_ERROR_NONE; - - BT_CHECK_PBAP_CLIENT_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(address); - BT_CHECK_INPUT_PARAMETER(callback); - - _bt_convert_address_to_hex(&addr_hex, address); - folder.addressbook = source; - folder.folder_type = folder_type; - - app_param.order = order; - app_param.offset = offset; - app_param.maxlist = max_list_count; - app_param.search_attribute = search_attribute; - strncpy(app_param.search_value, search_value, - BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH - 1); - - _bt_set_cb(BT_EVENT_PBAP_PHONEBOOK_SEARCH, callback, user_data); - error_code = _bt_get_error_code(bluetooth_pbap_phonebook_search(&addr_hex, &folder, &app_param)); - if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - _bt_unset_cb(BT_EVENT_PBAP_PHONEBOOK_SEARCH); - } - - return error_code; + return BT_ERROR_NOT_SUPPORTED; } /* LCOV_EXCL_STOP */