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 data gateway call-out functions. 22 * 23 ******************************************************************************/ 24 #ifndef BTA_PAN_CO_H 25 #define BTA_PAN_CO_H 26 27 #include <cstdint> 28 29 #include "bta/include/bta_pan_api.h" 30 31 /***************************************************************************** 32 * Constants 33 ****************************************************************************/ 34 35 /* BT_HDR buffer offset */ 36 #define BTA_PAN_MIN_OFFSET PAN_MINIMUM_OFFSET 37 38 /* Data Flow Mask */ 39 #define BTA_PAN_RX_PUSH 0x00 /* RX push. */ 40 #define BTA_PAN_RX_PUSH_BUF 0x01 /* RX push with zero copy. */ 41 #define BTA_PAN_RX_PULL 0x02 /* RX pull. */ 42 #define BTA_PAN_TX_PUSH 0x00 /* TX push. */ 43 #define BTA_PAN_TX_PULL 0x20 /* TX pull. */ 44 45 /***************************************************************************** 46 * Function Declarations 47 ****************************************************************************/ 48 49 /******************************************************************************* 50 * 51 * Function bta_pan_co_init 52 * 53 * Description This callout function is executed by PAN when a server is 54 * started by calling BTA_PanEnable(). This function can be 55 * used by the phone to initialize data paths or for other 56 * initialization purposes. The function must return the 57 * data flow mask as described below. 58 * 59 * 60 * Returns Data flow mask. 61 * 62 ******************************************************************************/ 63 extern uint8_t bta_pan_co_init(uint8_t* q_level); 64 65 /******************************************************************************* 66 * 67 * Function bta_pan_co_close 68 * 69 * Description This function is called by PAN when a connection to a 70 * server is closed. 71 * 72 * 73 * Returns void 74 * 75 ******************************************************************************/ 76 extern void bta_pan_co_close(uint16_t handle, uint8_t app_id); 77 78 /******************************************************************************* 79 * 80 * Function bta_pan_co_tx_path 81 * 82 * Description This function is called by PAN to transfer data on the 83 * TX path; that is, data being sent from BTA to the phone. 84 * This function is used when the TX data path is configured 85 * to use the pull interface. 86 * 87 * 88 * Returns void 89 * 90 ******************************************************************************/ 91 extern void bta_pan_co_tx_path(uint16_t handle, uint8_t app_id); 92 93 /******************************************************************************* 94 * 95 * Function bta_pan_co_rx_path 96 * 97 * Description This function is called by PAN to transfer data on the 98 * RX path; that is, data being sent from the phone to BTA. 99 * This function is used when the RX data path is configured 100 * to use the pull interface. 101 * 102 * 103 * Returns void 104 * 105 ******************************************************************************/ 106 extern void bta_pan_co_rx_path(uint16_t handle, uint8_t app_id); 107 108 /******************************************************************************* 109 * 110 * Function bta_pan_co_rx_flow 111 * 112 * Description This function is called by PAN to enable or disable 113 * data flow on the RX path when it is configured to use 114 * a push interface. If data flow is disabled the phone must 115 * not call bta_pan_ci_rx_write() or bta_pan_ci_rx_writebuf() 116 * until data flow is enabled again. 117 * 118 * 119 * Returns void 120 * 121 ******************************************************************************/ 122 extern void bta_pan_co_rx_flow(uint16_t handle, uint8_t app_id, bool enable); 123 124 /******************************************************************************* 125 * 126 * Function bta_pan_co_filt_ind 127 * 128 * Description protocol filter indication from peer device 129 * 130 * Returns void 131 * 132 ******************************************************************************/ 133 extern void bta_pan_co_pfilt_ind(uint16_t handle, bool indication, 134 tBTA_PAN_STATUS result, uint16_t len, 135 uint8_t* p_filters); 136 137 /******************************************************************************* 138 * 139 * Function bta_pan_co_mfilt_ind 140 * 141 * Description multicast filter indication from peer device 142 * 143 * Returns void 144 * 145 ******************************************************************************/ 146 extern void bta_pan_co_mfilt_ind(uint16_t handle, bool indication, 147 tBTA_PAN_STATUS result, uint16_t len, 148 uint8_t* p_filters); 149 150 #endif /* BTA_PAN_CO_H */ 151