a2ad74920926463f0ea819b822cbe2e65a98c01b
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-audio.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24
25 #ifndef _BT_SERVICE_AUDIO_H_
26 #define _BT_SERVICE_AUDIO_H_
27
28 #include <glib.h>
29 #include <sys/types.h>
30 #include "bluetooth-api.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 typedef struct {
37         int req_id;
38         int type;
39         int disconnection_type;
40         char *address;
41         gboolean ag_flag;
42         GArray **out_param1;
43 } bt_headset_wait_t;
44
45 typedef enum {
46         BT_PENDING_NONE = 0x00,
47         BT_PENDING_CONNECT,
48         BT_PENDING_DISCONNECT
49 } bt_pending_request_t;
50
51 typedef struct {
52         int req_id;
53         char *address;
54         bt_pending_request_t  pending;
55         GArray **out_param;
56         int type;
57 } bt_audio_function_data_t;
58
59 typedef enum {
60         BT_AUDIO_HSP = 0x01,
61         BT_AUDIO_A2DP,
62         BT_AUDIO_ALL,
63         BT_AVRCP
64 } bt_audio_type_t;
65
66 typedef enum {
67         BT_STATE_NONE = 0x00,
68         BT_STATE_CONNECTING,
69         BT_STATE_CONNECTED,
70         BT_STATE_DISCONNECTING,
71         BT_STATE_DISCONNECTED
72 } bt_headset_device_state_t;
73
74 #define BT_CONTENT_PROTECTION_PATH "/org/tizen/bluetooth/a2dpcontentprotection"
75 #define BT_CONTENT_PROTECTION_INTERFACE "org.tizen.bluetooth.A2dpContentProtection"
76
77 int _bt_audio_connect(int request_id, int type,
78                 bluetooth_device_address_t *device_address,
79                 GArray **out_param1);
80
81 int _bt_audio_disconnect(int request_id, int type,
82                 bluetooth_device_address_t *device_address,
83                 GArray **out_param1);
84
85 int _bt_hf_connect(int request_id,
86                 bluetooth_device_address_t *device_address,
87                 GArray **out_param1);
88
89 int _bt_hf_disconnect(int request_id,
90                 bluetooth_device_address_t *device_address,
91                 GArray **out_param1);
92
93 int _bt_audio_get_speaker_gain(unsigned int *gain);
94
95 int _bt_audio_set_speaker_gain(unsigned int gain);
96
97 int _bt_audio_set_content_protect(gboolean status);
98
99 void _bt_set_audio_wait_data_flag(gboolean flag);
100
101 bt_headset_wait_t *_bt_get_audio_wait_data(void);
102
103 void _bt_rel_wait_data(void);
104
105 void _bt_add_headset_to_list(int type, int status, const char *address);
106
107 void _bt_remove_headset_from_list(int type, const char *address);
108
109 gboolean _bt_is_headset_type_connected(int type, char *address);
110 void _bt_remove_from_connected_list(const char *address);
111
112 int _bt_get_device_state_from_list(int type, const char *address);
113
114 void _bt_remove_from_connected_list(const char *address);
115
116 void _bt_audio_check_pending_connect();
117
118 gboolean _bt_is_service_connected(char *address, int type);
119
120 #ifdef __cplusplus
121 }
122 #endif /* __cplusplus */
123 #endif /*_BT_SERVICE_AUDIO_H_*/
124