1 /****************************************************************************** 2 * 3 * Copyright 2006-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 device mananger callout functions. 22 * 23 ******************************************************************************/ 24 #ifndef BTA_DM_CO_H 25 #define BTA_DM_CO_H 26 27 #include "bta/include/bta_api.h" 28 #include "stack/include/bt_types.h" 29 #include "stack/include/btm_api_types.h" 30 #include "types/raw_address.h" 31 32 #ifndef BTA_SCO_OUT_PKT_SIZE 33 #define BTA_SCO_OUT_PKT_SIZE BTM_SCO_DATA_SIZE_MAX 34 #endif 35 36 /***************************************************************************** 37 * Function Declarations 38 ****************************************************************************/ 39 40 /******************************************************************************* 41 * 42 * Function bta_dm_co_io_req 43 * 44 * Description This callout function is executed by DM to get IO 45 * capabilities of the local device for the Simple Pairing 46 * process 47 * 48 * Parameters bd_addr - The peer device 49 * *p_io_cap - The local Input/Output capabilities 50 * *p_oob_data - true, if OOB data is available for the peer 51 * device. 52 * *p_auth_req - true, if MITM protection is required. 53 * 54 * Returns void. 55 * 56 ******************************************************************************/ 57 extern void bta_dm_co_io_req(const RawAddress& bd_addr, tBTM_IO_CAP* p_io_cap, 58 tBTM_OOB_DATA* p_oob_data, 59 tBTM_AUTH_REQ* p_auth_req, bool is_orig); 60 61 /******************************************************************************* 62 * 63 * Function bta_dm_co_io_rsp 64 * 65 * Description This callout function is executed by DM to report IO 66 * capabilities of the peer device for the Simple Pairing 67 * process 68 * 69 * Parameters bd_addr - The peer device 70 * io_cap - The remote Input/Output capabilities 71 * oob_data - true, if OOB data is available for the peer 72 * device. 73 * auth_req - true, if MITM protection is required. 74 * 75 * Returns void. 76 * 77 ******************************************************************************/ 78 extern void bta_dm_co_io_rsp(const RawAddress& bd_addr, tBTM_IO_CAP io_cap, 79 tBTM_OOB_DATA oob_data, tBTM_AUTH_REQ auth_req); 80 81 /******************************************************************************* 82 * 83 * Function bta_dm_co_loc_oob 84 * 85 * Description This callout function is executed by DM to report the OOB 86 * data of the local device for the Simple Pairing process 87 * 88 * Parameters valid - true, if the local OOB data is retrieved from LM 89 * c - Simple Pairing Hash C 90 * r - Simple Pairing Randomnizer R 91 * 92 * Returns void. 93 * 94 ******************************************************************************/ 95 extern void bta_dm_co_loc_oob(bool valid, const Octet16& c, const Octet16& r); 96 97 /******************************************************************************* 98 * 99 * Function bta_dm_co_rmt_oob 100 * 101 * Description This callout function is executed by DM to request the OOB 102 * data for the remote device for the Simple Pairing process 103 * 104 * Parameters bd_addr - The peer device 105 * 106 * Returns void. 107 * 108 ******************************************************************************/ 109 extern void bta_dm_co_rmt_oob(const RawAddress& bd_addr); 110 111 /******************************************************************************* 112 * 113 * Function bta_dm_sco_co_open 114 * 115 * Description This function is executed when a SCO connection is open. 116 * 117 * 118 * Returns void 119 * 120 ******************************************************************************/ 121 extern void bta_dm_sco_co_open(uint16_t handle, uint8_t pkt_size, 122 uint16_t event); 123 124 /******************************************************************************* 125 * 126 * Function bta_dm_sco_co_close 127 * 128 * Description This function is called when a SCO connection is closed 129 * 130 * 131 * Returns void 132 * 133 ******************************************************************************/ 134 extern void bta_dm_sco_co_close(void); 135 136 /******************************************************************************* 137 * 138 * Function bta_dm_sco_co_out_data 139 * 140 * Description This function is called to send SCO data over HCI. 141 * 142 * Returns void 143 * 144 ******************************************************************************/ 145 extern void bta_dm_sco_co_out_data(BT_HDR** p_buf); 146 147 /******************************************************************************* 148 * 149 * Function bta_dm_sco_co_in_data 150 * 151 * Description This function is called to send incoming SCO data to 152 * application. 153 * 154 * Returns void 155 * 156 ******************************************************************************/ 157 extern void bta_dm_sco_co_in_data(BT_HDR* p_buf, tBTM_SCO_DATA_FLAG status); 158 159 /******************************************************************************* 160 * 161 * Function bta_dm_co_ble_io_req 162 * 163 * Description This callout function is executed by DM to get BLE IO 164 * capabilities before SMP pairing gets going. 165 * 166 * Parameters bd_addr - The peer device 167 * *p_io_cap - The local Input/Output capabilities 168 * *p_oob_data - true, if OOB data is available for the peer 169 * device. 170 * *p_auth_req - Auth request setting (Bonding and MITM 171 * required or not) 172 * *p_max_key_size - max key size local device supported. 173 * *p_init_key - initiator keys. 174 * *p_resp_key - responder keys. 175 * 176 * Returns void. 177 * 178 ******************************************************************************/ 179 extern void bta_dm_co_ble_io_req( 180 const RawAddress& bd_addr, tBTM_IO_CAP* p_io_cap, tBTM_OOB_DATA* p_oob_data, 181 tBTM_LE_AUTH_REQ* p_auth_req, uint8_t* p_max_key_size, 182 tBTM_LE_KEY_TYPE* p_init_key, tBTM_LE_KEY_TYPE* p_resp_key); 183 184 /******************************************************************************* 185 * 186 * Function bta_dm_co_ble_local_key_reload 187 * 188 * Description This callout function is to load the local BLE keys if 189 * available on the device. 190 * 191 * Parameters none 192 * 193 * Returns void. 194 * 195 ******************************************************************************/ 196 extern void bta_dm_co_ble_load_local_keys( 197 tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask, Octet16* p_er, 198 tBTA_BLE_LOCAL_ID_KEYS* p_id_keys); 199 200 #endif /* BTA_DM_CO_H */ 201