1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/*
17 * @addtogroup HdiA2dp
18 * @{
19 *
20 * @brief Provides unified APIs for the A2DP service.
21 *
22 * The Host can use the interface provided by the module to create an audio session,
23 * and exchange data with the audio.
24 *
25 * @since 4.0
26 */
27
28/**
29 * @file IBluetoothAudioSession.idl
30 *
31 * @brief Defines the interfaces to start audio session, send render operation result,
32 * and stop the audio session.
33 *
34 * @since 4.0
35 * @version 1.0
36 */
37
38package ohos.hdi.bluetooth.a2dp.v1_0;
39
40import ohos.hdi.bluetooth.a2dp.v1_0.IBluetoothAudioCallback;
41import ohos.hdi.bluetooth.a2dp.v1_0.BluetoothAudioTypes;
42
43/**
44 * @brief Defines the interfaces to start audio session, send render operation result,
45 * and stop the audio session.
46 *
47 * @since 4.0
48 */
49interface IBluetoothAudioSession {
50    /**
51     * @brief Start audio session and register the callback function.
52     *
53     * @param sessionType Indicates the session type.
54     * @param callbackObj Indicates the callback function. For details, see {@link IBluetoothAudioCallback}.
55     * @param queue Returns sharedMemQueue for audio data.
56     * @return Returns <b>0</b> if the operation is successfully; returns a negative value otherwise.
57     *
58     * @since 4.0
59     * @version 1.0
60     */
61    StartSession([in] enum SessionType sessionType, [in] IBluetoothAudioCallback callbackObj,
62        [out] SharedMemQueue<unsigned char> queue);
63
64    /**
65     * @brief Stop audio session.
66     *
67     * @param sessionType Indicates the session type.
68     * @return Returns <b>0</b> if the operation is successfully; returns a negative value otherwise.
69     *
70     * @since 4.0
71     * @version 1.0
72     */
73    StopSession([in] enum SessionType sessionType);
74
75    /**
76     * @brief send the render operation result.
77     *
78     * @param operation Indicates the render operation.
79     * @param Status SUCCESS or FAILURE for operation.
80     * @return Returns <b>0</b> if the operation is successfully; returns a negative value otherwise.
81     *
82     * @since 4.0
83     * @version 1.0
84     */
85    RenderOperationResult([in] enum Operation operation, [in] enum Status status);
86}
87