Merge "Return ALREADY_CONNECT ERROR if device is already paired" into tizen
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / include / oal-a2dp-sink.h
1 /*
2  * Open Adaptation Layer (OAL)
3  *
4  * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
5  *
6  * Contact: Nilesh Trimbake <t.shripati@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_A2DP_SINK_H_
24 #define _OAL_A2DP_SINK_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 Host(A2DP Sink) Feature
38  *
39  * @remarks  BT Sound Share/BT speaker 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  a2dp_sink_disable()
47  */
48 oal_status_t a2dp_sink_enable(char *service_name , char *provider_name);
49
50
51 /**
52  * @brief Disable Audio Host(A2DP Sink) Feature
53  *
54  * @remarks  BT Sound Share/BT speaker will be able to connect.
55  *
56  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
57  * @retval #OAL_STATUS_SUCCESS  Successful
58  *
59  * @pre Audio host should be enabled with a2dp_sink_enable().
60  *
61  * @see  a2dp_sink_enable()
62  */
63 oal_status_t a2dp_sink_disable(void);
64
65
66 /**
67  * @brief Initiate a connection with A2DP Source Device
68  *
69  * @details  Result will be notified through an OAL event
70  *
71  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
72  * @retval #OAL_STATUS_SUCCESS  Successful
73  *
74  * @pre BT Audio should be enabled with a2dp_sink_enable().
75  *
76  * @see  OAL_EVENT_A2DP_SINK_CONNECTED
77  */
78
79 oal_status_t a2dp_sink_connect(bt_address_t *device_address);
80
81
82 /**
83  * @brief Remove a connection with A2DP Source device
84  *
85  * @details  Result will be notified through an OAL event
86  *
87  * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
88  * @retval #OAL_STATUS_SUCCESS  Successful
89  *
90  * @pre BT Audio should be connected with a BT Sound device.
91  *
92  * @see  OAL_EVENT_A2DP_SINK_DISCONNECTED
93  */
94
95 oal_status_t a2dp_sink_disconnect(bt_address_t *device_address);
96
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100 #endif /*_OAL_A2DP_SINK_H_*/