btc_a2dp.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. /*******************************************************************************
  14. *
  15. * Filename: btc_a2dp.h
  16. *
  17. * Description: Common definitions for A2DP
  18. *
  19. *******************************************************************************/
  20. #ifndef __BTC_A2DP_H__
  21. #define __BTC_A2DP_H__
  22. #include <stdbool.h>
  23. #include "common/bt_target.h"
  24. #include "bta/bta_api.h"
  25. #include "btc_av_api.h"
  26. #include "esp_a2dp_api.h"
  27. #if BTC_AV_INCLUDED
  28. /*******************************************************************************
  29. ** Constants
  30. *******************************************************************************/
  31. #define BTC_AV_SUCCESS (0)
  32. /**
  33. * AV (Audio Video source) Errors
  34. */
  35. #define BTC_ERROR_SRV_AV_NOT_ENABLED 700 /* AV is not enabled */
  36. #define BTC_ERROR_SRV_AV_FEEDING_NOT_SUPPORTED 701 /* Requested Feeding not supported */
  37. #define BTC_ERROR_SRV_AV_BUSY 702 /* Another operation ongoing */
  38. #define BTC_ERROR_SRV_AV_NOT_OPENED 703 /* No AV link opened */
  39. #define BTC_ERROR_SRV_AV_NOT_STARTED 704 /* AV is not started */
  40. #define BTC_ERROR_SRV_AV_CP_NOT_SUPPORTED 705 /* Content protection is not supported by all headsets */
  41. /* Transcoding definition for TxTranscoding and RxTranscoding */
  42. #define BTC_MEDIA_TRSCD_OFF 0
  43. #define BTC_MEDIA_TRSCD_PCM_2_SBC 1 /* Tx */
  44. /*******************************************************************************
  45. ** Data types
  46. *******************************************************************************/
  47. typedef int tBTC_AV_STATUS;
  48. /*******************************************************************************
  49. ** Public functions
  50. *******************************************************************************/
  51. void btc_a2dp_on_init(void);
  52. /*******************************************************************************
  53. **
  54. ** Function btc_a2dp_on_idle
  55. **
  56. ** Description Process 'idle' request from BTC AV state machine during
  57. ** initialization
  58. **
  59. *******************************************************************************/
  60. void btc_a2dp_on_idle(void);
  61. /*******************************************************************************
  62. **
  63. ** Function btc_a2dp_on_started
  64. **
  65. ** Description Process 'start' request from BTC AV state machine to prepare
  66. ** for A2DP streaming
  67. **
  68. ** Return TRUE if an ACK for the local command is sent
  69. **
  70. *******************************************************************************/
  71. BOOLEAN btc_a2dp_on_started(tBTA_AV_START *p_av, BOOLEAN pending_start);
  72. /*******************************************************************************
  73. **
  74. ** Function btc_a2dp_on_stopped
  75. **
  76. ** Description Process 'stop' request from BTC AV state machine to stop
  77. ** A2DP streaming
  78. **
  79. *******************************************************************************/
  80. void btc_a2dp_on_stopped(tBTA_AV_SUSPEND *p_av);
  81. /*******************************************************************************
  82. **
  83. ** Function btc_a2dp_on_suspended
  84. **
  85. ** Description Process 'stop' request from BTC AV state machine to suspend
  86. ** A2DP streaming
  87. **
  88. *******************************************************************************/
  89. void btc_a2dp_on_suspended(tBTA_AV_SUSPEND *p_av);
  90. #endif /* #if BTC_AV_INCLUDED */
  91. #endif /* __BTC_A2DP_H__ */