• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2004-2012 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  This is the interface file for pan call-in functions.
22  *
23  ******************************************************************************/
24 #ifndef BTA_PAN_CI_H
25 #define BTA_PAN_CI_H
26 
27 #include <cstdint>
28 
29 #include "bta/include/bta_pan_api.h"
30 
31 /*****************************************************************************
32  *  Function Declarations
33  ****************************************************************************/
34 /*******************************************************************************
35  *
36  * Function         bta_pan_ci_tx_ready
37  *
38  * Description      This function sends an event to PAN indicating the phone is
39  *                  ready for more data and PAN should call
40  *                  bta_pan_co_tx_path().
41  *                  This function is used when the TX data path is configured
42  *                  to use a pull interface.
43  *
44  *
45  * Returns          void
46  *
47  ******************************************************************************/
48 extern void bta_pan_ci_tx_ready(uint16_t handle);
49 
50 /*******************************************************************************
51  *
52  * Function         bta_pan_ci_rx_ready
53  *
54  * Description      This function sends an event to PAN indicating the phone
55  *                  has data available to send to PAN and PAN should call
56  *                  bta_pan_co_rx_path().  This function is used when the RX
57  *                  data path is configured to use a pull interface.
58  *
59  *
60  * Returns          void
61  *
62  ******************************************************************************/
63 extern void bta_pan_ci_rx_ready(uint16_t handle);
64 
65 /*******************************************************************************
66  *
67  * Function         bta_pan_ci_tx_flow
68  *
69  * Description      This function is called to enable or disable data flow on
70  *                  the TX path.  The phone should call this function to
71  *                  disable data flow when it is congested and cannot handle
72  *                  any more data sent by bta_pan_co_tx_write().
73  *                  This function is used when the
74  *                  TX data path is configured to use a push interface.
75  *
76  *
77  * Returns          void
78  *
79  ******************************************************************************/
80 extern void bta_pan_ci_tx_flow(uint16_t handle, bool enable);
81 
82 /*******************************************************************************
83  *
84  * Function         bta_pan_ci_rx_writebuf
85  *
86  * Description      This function is called to send data to the phone when
87  *                  the RX path is configured to use a push interface with
88  *                  zero copy.  The function sends an event to PAN containing
89  *                  the data buffer. The buffer will be freed by BTA; the
90  *                  phone must not free the buffer.
91  *
92  *
93  * Returns          true if flow enabled
94  *
95  ******************************************************************************/
96 extern void bta_pan_ci_rx_writebuf(uint16_t handle, const RawAddress& src,
97                                    const RawAddress& dst, uint16_t protocol,
98                                    BT_HDR* p_buf, bool ext);
99 
100 /*******************************************************************************
101  *
102  * Function         bta_pan_ci_readbuf
103  *
104  * Description      This function is called by the phone to read data from PAN
105  *                  when the TX path is configured to use a pull interface.
106  *                  The caller must free the buffer when it is through
107  *                  processing the buffer.
108  *
109  *
110  * Returns          void
111  *
112  ******************************************************************************/
113 extern BT_HDR* bta_pan_ci_readbuf(uint16_t handle, RawAddress& src,
114                                   RawAddress& dst, uint16_t* p_protocol,
115                                   bool* p_ext, bool* p_forward);
116 
117 /*******************************************************************************
118  *
119  * Function         bta_pan_ci_set_pfilters
120  *
121  * Description      This function is called to set protocol filters
122  *
123  *
124  * Returns          void
125  *
126  ******************************************************************************/
127 extern void bta_pan_ci_set_pfilters(uint16_t handle, uint16_t num_filters,
128                                     uint16_t* p_start_array,
129                                     uint16_t* p_end_array);
130 
131 /*******************************************************************************
132  *
133  * Function         bta_pan_ci_set_mfilters
134  *
135  * Description      This function is called to set multicast filters
136  *
137  *
138  * Returns          void
139  *
140  ******************************************************************************/
141 extern void bta_pan_ci_set_mfilters(uint16_t handle, uint16_t num_mcast_filters,
142                                     uint8_t* p_start_array,
143                                     uint8_t* p_end_array);
144 
145 #endif /* BTA_PAN_CI_H */
146