4f17b2bec70ddf156716eb3f3d7408593456a183
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-audio.h
1 /*
2  * bluetooth-frwk
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef _BT_SERVICE_AUDIO_H_
21 #define _BT_SERVICE_AUDIO_H_
22
23 #include <glib.h>
24 #include <sys/types.h>
25 #include "bluetooth-api.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef struct {
32         int req_id;
33         int type;
34         int disconnection_type;
35         char *address;
36         gboolean ag_flag;
37         GArray **out_param1;
38 } bt_headset_wait_t;
39
40 typedef enum {
41         BT_AUDIO_HSP = 0x01,
42         BT_AUDIO_A2DP,
43         BT_AUDIO_ALL,
44 } bt_audio_type_t;
45
46 typedef enum {
47         BT_STATE_NONE = 0x00,
48         BT_STATE_CONNECTING,
49         BT_STATE_CONNECTED,
50 } bt_headset_device_state_t;
51
52 int _bt_audio_connect(int request_id, int type,
53                 bluetooth_device_address_t *device_address,
54                 GArray **out_param1);
55
56 int _bt_audio_disconnect(int request_id, int type,
57                 bluetooth_device_address_t *device_address,
58                 GArray **out_param1);
59
60 int _bt_audio_get_speaker_gain(unsigned int *gain);
61
62 int _bt_audio_set_speaker_gain(unsigned int gain);
63
64 void _bt_set_audio_wait_data_flag(gboolean flag);
65
66 bt_headset_wait_t *_bt_get_audio_wait_data(void);
67
68 void _bt_add_headset_to_list(int type, int status, const char *address);
69
70 void _bt_remove_headset_from_list(int type, const char *address);
71
72 gboolean _bt_is_headset_type_connected(int type, char *address);
73
74 #ifdef __cplusplus
75 }
76 #endif /* __cplusplus */
77 #endif /*_BT_SERVICE_AUDIO_H_*/
78