/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * @addtogroup HdiA2dp * @{ * * @brief Provides unified APIs for the A2DP service. * * The Host can use the interface provided by the module to create an audio session, * and exchange data with the audio. * * @since 4.0 */ /** * @file IBluetoothAudioSession.idl * * @brief Defines the interfaces to start audio session, send render operation result, * and stop the audio session. * * @since 4.0 * @version 1.0 */ package ohos.hdi.bluetooth.a2dp.v1_0; import ohos.hdi.bluetooth.a2dp.v1_0.IBluetoothAudioCallback; import ohos.hdi.bluetooth.a2dp.v1_0.BluetoothAudioTypes; /** * @brief Defines the interfaces to start audio session, send render operation result, * and stop the audio session. * * @since 4.0 */ interface IBluetoothAudioSession { /** * @brief Start audio session and register the callback function. * * @param sessionType Indicates the session type. * @param callbackObj Indicates the callback function. For details, see {@link IBluetoothAudioCallback}. * @param queue Returns sharedMemQueue for audio data. * @return Returns 0 if the operation is successfully; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ StartSession([in] enum SessionType sessionType, [in] IBluetoothAudioCallback callbackObj, [out] SharedMemQueue queue); /** * @brief Stop audio session. * * @param sessionType Indicates the session type. * @return Returns 0 if the operation is successfully; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ StopSession([in] enum SessionType sessionType); /** * @brief send the render operation result. * * @param operation Indicates the render operation. * @param Status SUCCESS or FAILURE for operation. * @return Returns 0 if the operation is successfully; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ RenderOperationResult([in] enum Operation operation, [in] enum Status status); }