Remove HDP implementation code 73/203973/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 18 Apr 2019 08:39:36 +0000 (17:39 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 18 Apr 2019 08:39:36 +0000 (17:39 +0900)
Change-Id: Id1361c8aa5b1e0a370038731df51e204756da0e9
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-common.c
src/bluetooth-hdp.c

index b44e1c07fbfbd063c47495d4b07851e31cb95f61..ff91a3eb112f3726804502769ccc42bbb14f6112 100644 (file)
@@ -1298,9 +1298,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
        int error_code = BT_ERROR_NONE;
        int event_index = -1;
        bluetooth_network_device_info_t *dev_info = NULL;
-       bt_hdp_connected_t *hdp_conn_info = NULL;
-       bt_hdp_disconnected_t *hdp_disconn_info = NULL;
-       bt_hdp_data_ind_t *hdp_data_ind = NULL;
        bt_gatt_char_value_t *char_val = NULL;
        media_metadata_attributes_t *metadata = NULL;
        bluetooth_authentication_request_info_t *auth_information = NULL;
@@ -1811,38 +1808,13 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 
        case BLUETOOTH_EVENT_HDP_CONNECTED:
                BT_INFO("HDP Connected ");
-               hdp_conn_info = (bt_hdp_connected_t *)(param->param_data);
-               _bt_convert_address_to_string(&device_addr, &hdp_conn_info->device_address);
-               ((bt_hdp_connected_cb)bt_event_slot_container[event_index].callback)
-               (_bt_get_error_code(param->result), device_addr, hdp_conn_info->app_handle,
-               hdp_conn_info->type, hdp_conn_info->channel_id,
-               bt_event_slot_container[event_index].user_data);
-
-               if (device_addr != NULL)
-                       free(device_addr);
                break;
 
        case BLUETOOTH_EVENT_HDP_DISCONNECTED:
                BT_INFO("HDP disconnected callback will be ");
-               hdp_disconn_info = (bt_hdp_disconnected_t *)(param->param_data);
-
-               _bt_convert_address_to_string(&device_addr, &hdp_disconn_info->device_address);
-               ((bt_hdp_disconnected_cb)bt_event_slot_container[event_index].callback)
-               (_bt_get_error_code(param->result), device_addr,
-               hdp_disconn_info->channel_id, bt_event_slot_container[event_index].user_data);
-
-               if (device_addr != NULL)
-                       free(device_addr);
                break;
        case BLUETOOTH_EVENT_HDP_DATA_RECEIVED:
                BT_INFO("HDP data received callback will be ");
-               hdp_data_ind = (bt_hdp_data_ind_t *)(param->param_data);
-               if (param->result != BLUETOOTH_ERROR_NONE)
-                       BT_ERR("Fail to receive HDP data");
-
-               ((bt_hdp_data_received_cb)bt_event_slot_container[event_index].callback)
-               (hdp_data_ind->channel_id, hdp_data_ind->buffer, hdp_data_ind->size,
-               bt_event_slot_container[event_index].user_data);
                break;
        case BLUETOOTH_EVENT_AG_CONNECTED:
                BT_INFO("BLUETOOTH_EVENT_AG_CONNECTED ");
index efc9c38f1ff65eaccf6e5a737e4fd86bb1e74e25..611156e6f38eb0c8170daba9c816d08471e072dd 100644 (file)
  * limitations under the License.
  */
 
-#include <glib.h>
-#include <dlog.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
-#include <bluetooth-api.h>
-
 #include "bluetooth.h"
 #include "bluetooth_private.h"
 
-#define BT_CHECK_HDP_SUPPORT() \
-{ \
-       BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \
-       BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_HEALTH); \
-}
-
 int bt_hdp_register_sink_app(unsigned short data_type, char **app_id)
 {
-       int error = BT_ERROR_NONE;
-       char *app_handle = NULL;
-
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(app_id);
-       error = bluetooth_hdp_activate(data_type, HDP_ROLE_SINK, HDP_QOS_ANY, &app_handle);
-       error = _bt_get_error_code(error);
-       if (BT_ERROR_NONE != error) {
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); /* LCOV_EXCL_LINE */
-               return error;
-       }
-
-       *app_id = strdup(app_handle);
-       if (*app_id == NULL)
-               return BT_ERROR_OUT_OF_MEMORY;
-
-       return BT_ERROR_NONE;
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_unregister_sink_app(const char *app_id)
 {
-       int error = BT_ERROR_NONE;
-
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(app_id);
-       error = bluetooth_hdp_deactivate(app_id);
-       error = _bt_get_error_code(error);
-       if (BT_ERROR_NONE != error)
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); /* LCOV_EXCL_LINE */
-
-       return error;
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_send_data(unsigned int channel, const char *data, unsigned int size)
 {
-       int error = BT_ERROR_NONE;
-
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       if (NULL == data || 0 >= size) { /* LCOV_EXCL_START */
-               BT_ERR("%s", _bt_convert_error_to_string(BT_ERROR_INVALID_PARAMETER));
-       }
-       error = bluetooth_hdp_send_data(channel, data, size);
-       error = _bt_get_error_code(error);
-       if (BT_ERROR_NONE != error)
-               BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
-
-       return error; /* LCOV_EXCL_STOP */
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_connect_to_source(const char *remote_address, const char *app_id)
 {
-       int error = BT_ERROR_NONE;
-       bluetooth_device_address_t addr_hex = { {0,} };
-
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(app_id); /* LCOV_EXCL_START */
-       BT_CHECK_INPUT_PARAMETER(remote_address);
-       _bt_convert_address_to_hex(&addr_hex, remote_address);
-       error = bluetooth_hdp_connect(app_id, HDP_QOS_ANY, &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; /* LCOV_EXCL_STOP */
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_disconnect(const char *remote_address, unsigned int channel)
 {
-       int error = BT_ERROR_NONE;
-       bluetooth_device_address_t addr_hex = { {0,} };
-
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS(); /* LCOV_EXCL_START */
-       BT_CHECK_INPUT_PARAMETER(remote_address);
-       _bt_convert_address_to_hex(&addr_hex, remote_address);
-
-       error = bluetooth_hdp_disconnect(channel, &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; /* LCOV_EXCL_STOP */
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_set_connection_state_changed_cb(bt_hdp_connected_cb connected_cb,
                bt_hdp_disconnected_cb disconnected_cb, void *user_data)
 {
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(connected_cb);
-       BT_CHECK_INPUT_PARAMETER(disconnected_cb);
-       _bt_set_cb(BT_EVENT_HDP_CONNECTED, connected_cb, user_data);
-       _bt_set_cb(BT_EVENT_HDP_DISCONNECTED, disconnected_cb, user_data);
-       return BT_ERROR_NONE;
-
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_unset_connection_state_changed_cb(void)
 {
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       if (_bt_check_cb(BT_EVENT_HDP_CONNECTED) == true)
-               _bt_unset_cb(BT_EVENT_HDP_CONNECTED);
-       if (_bt_check_cb(BT_EVENT_HDP_DISCONNECTED) == true)
-               _bt_unset_cb(BT_EVENT_HDP_DISCONNECTED);
-
-       return BT_ERROR_NONE;
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_set_data_received_cb(bt_hdp_data_received_cb callback,
                                void *user_data)
 {
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(callback);
-       _bt_set_cb(BT_EVENT_HDP_DATA_RECEIVED, callback, user_data);
-       return BT_ERROR_NONE;
+       return BT_ERROR_NOT_SUPPORTED;
 }
 
 int bt_hdp_unset_data_received_cb(void)
 {
-       BT_CHECK_HDP_SUPPORT();
-       BT_CHECK_INIT_STATUS();
-       if (_bt_check_cb(BT_EVENT_HDP_DATA_RECEIVED) == true)
-               _bt_unset_cb(BT_EVENT_HDP_DATA_RECEIVED);
-       return BT_ERROR_NONE;
+       return BT_ERROR_NOT_SUPPORTED;
 }