Adapt HF Profile Connect & Disconnect to BT HAL framework
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / include / oal-hf-client.h
1 /*
2  * Open Adaptation Layer (OAL)
3  *
4  * Copyright (c) 2019 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
21 #ifndef _OAL_HF_CLIENT_H_
22 #define _OAL_HF_CLIENT_H_
23
24 #include <glib.h>
25 #include <sys/types.h>
26 #include <oal-manager.h>
27 #include "oal-event.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /**
34  * @brief Enable Audio HFP Client profile or HF Role of HFP profile
35  *
36  * @remarks  BT audio gateway devices will be able to connect.
37  *
38  * @return OAL_STATUS_SUCCESS on success, otherwise non-zero error value.
39  * @retval #OAL_STATUS_SUCCESS  Successful
40  *
41  * @pre OAL API must be initialized with oal_bt_init().
42  *
43  * @see  hfp_client_disable()
44  */
45 oal_status_t hf_client_enable(void);
46
47 /**
48  * @brief Disable Audio HFP client profile or HF Role of HFP profile
49  *
50  * @remarks  BT audio gateway devices will be able to disconnect.
51  *
52  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
53  * @retval #OAL_STATUS_SUCCESS  Successful
54  *
55  * @pre AG Host should be enabled with hf_client_enable().
56  *
57  * @see  hfp_enable()
58  */
59 oal_status_t hf_client_disable(void);
60
61 /**
62  * @brief Initiate a HFP connection with a remote audio gateway device
63  *
64  * @details  Result will be notified through an OAL event
65  *
66  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
67  * @retval #OAL_STATUS_SUCCESS  Successful
68  *
69  * @pre HFP Client should be enabled with hf_client_enable().
70  *
71  * @see  OAL_EVENT_HFP_CLIENT_DISCONNECTED
72  */
73 oal_status_t hf_client_connect(bt_address_t *device_address);
74
75 /**
76  * @brief Terminate a HFP connection with a remote audio gateway device
77  *
78  * @details  Result will be notified through an OAL event
79  *
80  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
81  * @retval #OAL_STATUS_SUCCESS  Successful
82  *
83  * @pre HFP Client should be enabled with hf_client_enable().
84  *
85  * @see  OAL_EVENT_HFP_CLIENT_CONNECTED
86  */
87 oal_status_t hf_client_disconnect(bt_address_t *device_address);
88
89 #ifdef __cplusplus
90 }
91 #endif /* __cplusplus */
92 #endif /* _OAL_HF_CLIENT_H_*/