bta_dm_co.h 8.0 KB

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