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