1 /******************************************************************************
2  *
3  *  Copyright 2016 The Android Open Source Project
4  *  Copyright 2009-2012 Broadcom Corporation
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at:
9  *
10  *  http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  ******************************************************************************/
19 
20 #ifndef BTIF_A2DP_H
21 #define BTIF_A2DP_H
22 
23 #include <stdbool.h>
24 
25 #include "bta_av_api.h"
26 
27 // Process 'idle' request from the BTIF state machine during initialization.
28 void btif_a2dp_on_idle(void);
29 
30 // Process 'start' request from the BTIF state machine to prepare for A2DP
31 // streaming.
32 // |peer_addr| is the peer address.
33 // |p_av_start| is the data associated with the request - see |tBTA_AV_START|.
34 // |pending_start| should be set to true if the BTIF state machine is in
35 // 'pending start' state.
36 // Returns true if an ACK for the local command was sent, otherwise false.
37 bool btif_a2dp_on_started(const RawAddress& peer_addr,
38                           tBTA_AV_START* p_av_start, bool pending_start);
39 
40 // Process 'stop' request from the BTIF state machine to stop A2DP streaming.
41 // |p_av_suspend| is the data associated with the request - see
42 // |tBTA_AV_SUSPEND|.
43 void btif_a2dp_on_stopped(tBTA_AV_SUSPEND* p_av_suspend);
44 
45 // Process 'suspend' request from the BTIF state machine to suspend A2DP
46 // streaming.
47 // |p_av_suspend| is the data associated with the request - see
48 // |tBTA_AV_SUSPEND|.
49 void btif_a2dp_on_suspended(tBTA_AV_SUSPEND* p_av_suspend);
50 
51 // Process 'offload start' request from the BTIF state machine to start
52 // offloading of the A2DP streaming.
53 // |peer_addr| is the peer address.
54 // |status| is the processing status of the request prior to this call.
55 // The value can be |BTA_AV_SUCCESS| if the processing has been successful
56 // so far, or |BTA_AV_FAIL*| if the request has already failed.
57 void btif_a2dp_on_offload_started(const RawAddress& peer_addr,
58                                   tBTA_AV_STATUS status);
59 
60 // Dump debug-related information for the A2DP module.
61 // |fd| is the file descriptor to use for writing the ASCII formatted
62 // information.
63 void btif_debug_a2dp_dump(int fd);
64 
65 #endif /* BTIF_A2DP_H */
66