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/include/bta_av_api.h" 26 #include "btif_av.h" 27 #include "types/raw_address.h" 28 29 // Process 'idle' request from the BTIF state machine during initialization. 30 void btif_a2dp_on_idle(const RawAddress& peer_addr, const A2dpType local_a2dp_type); 31 32 // Process 'start' request from the BTIF state machine to prepare for A2DP 33 // streaming. 34 // |peer_addr| is the peer address. 35 // |p_av_start| is the data associated with the request - see |tBTA_AV_START|. 36 // |local_a2dp_type| type of local a2dp profile. 37 // Returns true if an ACK for the local command was sent, otherwise false. 38 bool btif_a2dp_on_started(const RawAddress& peer_addr, tBTA_AV_START* p_av_start, 39 const A2dpType local_a2dp_type); 40 41 // Process 'stop' request from the BTIF state machine to stop A2DP streaming. 42 // |p_av_suspend| is the data associated with the request - see 43 // |tBTA_AV_SUSPEND|. 44 // |local_a2dp_type| type of local a2dp profile. 45 void btif_a2dp_on_stopped(tBTA_AV_SUSPEND* p_av_suspend, const A2dpType local_a2dp_type); 46 47 // Process 'suspend' request from the BTIF state machine to suspend A2DP 48 // streaming. 49 // |p_av_suspend| is the data associated with the request - see 50 // |tBTA_AV_SUSPEND|. 51 // |local_a2dp_type| type of local a2dp profile. 52 void btif_a2dp_on_suspended(tBTA_AV_SUSPEND* p_av_suspend, const A2dpType local_a2dp_type); 53 54 // Process 'offload start' request from the BTIF state machine to start 55 // offloading of the A2DP streaming. 56 // |peer_addr| is the peer address. 57 // |status| is the processing status of the request prior to this call. 58 // The value can be |BTA_AV_SUCCESS| if the processing has been successful 59 // so far, or |BTA_AV_FAIL*| if the request has already failed. 60 void btif_a2dp_on_offload_started(const RawAddress& peer_addr, tBTA_AV_STATUS status); 61 62 // Dump debug-related information for the A2DP module. 63 // |fd| is the file descriptor to use for writing the ASCII formatted 64 // information. 65 void btif_debug_a2dp_dump(int fd); 66 67 #endif /* BTIF_A2DP_H */ 68