1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /******************************************************************************* 8 * 9 * Filename: btc_a2dp_control.h 10 * 11 *******************************************************************************/ 12 13 #ifndef __BTC_A2DP_CONTROL_H__ 14 #define __BTC_A2DP_CONTROL_H__ 15 16 #include <stdbool.h> 17 #include "common/bt_target.h" 18 #include "bta/bta_api.h" 19 #include "btc_av_api.h" 20 #include "esp_a2dp_api.h" 21 22 #if BTC_AV_INCLUDED 23 /******************************************************************************* 24 ** Public functions 25 *******************************************************************************/ 26 27 /******************************************************************************* 28 ** 29 ** Function btc_a2dp_control_media_ctrl 30 ** 31 ** Description Handle the media_ctrl command 32 ** 33 *******************************************************************************/ 34 void btc_a2dp_control_media_ctrl(esp_a2d_media_ctrl_t ctrl); 35 36 37 /******************************************************************************* 38 ** 39 ** Function btc_a2dp_control_datapath_ctrl 40 ** 41 ** Description Handle the media datapath event, which is adapted from UIPC 42 ** data channel from bluedroid 43 ** 44 *******************************************************************************/ 45 void btc_a2dp_control_datapath_ctrl(uint32_t dp_evt); 46 47 48 /******************************************************************************* 49 ** 50 ** Function btc_a2dp_control_command_ack 51 ** 52 ** Description Acknowledge the pending media_ctrl command 53 ** 54 *******************************************************************************/ 55 void btc_a2dp_control_command_ack(int status); 56 57 58 /******************************************************************************* 59 ** 60 ** Function btc_a2dp_control_get_datachnl_stat 61 ** 62 ** Description Check whether the data channel state is open 63 ** 64 ** Return TRUE if the data channel state is open 65 ** 66 *******************************************************************************/ 67 BOOLEAN btc_a2dp_control_get_datachnl_stat(void); 68 69 70 /******************************************************************************* 71 ** 72 ** Function btc_a2dp_control_set_datachnl_stat 73 ** 74 ** Description Set the data channel state flag 75 ** 76 *******************************************************************************/ 77 void btc_a2dp_control_set_datachnl_stat(BOOLEAN open); 78 79 80 /******************************************************************************* 81 ** 82 ** Function btc_a2dp_control_init 83 ** 84 ** Description Initialize the A2DP control module. It should be called during 85 ** the startup stage of A2DP streaming. 86 ** 87 *******************************************************************************/ 88 bool btc_a2dp_control_init(void); 89 90 91 /******************************************************************************* 92 ** 93 ** Function btc_a2dp_control_cleanup 94 ** 95 ** Description Cleanup the A2DP control module 96 ** 97 *******************************************************************************/ 98 void btc_a2dp_control_cleanup(void); 99 100 #endif /* #if BTC_AV_INCLUDED */ 101 102 #endif /* __BTC_A2DP_CONTROL_H__ */ 103