blob: 7b104ff390d0fed203e6d17e6382388d91ad96bf [file] [log] [blame]
Cheney Niad05f3e2018-11-08 16:41:02 +08001/*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include "audio_a2dp_hw/include/audio_a2dp_hw.h"
20#include "common/message_loop_thread.h"
21
22namespace bluetooth {
23namespace audio {
24namespace a2dp {
25
Cheney Niad05f3e2018-11-08 16:41:02 +080026// Check if new bluetooth_audio is enabled
27bool is_hal_2_0_enabled();
28
29// Initialize BluetoothAudio HAL: openProvider
30bool init(bluetooth::common::MessageLoopThread* message_loop);
31
32// Clean up BluetoothAudio HAL
33void cleanup();
34
35// Set up the codec into BluetoothAudio HAL
36bool setup_codec();
37
38// Send command to the BluetoothAudio HAL: StartSession, EndSession,
39// StreamStarted, StreamSuspended
40void start_session();
41void end_session();
42void ack_stream_started(const tA2DP_CTRL_ACK& status);
43void ack_stream_suspended(const tA2DP_CTRL_ACK& status);
44
45// Read from the FMQ of BluetoothAudio HAL
46size_t read(uint8_t* p_buf, uint32_t len);
47
48// Update A2DP delay report to BluetoothAudio HAL
49void set_remote_delay(uint16_t delay_report);
50
51} // namespace a2dp
52} // namespace audio
53} // namespace bluetooth