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