4 * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Anupam Roy <anupam.r@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 #ifndef __BT_SERVICE_AUDIO_COMMON_H__
24 #define __BT_SERVICE_AUDIO_COMMON_H__
26 #include "bt-service-event-receiver.h"
27 #include <bt-service-common.h>
33 BT_PENDING_NONE = 0x00,
36 } bt_pending_request_t;
39 BT_AUDIO_HSP = 0x01, /* HSP Connection */
40 BT_AUDIO_A2DP = 0x02, /* A2DP Source Connection, remote device is A2DP Sink */
41 BT_AUDIO_ALL = 0x03, /* HSP and A2DP Source Connection */
42 BT_AVRCP_TARGET = 0x04, /* AVRCP Target Connection to remote AVRCP controller */
43 BT_AVRCP = 0x08, /* AVRCP ctrl Connection to remote AVRCP target */
44 BT_AUDIO_A2DP_SOURCE = 0x10, /* A2DP Sink Connection, remote device is A2DP Source */
45 BT_AUDIO_HFP_SOURCE = 0x20 /* HSP and A2DP Sink Connection */
49 SERVICE_SEARCH_NOT_STARTED,
50 SERVICE_SEARCH_STARTED,
52 } bt_audio_service_search_e;
57 bt_audio_type_t conn_req_type;
58 bt_audio_service_search_e search_status;
59 gboolean is_a2dp_src_supported;
60 gboolean is_a2dp_sink_supported;
61 gboolean is_hfp_supported;
62 } bt_pending_audio_conn_t;
66 bt_pending_request_t pending;
68 } bt_audio_function_data_t;
72 int disconnection_type;
81 BT_STATE_DISCONNECTING,
83 } bt_headset_device_state_t;
85 int _bt_audio_initialize(bt_service_module_t module);
87 int _bt_audio_connect(int type, bluetooth_device_address_t *device_address);
89 int _bt_audio_disconnect(int type, bluetooth_device_address_t *device_address);
91 gboolean _bt_is_service_connected(char* address, int type);
93 void _bt_remove_service_search_request(char *address);
95 void _bt_remove_headset_from_list(int type, const char *address);
97 bt_headset_wait_t *_bt_get_audio_wait_data(void);
99 void _bt_rel_wait_data(void);
101 void _bt_set_audio_wait_data_flag(gboolean flag);
103 void _bt_audio_check_pending_connect(char *address);
105 gboolean _bt_is_headset_type_connected(int type, char *address);
107 void _bt_add_headset_to_list(int type, int status, const char *address);
109 void _bt_remove_service_search_request(char *address);
111 bt_pending_audio_conn_t* _bt_get_service_search_info(char *address);
113 void _bt_cleanup_search_info_and_reply_pending_req(bt_pending_audio_conn_t *info,
115 void _bt_audio_check_pending_connection(char *address);
117 void _bt_audio_check_pending_disconnection(char *address, int type);
121 #endif /* __cplusplus */
122 #endif /* __BT_SERVICE_AUDIO_COMMON_H__ */