/*
 * Copyright (c) 2024 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 2.0
 */

package ohos.hdi.bluetooth.a2dp.v2_0;

import ohos.hdi.bluetooth.a2dp.v2_0.IBluetoothAudioCallback;
import ohos.hdi.bluetooth.a2dp.v2_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 params Indicates the start session parameters. For details, see {@link BluetoothAudioTypes}.
     * @param callbackObj Indicates the callback function. For details, see {@link IBluetoothAudioCallback}.
     * @param queue Returns sharedMemQueue for audio data.
     * @return Returns <b>0</b> if the operation is successfully; returns a negative value otherwise.
     *
     * @since 4.1
     * @version 2.0
     */
    StartSessionWithParams([in] struct StartSessionParams params, [in] IBluetoothAudioCallback callbackObj,
        [out] SharedMemQueue<unsigned char> queue);

    /**
     * @brief Stop audio session.
     *
     * @param sessionType Indicates the session type.
     * @return Returns <b>0</b> if the operation is successfully; returns a negative value otherwise.
     *
     * @since 4.0
     * @version 2.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 <b>0</b> if the operation is successfully; returns a negative value otherwise.
     *
     * @since 4.0
     * @version 2.0
     */
    RenderOperationResult([in] enum Operation operation, [in] enum Status status);
}