1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 
8 /******************************************************************************
9  *
10  *  This is the interface file for hf client call-out functions.
11  *
12  ******************************************************************************/
13 #ifndef BTA_HF_CLIENT_CO_H
14 #define BTA_HF_CLIENT_CO_H
15 
16 #include "common/bt_target.h"
17 #include "bta/bta_hf_client_api.h"
18 
19 #if (BTA_HF_INCLUDED == TRUE)
20 
21 #if (BTM_SCO_HCI_INCLUDED == TRUE)
22 /*******************************************************************************
23 **
24 ** Function         bta_hf_client_co_audio_state
25 **
26 ** Description      This function is called by the HF CLIENT before the audio connection
27 **                  is brought up, after it comes up, and after it goes down.
28 **
29 ** Parameters       handle - handle of the AG instance
30 **                  state - Audio state
31 **                  codec - if WBS support is compiled in, codec to going to be used is provided
32 **                      and when in SCO_STATE_SETUP, BTM_I2SPCMConfig() must be called with
33 **                      the correct platform parameters.
34 **                      in the other states codec type should not be ignored
35 **
36 ** Returns          void
37 **
38 *******************************************************************************/
39 void bta_hf_client_co_audio_state(UINT16 handle, UINT8 state, tBTA_HFP_PEER_CODEC codec);
40 
41 
42 /*******************************************************************************
43 **
44 ** Function         bta_hf_client_sco_co_init
45 **
46 ** Description      This function can be used by the phone to initialize audio
47 **                  codec or for other initialization purposes before SCO connection
48 **                  is opened.
49 **
50 **
51 ** Returns          Void.
52 **
53 *******************************************************************************/
54 tBTA_HFP_SCO_ROUTE_TYPE bta_hf_client_sco_co_init(UINT32 rx_bw, UINT32 tx_bw,
55         tBTA_HFP_CODEC_INFO *p_codec_info, UINT8 app_id);
56 
57 
58 /*******************************************************************************
59 **
60 ** Function         bta_hf_client_sco_co_open
61 **
62 ** Description      This function is executed when a SCO connection is open.
63 **
64 **
65 ** Returns          void
66 **
67 *******************************************************************************/
68 void bta_hf_client_sco_co_open(UINT16 handle, UINT8 air_mode, UINT8 inout_pkt_size, UINT16 event);
69 
70 /*******************************************************************************
71 **
72 ** Function         bta_hf_client_sco_co_close
73 **
74 ** Description      This function is called when a SCO connection is closed
75 **
76 **
77 ** Returns          void
78 **
79 *******************************************************************************/
80 void bta_hf_client_sco_co_close(void);
81 
82 /*******************************************************************************
83 **
84 ** Function         bta_hf_client_sco_co_out_data
85 **
86 ** Description      This function is called to send SCO data over HCI.
87 **
88 ** Returns          number of bytes got from application
89 **
90 *******************************************************************************/
91 uint32_t bta_hf_client_sco_co_out_data(UINT8 *p_buf);
92 
93 /*******************************************************************************
94 **
95 ** Function         bta_hf_client_sco_co_in_data
96 **
97 ** Description      This function is called to send incoming SCO data to application.
98 **
99 ** Returns          void
100 **
101 *******************************************************************************/
102 extern void bta_hf_client_sco_co_in_data(BT_HDR  *p_buf, tBTM_SCO_DATA_FLAG status);
103 
104 #endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
105 
106 #endif /* #if (BTA_HF_INCLUDED == TRUE) */
107 #endif /* BTA_HF_CLIENT_CO_H */
108