bta_pan_ci.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. * This is the interface file for pan call-in functions.
  21. *
  22. ******************************************************************************/
  23. #ifndef BTA_PAN_CI_H
  24. #define BTA_PAN_CI_H
  25. #include "bta_pan_api.h"
  26. /*****************************************************************************
  27. * Function Declarations
  28. ****************************************************************************/
  29. /*******************************************************************************
  30. *
  31. * Function bta_pan_ci_tx_ready
  32. *
  33. * Description This function sends an event to PAN indicating the phone is
  34. * ready for more data and PAN should call
  35. * bta_pan_co_tx_path().
  36. * This function is used when the TX data path is configured
  37. * to use a pull interface.
  38. *
  39. *
  40. * Returns void
  41. *
  42. ******************************************************************************/
  43. extern void bta_pan_ci_tx_ready(uint16_t handle);
  44. /*******************************************************************************
  45. *
  46. * Function bta_pan_ci_rx_ready
  47. *
  48. * Description This function sends an event to PAN indicating the phone
  49. * has data available to send to PAN and PAN should call
  50. * bta_pan_co_rx_path(). This function is used when the RX
  51. * data path is configured to use a pull interface.
  52. *
  53. *
  54. * Returns void
  55. *
  56. ******************************************************************************/
  57. extern void bta_pan_ci_rx_ready(uint16_t handle);
  58. /*******************************************************************************
  59. *
  60. * Function bta_pan_ci_tx_flow
  61. *
  62. * Description This function is called to enable or disable data flow on
  63. * the TX path. The phone should call this function to
  64. * disable data flow when it is congested and cannot handle
  65. * any more data sent by bta_pan_co_tx_write() or
  66. * bta_pan_co_tx_writebuf(). This function is used when the
  67. * TX data path is configured to use a push interface.
  68. *
  69. *
  70. * Returns void
  71. *
  72. ******************************************************************************/
  73. extern void bta_pan_ci_tx_flow(uint16_t handle, bool enable);
  74. /*******************************************************************************
  75. *
  76. * Function bta_pan_ci_rx_writebuf
  77. *
  78. * Description This function is called to send data to the phone when
  79. * the RX path is configured to use a push interface with
  80. * zero copy. The function sends an event to PAN containing
  81. * the data buffer. The buffer will be freed by BTA; the
  82. * phone must not free the buffer.
  83. *
  84. *
  85. * Returns true if flow enabled
  86. *
  87. ******************************************************************************/
  88. extern void bta_pan_ci_rx_writebuf(uint16_t handle, const RawAddress& src,
  89. const RawAddress& dst, uint16_t protocol,
  90. BT_HDR* p_buf, bool ext);
  91. /*******************************************************************************
  92. *
  93. * Function bta_pan_ci_readbuf
  94. *
  95. * Description This function is called by the phone to read data from PAN
  96. * when the TX path is configured to use a pull interface.
  97. * The caller must free the buffer when it is through
  98. * processing the buffer.
  99. *
  100. *
  101. * Returns void
  102. *
  103. ******************************************************************************/
  104. extern BT_HDR* bta_pan_ci_readbuf(uint16_t handle, RawAddress& src,
  105. RawAddress& dst, uint16_t* p_protocol,
  106. bool* p_ext, bool* p_forward);
  107. /*******************************************************************************
  108. *
  109. * Function bta_pan_ci_set_pfilters
  110. *
  111. * Description This function is called to set protocol filters
  112. *
  113. *
  114. * Returns void
  115. *
  116. ******************************************************************************/
  117. extern void bta_pan_ci_set_pfilters(uint16_t handle, uint16_t num_filters,
  118. uint16_t* p_start_array,
  119. uint16_t* p_end_array);
  120. /*******************************************************************************
  121. *
  122. * Function bta_pan_ci_set_mfilters
  123. *
  124. * Description This function is called to set multicast filters
  125. *
  126. *
  127. * Returns void
  128. *
  129. ******************************************************************************/
  130. extern void bta_pan_ci_set_mfilters(uint16_t handle, uint16_t num_mcast_filters,
  131. uint8_t* p_start_array,
  132. uint8_t* p_end_array);
  133. #endif /* BTA_PAN_CI_H */