Cody sync.: merge tizen 2.4 code from spin git
[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 struct {
46         int key;
47         const char *property;
48 } bt_player_settinngs_t;
49
50 typedef enum {
51         BT_PENDING_NONE = 0x00,
52         BT_PENDING_CONNECT,
53         BT_PENDING_DISCONNECT
54 } bt_pending_request_t;
55
56 typedef struct {
57         int req_id;
58         char *address;
59         bt_pending_request_t  pending;
60         GArray **out_param;
61         int type;
62 } bt_audio_function_data_t;
63
64 typedef enum {
65         BT_AUDIO_HSP = 0x01,
66         BT_AUDIO_A2DP,
67         BT_AUDIO_ALL,
68         BT_AVRCP,
69         BT_AUDIO_A2DP_SOURCE
70 } bt_audio_type_t;
71
72 typedef enum {
73         BT_STATE_NONE = 0x00,
74         BT_STATE_CONNECTING,
75         BT_STATE_CONNECTED,
76         BT_STATE_DISCONNECTING,
77         BT_STATE_DISCONNECTED
78 } bt_headset_device_state_t;
79
80 #define BT_CONTENT_PROTECTION_PATH "/org/tizen/bluetooth/a2dpcontentprotection"
81 #define BT_CONTENT_PROTECTION_INTERFACE "org.tizen.bluetooth.A2dpContentProtection"
82
83 int _bt_audio_connect(int request_id, int type,
84                 bluetooth_device_address_t *device_address,
85                 GArray **out_param1);
86
87 int _bt_audio_disconnect(int request_id, int type,
88                 bluetooth_device_address_t *device_address,
89                 GArray **out_param1);
90
91 int _bt_hf_connect(int request_id,
92                 bluetooth_device_address_t *device_address,
93                 GArray **out_param1);
94
95 int _bt_hf_disconnect(int request_id,
96                 bluetooth_device_address_t *device_address,
97                 GArray **out_param1);
98
99 int _bt_audio_get_speaker_gain(unsigned int *gain);
100
101 int _bt_audio_set_speaker_gain(unsigned int gain);
102
103 int _bt_audio_set_content_protect(gboolean status);
104
105 void _bt_set_audio_wait_data_flag(gboolean flag);
106
107 bt_headset_wait_t *_bt_get_audio_wait_data(void);
108
109 void _bt_rel_wait_data(void);
110
111 void _bt_add_headset_to_list(int type, int status, const char *address);
112
113 void _bt_remove_headset_from_list(int type, const char *address);
114
115 gboolean _bt_is_headset_type_connected(int type, char *address);
116 void _bt_remove_from_connected_list(const char *address);
117
118 int _bt_get_device_state_from_list(int type, const char *address);
119
120 void _bt_remove_from_connected_list(const char *address);
121
122 void _bt_audio_check_pending_connect();
123
124 gboolean _bt_is_service_connected(char *address, int type);
125
126 #ifdef __cplusplus
127 }
128 #endif /* __cplusplus */
129 #endif /*_BT_SERVICE_AUDIO_H_*/
130