From: DoHyun Pyun Date: Thu, 18 Apr 2019 08:43:09 +0000 (+0900) Subject: Remove PAN implementation code X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c07129993d68c7b1c05621e5319938b160633cf1;p=platform%2Fcore%2Fapi%2Fbluetooth.git Remove PAN implementation code Change-Id: I637d6f1b5f0b9df08ff1077509ae2cf0b8b7f7ff Signed-off-by: DoHyun Pyun --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index ff91a3e..e607d88 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1297,7 +1297,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us char *phone_number = NULL; int error_code = BT_ERROR_NONE; int event_index = -1; - bluetooth_network_device_info_t *dev_info = NULL; bt_gatt_char_value_t *char_val = NULL; media_metadata_attributes_t *metadata = NULL; bluetooth_authentication_request_info_t *auth_information = NULL; @@ -1755,55 +1754,17 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us case BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED: BT_INFO("BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED"); - dev_info = (bluetooth_network_device_info_t *)(param->param_data); - - if (param->result != BLUETOOTH_ERROR_NONE) - BT_ERR("Fail to connect the network server"); - - _bt_convert_address_to_string(&device_addr, &dev_info->device_address); - ((bt_nap_connection_state_changed_cb)bt_event_slot_container[event_index].callback) - (TRUE, device_addr, dev_info->interface_name, bt_event_slot_container[event_index].user_data); - - if (device_addr != NULL) - free(device_addr); break; case BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED: BT_INFO("BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED"); - dev_info = (bluetooth_network_device_info_t *)(param->param_data); - - if (param->result != BLUETOOTH_ERROR_NONE) - BT_ERR("Fail to disconnect the network server"); - - _bt_convert_address_to_string(&device_addr, &dev_info->device_address); - ((bt_nap_connection_state_changed_cb)bt_event_slot_container[event_index].callback) - (FALSE, device_addr, dev_info->interface_name, bt_event_slot_container[event_index].user_data); - - if (device_addr != NULL) - free(device_addr); break; case BLUETOOTH_EVENT_NETWORK_DISCONNECTED: BT_INFO("BLUETOOTH_EVENT_NETWORK_DISCONNECTED"); - bd_addr = (bluetooth_device_address_t *)(param->param_data); - _bt_convert_address_to_string(&device_addr, bd_addr); - - ((bt_panu_connection_state_changed_cb)bt_event_slot_container[event_index].callback) - (_bt_get_error_code(param->result), FALSE, device_addr, BLUETOOTH_NETWORK_NAP_ROLE, - bt_event_slot_container[event_index].user_data); - if (device_addr != NULL) - free(device_addr); break; case BLUETOOTH_EVENT_NETWORK_CONNECTED: BT_INFO("BLUETOOTH_EVENT_NETWORK_CONNECTED"); - bd_addr = (bluetooth_device_address_t *)(param->param_data); - _bt_convert_address_to_string(&device_addr, bd_addr); - - ((bt_panu_connection_state_changed_cb)bt_event_slot_container[event_index].callback) - (_bt_get_error_code(param->result), TRUE, device_addr, BLUETOOTH_NETWORK_NAP_ROLE, - bt_event_slot_container[event_index].user_data); - if (device_addr != NULL) - free(device_addr); break; case BLUETOOTH_EVENT_HDP_CONNECTED: diff --git a/src/bluetooth-pan.c b/src/bluetooth-pan.c index 17ac6e5..a1fd3ad 100644 --- a/src/bluetooth-pan.c +++ b/src/bluetooth-pan.c @@ -14,162 +14,59 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include - #include "bluetooth.h" #include "bluetooth_private.h" -#define BT_CHECK_PAN_SUPPORT() \ -{ \ - BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \ - BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_TETHERING); \ -} - -/* LCOV_EXCL_START */ int bt_nap_activate(void) { - int error = BT_ERROR_NONE; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - error = bluetooth_network_activate_server(); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - - return error; + return BT_ERROR_NOT_SUPPORTED; } int bt_nap_deactivate(void) { - int error = BT_ERROR_NONE; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - error = bluetooth_network_deactivate_server(); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - - return error; + return BT_ERROR_NOT_SUPPORTED; } -/* bluez don't support the disconnect API about NAP server */ -/* So we implement this, deactivate the server and re-activate the server */ int bt_nap_disconnect_all(void) { - int error = BT_ERROR_NONE; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - error = bluetooth_network_deactivate_server(); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - else - return bt_nap_activate(); - - return error; + return BT_ERROR_NOT_SUPPORTED; } int bt_nap_disconnect(const char *remote_address) { - int error = BT_ERROR_INVALID_PARAMETER; - bluetooth_device_address_t addr_hex = { {0,} }; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); - _bt_convert_address_to_hex(&addr_hex, remote_address); - error = bluetooth_network_server_disconnect(&addr_hex); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), - error); - } - return error; + return BT_ERROR_NOT_SUPPORTED; } int bt_nap_set_connection_state_changed_cb( bt_nap_connection_state_changed_cb callback, void *user_data) { - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(callback); - _bt_set_cb(BT_EVENT_NAP_CONNECTION_STATE_CHANGED, callback, user_data); - return BT_ERROR_NONE; - + return BT_ERROR_NOT_SUPPORTED; } int bt_nap_unset_connection_state_changed_cb(void) { - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - _bt_unset_cb(BT_EVENT_NAP_CONNECTION_STATE_CHANGED); - return BT_ERROR_NONE; + return BT_ERROR_NOT_SUPPORTED; } int bt_panu_set_connection_state_changed_cb( bt_panu_connection_state_changed_cb callback, void *user_data) { - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(callback); - _bt_set_cb(BT_EVENT_PAN_CONNECTION_STATE_CHANGED, callback, user_data); - return BT_ERROR_NONE; + return BT_ERROR_NOT_SUPPORTED; } int bt_panu_unset_connection_state_changed_cb(void) { - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - _bt_unset_cb(BT_EVENT_PAN_CONNECTION_STATE_CHANGED); - return BT_ERROR_NONE; + return BT_ERROR_NOT_SUPPORTED; } int bt_panu_connect(const char *remote_address, bt_panu_service_type_e type) { - int error = BT_ERROR_INVALID_PARAMETER; - bluetooth_device_address_t addr_hex = { {0,} }; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); - _bt_convert_address_to_hex(&addr_hex, remote_address); - if (BT_PANU_SERVICE_TYPE_NAP == type) { - error = bluetooth_network_connect(&addr_hex, - BLUETOOTH_NETWORK_NAP_ROLE, NULL); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), - error); - } - } - return error; + return BT_ERROR_NOT_SUPPORTED; } int bt_panu_disconnect(const char *remote_address) { - int error = BT_ERROR_INVALID_PARAMETER; - bluetooth_device_address_t addr_hex = { {0,} }; - - BT_CHECK_PAN_SUPPORT(); - BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); - _bt_convert_address_to_hex(&addr_hex, remote_address); - error = bluetooth_network_disconnect(&addr_hex); - error = _bt_get_error_code(error); - if (error != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), - error); - } - return error; + return BT_ERROR_NOT_SUPPORTED; } -/* LCOV_EXCL_STOP */