strong_bt.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /**********************************************************************
  2. *
  3. * strong_bt.c
  4. * 定义库里面bt部分WEAK函数的Strong函数,动态关闭库代码
  5. ***********************************************************************/
  6. #include "include.h"
  7. #if (!BT_FCC_TEST_EN && !FUNC_BT_FCC_EN) || !LE_EN
  8. uint8_t vs_ble_test(void const *cmd) {
  9. return 0x11;
  10. }
  11. #if !LE_BQB_RF_EN
  12. uint8_t ble_test_start(void* params) {
  13. return 0x0c;
  14. }
  15. uint8_t ble_test_stop(void) {
  16. return 0x0c;
  17. }
  18. #endif
  19. #endif
  20. #if BT_FCC_TEST_EN || FUNC_BT_FCC_EN
  21. #if LE_EN
  22. uint8_t vs_ble_test_do(void const *cmd);
  23. uint8_t vs_ble_test(void const *cmd) {
  24. return vs_ble_test_do(cmd);
  25. }
  26. #endif
  27. #else
  28. AT(.com_text.bt21.isr.test.fcc)
  29. bool bt_acl_test_rx_end(uint8_t index, void *par) {
  30. return false;
  31. }
  32. #if !IODM_TEST_EN
  33. uint8_t vs_fcc_test_cmd(void const *param) {
  34. return 0x11;
  35. }
  36. #endif
  37. #if !LE_BQB_RF_EN
  38. void hci_h3c_init(void) {}
  39. void bt_uart_init(void){}
  40. AT(.com_text.stack.uart_isr)
  41. bool bt_uart_isr(void) {
  42. return false;
  43. }
  44. #endif
  45. #endif
  46. #if !BT_HID_EN
  47. void hid_device_init(void) {}
  48. int bt_hid_is_connected(void) { return 0;}
  49. void hid_establish_service_level_connection(void* bd_addr) {}
  50. void hid_release_service_level_connection(void* bd_addr) {}
  51. void *get_hid_device_context_for_bd_addr(void *bd_addr) {return NULL;}
  52. void remove_hid_device_context(void * hid_device) {}
  53. void btstack_hid_api(uint param) {}
  54. const void *btstack_hid_tbl[0];
  55. void btstack_hid_send(void) {}
  56. bool bt_hid_send(void *buf, uint len, bool auto_release) { return false;}
  57. bool bt_hid_send_key(uint type, uint keycode) {return false;}
  58. bool bt_hid_is_send_complete(void) { return true;}
  59. void hid_report_set(void *buf, uint len, bool auto_release) {}
  60. bool bsp_bt_hid_vol_change(u16 keycode) {return 0;}
  61. bool bsp_bt_hid_photo(u16 keycode) {return 0;}
  62. void bsp_bt_hid_tog_conn(void) {}
  63. #endif
  64. #if !BT_HID_DOUYIN_EN
  65. void btstack_hid_douyin(uint keycode){}
  66. #endif
  67. #if !BT_HID_EN || !BT_TWS_MS_SWITCH_EN
  68. uint8_t tws_get_hid_service_report(uint8_t *data_ptr) {return 0;}
  69. uint8_t tws_set_hid_service_report(uint8_t *data_ptr, uint8_t len) {return 0;}
  70. uint8_t tws_get_hid_service(uint8_t *data_ptr){return 0;}
  71. uint8_t tws_set_hid_service(uint8_t *data_ptr, uint16_t conhdl, u8 address[], uint8_t len){return 0;}
  72. #endif
  73. #if !BT_2ACL_EN
  74. void avdtp_ready_switch_play(void) {};
  75. #endif
  76. #if !BT_AVDTP_DYN_LATENCY_EN
  77. void a2dp_set_latency_ms(uint32_t a2dp_latency_ms) {}
  78. void a2dp_latency_check(void) {}
  79. uint16_t a2dp_calc_latency(int8_t rssi, uint16_t rxpkt_ok, uint8_t rxpkt_fail, uint8_t rxpkt_total) {return 0;}
  80. AT(.com_text.sbc.play)
  81. void a2dp_switch_latency(void) {}
  82. #endif
  83. #if !BT_A2DP_EXCEPT_RESTORE_PLAY_EN
  84. void noload_set_play_state(uint8_t play_state){}
  85. uint16_t noload_get_play_state(uint8_t play_state){return 0;}
  86. void noload_clear_play_state(uint8_t play_state){}
  87. void noload_reset_play_state() {}
  88. #endif
  89. WEAK uint8_t bt_get_connected_num(void) {return 0;}
  90. #if !BT_HFP_REC_EN
  91. AT(.com_text.bt_rec)
  92. void bt_sco_rec_mix_do(u8 *buf, u32 samples) {}
  93. void bt_sco_rec_fill_far_buf(u16 *buf, u16 samples) {}
  94. #endif
  95. #if !BT_SPP_EN
  96. void spp_establish_service_level_connection(void *bd_addr) {}
  97. void spp_release_service_level_connection(void *bd_addr) {}
  98. void remove_spp_connection_context(void * spp_connection) {}
  99. void * provide_spp_connection_context_for_bd_addr(void *bd_addr) { return NULL; }
  100. void spp_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) {}
  101. void spp_service_flush(void) {}
  102. void * get_spp_connection_context_for_bd_addr(void *bd_addr) { return NULL; }
  103. void spp_init_var(void) {}
  104. #endif
  105. #if !BT_SPP_EN
  106. void spp_txpkt_init(void) {}
  107. AT(.com_text.spp.send_req)
  108. void btstack_spp_send_req(void) {}
  109. int spp_send_packet_channel0(void *context, void *buf) {return -1;}
  110. AT(.com_text.spp.event_send)
  111. void spp_event_send(uint16_t cid) {}
  112. #endif
  113. #if !(BT_PBAP_EN || BT_MAP_EN)
  114. void goep_client_init() {}
  115. uint8_t tws_get_goep_service(uint8_t *data_ptr) { return 0; }
  116. uint8_t tws_set_goep_service(uint8_t *data_ptr, uint16_t conhdl, void *address, uint8_t len) { return 0; }
  117. void goep_client_remove_connection(void) {}
  118. #endif
  119. #if !BT_MAP_EN
  120. void map_client_init(void) {}
  121. void btstack_map(uint param) {}
  122. void bt_get_time(char *ptr){}
  123. uint8_t tws_set_map_service(uint8_t *data_ptr, uint16_t conhdl, void *address, uint8_t len) { return 0; }
  124. uint8_t tws_get_map_service(uint8_t *data_ptr) { return 0; }
  125. void map_client_remove_connection(void) {}
  126. int bt_map_is_connected(void) { return 0; }
  127. #endif
  128. #if !BT_PBAP_EN
  129. void pbap_client_init(void) {}
  130. void pbap_establish_service_level_connection(void* addr) {}
  131. const void *btstack_pbap_tbl[0];
  132. void btstack_pbap_api(uint param) {}
  133. bool bt_pbap_is_connected(void) {return false;}
  134. #endif