Merge "Adapt the unregister scan filter functionality into BT-HAL framework" into...
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / include / oal-hfp.h
1 /*
2  * Open Adaptation Layer (OAL)
3  *
4  * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
5  *
6  * Contact: Anupam Roy <anupam.r@samsung.com>
7  *
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
11  *
12  *              http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22
23 #ifndef _OAL_HFPC_H_
24 #define _OAL_HFP_H_
25
26
27 #include <glib.h>
28 #include <sys/types.h>
29 #include <oal-manager.h>
30 #include "oal-event.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /**
37  * @brief Enable Audio HFP profile or Audio Gateway Role of HFP profile
38  *
39  * @remarks  BT Headsets/Handsfree devices will be able to connect.
40  *
41  * @return OAL_STATUS_SUCCESS on success, otherwise non-zero error value.
42  * @retval #OAL_STATUS_SUCCESS  Successful
43  *
44  * @pre OAL API must be initialized with oal_bt_init().
45  *
46  * @see  hfp_disable()
47  */
48 oal_status_t hfp_enable(int max_hfp_clients);
49
50 /**
51  * @brief Disable Audio HFP profile or Audio Gateway Role of HFP profile
52  *
53  * @remarks  BT Headsets/Handsfree devices will disconnect.
54  *
55  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
56  * @retval #OAL_STATUS_SUCCESS  Successful
57  *
58  * @pre AG Host should be enabled with hfp_enable().
59  *
60  * @see  hfp_enable()
61  */
62 oal_status_t hfp_disable(void);
63
64 /**
65  * @brief Initiate a HFP connection with a BT headset\handsfree device
66  *
67  * @details  Result will be notified through an OAL event
68  *
69  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
70  * @retval #OAL_STATUS_SUCCESS  Successful
71  *
72  * @pre AG Host should be enabled with hfp_enable().
73  *
74  * @see  OAL_EVENT_HFP_DISCONNECTED
75  */
76 oal_status_t hfp_connect(bt_address_t *device_address);
77
78 /**
79  * @brief Terminate a HFP connection with a BT headset\handsfree device
80  *
81  * @details  Result will be notified through an OAL event
82  *
83  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
84  * @retval #OAL_STATUS_SUCCESS  Successful
85  *
86  * @pre AG Host should be enabled with hfp_enable().
87  *
88  * @see  OAL_EVENT_HFP_CONNECTED
89  */
90 oal_status_t hfp_disconnect(bt_address_t *device_address);
91
92 /**
93  * @brief create an audio connection with a connected BT Sound device
94  *
95  * @details  Result will be notified through an OAL event
96  *
97  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
98  * @retval #OAL_STATUS_SUCCESS  Successful
99  *
100  * @pre BT Audio should be connected with a BT Sound device.
101  *
102  * @see  OAL_EVENT_HFP_AUDIO_CONNECTED
103  */
104 oal_status_t hfp_connect_audio(bt_address_t *device_address);
105
106 /**
107  * @brief Disconnect the audio connection with a connected BT Sound device
108  *
109  * @details  Result will be notified through an OAL event
110  *
111  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
112  * @retval #OAL_STATUS_SUCCESS  Successful
113  *
114  * @pre BT Audio should be connected with a BT Sound device.
115  *
116  * @see  OAL_EVENT_HFP_AUDIO_DISCONNECTED
117  */
118 oal_status_t hfp_disconnect_audio(bt_address_t *device_address);
119
120 #ifdef __cplusplus
121 }
122 #endif /* __cplusplus */
123 #endif /*_OAL_HFP_H_*/