The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Jakub Pawlowski | 5b790fe | 2017-09-18 09:00:20 -0700 | [diff] [blame] | 3 | * Copyright 2004-2012 Broadcom Corporation |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 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 data gateway call-out functions. |
| 22 | * |
| 23 | ******************************************************************************/ |
| 24 | #ifndef BTA_PAN_CO_H |
| 25 | #define BTA_PAN_CO_H |
| 26 | |
| 27 | #include "bta_pan_api.h" |
| 28 | |
| 29 | /***************************************************************************** |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 30 | * Constants |
| 31 | ****************************************************************************/ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 32 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 33 | /* BT_HDR buffer offset */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 34 | #define BTA_PAN_MIN_OFFSET PAN_MINIMUM_OFFSET |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 35 | |
| 36 | /* Data Flow Mask */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 37 | #define BTA_PAN_RX_PUSH 0x00 /* RX push. */ |
| 38 | #define BTA_PAN_RX_PUSH_BUF 0x01 /* RX push with zero copy. */ |
| 39 | #define BTA_PAN_RX_PULL 0x02 /* RX pull. */ |
| 40 | #define BTA_PAN_TX_PUSH 0x00 /* TX push. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 41 | #define BTA_PAN_TX_PULL 0x20 /* TX pull. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 42 | |
| 43 | /***************************************************************************** |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 44 | * Function Declarations |
| 45 | ****************************************************************************/ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 46 | |
| 47 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 48 | * |
| 49 | * Function bta_pan_co_init |
| 50 | * |
| 51 | * Description This callout function is executed by PAN when a server is |
| 52 | * started by calling BTA_PanEnable(). This function can be |
| 53 | * used by the phone to initialize data paths or for other |
| 54 | * initialization purposes. The function must return the |
| 55 | * data flow mask as described below. |
| 56 | * |
| 57 | * |
| 58 | * Returns Data flow mask. |
| 59 | * |
| 60 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 61 | extern uint8_t bta_pan_co_init(uint8_t* q_level); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 62 | |
| 63 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 64 | * |
| 65 | * Function bta_pan_co_open |
| 66 | * |
| 67 | * Description This function is executed by PAN when a connection |
| 68 | * is opened. The phone can use this function to set |
| 69 | * up data paths or perform any required initialization. |
| 70 | * |
| 71 | * |
| 72 | * Returns void |
| 73 | * |
| 74 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 75 | extern void bta_pan_co_open(uint16_t handle, uint8_t app_id, |
| 76 | tBTA_PAN_ROLE local_role, tBTA_PAN_ROLE peer_role, |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 77 | const RawAddress& peer_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 78 | |
| 79 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 80 | * |
| 81 | * Function bta_pan_co_close |
| 82 | * |
| 83 | * Description This function is called by PAN when a connection to a |
| 84 | * server is closed. |
| 85 | * |
| 86 | * |
| 87 | * Returns void |
| 88 | * |
| 89 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 90 | extern void bta_pan_co_close(uint16_t handle, uint8_t app_id); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 91 | |
| 92 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 93 | * |
| 94 | * Function bta_pan_co_tx_path |
| 95 | * |
| 96 | * Description This function is called by PAN to transfer data on the |
| 97 | * TX path; that is, data being sent from BTA to the phone. |
| 98 | * This function is used when the TX data path is configured |
| 99 | * to use the pull interface. |
| 100 | * |
| 101 | * |
| 102 | * Returns void |
| 103 | * |
| 104 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 105 | extern void bta_pan_co_tx_path(uint16_t handle, uint8_t app_id); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 106 | |
| 107 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 108 | * |
| 109 | * Function bta_pan_co_rx_path |
| 110 | * |
| 111 | * Description This function is called by PAN to transfer data on the |
| 112 | * RX path; that is, data being sent from the phone to BTA. |
| 113 | * This function is used when the RX data path is configured |
| 114 | * to use the pull interface. |
| 115 | * |
| 116 | * |
| 117 | * Returns void |
| 118 | * |
| 119 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 120 | extern void bta_pan_co_rx_path(uint16_t handle, uint8_t app_id); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 121 | |
| 122 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 123 | * |
| 124 | * Function bta_pan_co_tx_write |
| 125 | * |
| 126 | * Description This function is called by PAN to send data to the phone |
| 127 | * when the TX path is configured to use a push interface. |
| 128 | * The implementation of this function must copy the data to |
| 129 | * the phone's memory. |
| 130 | * |
| 131 | * |
| 132 | * Returns void |
| 133 | * |
| 134 | ******************************************************************************/ |
Jakub Pawlowski | a83ac12 | 2017-06-15 11:53:33 -0700 | [diff] [blame] | 135 | extern void bta_pan_co_tx_write(uint16_t handle, uint8_t app_id, |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 136 | const RawAddress& src, const RawAddress& dst, |
Jakub Pawlowski | a83ac12 | 2017-06-15 11:53:33 -0700 | [diff] [blame] | 137 | uint16_t protocol, uint8_t* p_data, |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 138 | uint16_t len, bool ext, bool forward); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 139 | |
| 140 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 141 | * |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 142 | * Function bta_pan_co_rx_flow |
| 143 | * |
| 144 | * Description This function is called by PAN to enable or disable |
| 145 | * data flow on the RX path when it is configured to use |
| 146 | * a push interface. If data flow is disabled the phone must |
| 147 | * not call bta_pan_ci_rx_write() or bta_pan_ci_rx_writebuf() |
| 148 | * until data flow is enabled again. |
| 149 | * |
| 150 | * |
| 151 | * Returns void |
| 152 | * |
| 153 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 154 | extern void bta_pan_co_rx_flow(uint16_t handle, uint8_t app_id, bool enable); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 155 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 156 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 157 | * |
| 158 | * Function bta_pan_co_filt_ind |
| 159 | * |
| 160 | * Description protocol filter indication from peer device |
| 161 | * |
| 162 | * Returns void |
| 163 | * |
| 164 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 165 | extern void bta_pan_co_pfilt_ind(uint16_t handle, bool indication, |
| 166 | tBTA_PAN_STATUS result, uint16_t len, |
| 167 | uint8_t* p_filters); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 168 | |
| 169 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 170 | * |
| 171 | * Function bta_pan_co_mfilt_ind |
| 172 | * |
| 173 | * Description multicast filter indication from peer device |
| 174 | * |
| 175 | * Returns void |
| 176 | * |
| 177 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 178 | extern void bta_pan_co_mfilt_ind(uint16_t handle, bool indication, |
| 179 | tBTA_PAN_STATUS result, uint16_t len, |
| 180 | uint8_t* p_filters); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 181 | |
| 182 | #endif /* BTA_PAN_CO_H */ |