strong_tws.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. /**********************************************************************
  2. *
  3. * strong_tws.c
  4. * 定义库里面tws部分WEAK函数的Strong函数,动态关闭库代码
  5. ***********************************************************************/
  6. #include "include.h"
  7. void strong_tws_include(void) {}
  8. #if !BT_TWS_EN
  9. void btstack_tws_init(void){}
  10. void a2dp_play_init(void){}
  11. AT(.com_text.sbc.play)
  12. void a2dp_play_reset(bool force){}
  13. AT(.com_text.sbc.play)
  14. void a2dp_play_reset_do(void){}
  15. AT(.com_text.sbc_cache)
  16. bool a2dp_cache_fill(uint8_t *packet, uint16_t size) {
  17. return true;
  18. }
  19. AT(.com_text.sbc_cache)
  20. uint8_t avdtp_fill_tws_buffer(u8 *ptr, uint len) {
  21. return 0;
  22. }
  23. AT(.com_text.sbc_cache)
  24. uint8_t a2dp_cache_before_rx(uint8_t *data_ptr, uint16_t data_len) {
  25. return 0;
  26. }
  27. AT(.sbcdec.code)
  28. void sbc_cache_free(void) {
  29. }
  30. AT(.sbcdec.code)
  31. size_t sbc_cache_read(uint8_t **buf) {
  32. return 0;
  33. }
  34. AT(.com_text.bb.tws)
  35. void bt_tws_ticks_isr(void) {
  36. }
  37. AT(.com_text.bb.btisr)
  38. void bt_tws_ticks_instant(void) {
  39. }
  40. AT(.com_text.bb.btisr)
  41. uint8_t tws_get_ticks_status(void) {
  42. return 0x80;
  43. }
  44. uint8_t bt_tws_set_spr(uint8_t index, uint spridx, uint32_t instant) {
  45. return 0;
  46. }
  47. AT(.com_text.sbc.play)
  48. void tws_ticks_trigger(uint32_t ticks) {
  49. }
  50. AT(.com_text.sbc.play)
  51. uint32_t tws_get_play_ticks(uint16_t seq_num, uint32_t duration) {
  52. return 0;
  53. }
  54. AT(.com_text.sbc.play)
  55. void tws_trigger_isr(void) {
  56. }
  57. AT(.com_text.sbc.play)
  58. bool tws_cache_is_empty(void) {
  59. return false;
  60. }
  61. AT(.com_text.sbc.play)
  62. void sbc_cache_env_reset(void)
  63. {
  64. }
  65. AT(.com_text.sbc.send)
  66. void tws_send_pkt(void)
  67. {
  68. }
  69. AT(.com_text.bb.btisr)
  70. void bt_tws_ticks_next_instant(void) {}
  71. AT(.com_text.lc.tws)
  72. uint8_t tws_get_snoop_status(void) {
  73. return 0;
  74. }
  75. AT(.com_text.sbc.play)
  76. void a2dp_set_play_ticks(uint32_t e_ticks, uint16_t seqn) {}
  77. AT(.com_text.sbc.play)
  78. bool a2dp_is_rx_stop(uint8_t index) { return false; }
  79. AT(.com_text.a2dp.lost)
  80. uint32_t a2dp_lost_get_cache(void) { return 0; }
  81. AT(.com_text.sbc)
  82. void tws_ticks_set(void) {}
  83. AT(.com_text.bb.tws_switch)
  84. bool bt_tws_need_switch(bool calling) { return false; }
  85. AT(.com_text.bb.bttx)
  86. bool tws_evs_rx_remote(u8 *buf) { return false; }
  87. AT(.com_text.bb.bttx)
  88. void tws_seqn_update_local(u32 e_ticks, uint16_t seqn, bool first) {}
  89. AT(.com_text.sbc.play)
  90. uint8_t avdtp_check_play_reset(void) { return 0; }
  91. AT(.com_text.sbc.play)
  92. size_t a2dp_play_read_do(uint8_t **buf) { return 0; }
  93. AT(.com_text.sbc.play)
  94. void a2dp_play_free_do(void) {}
  95. AT(.com_text.sbc.play)
  96. void a2dp_fix_slv_ticks(u32 m_ticks, u16 m_seqn) {}
  97. AT(.com_text.sbc.play)
  98. bool a2dp_fix_slv_ticks_cb(void) { return false; }
  99. AT(.com_text.sbc.play)
  100. bool tws_is_first_pkt(void) { return false; }
  101. AT(.com_text.sbc.play)
  102. bool tws_next_pkt_is_exist(void) { return true; }
  103. uint16_t tws_set_snoop_ticks(uint8_t *data_ptr, uint16_t size) { return false; }
  104. AT(.com_text.tws.weak)
  105. void tws_evs_send_proc(void) {}
  106. AT(.com_text.tws.weak)
  107. bool tws_evs_check_tx_ptr(uint16_t buf_ptr) { return false; }
  108. AT(.com_text.tws.weak)
  109. void tws_time_calc_proc(void) {}
  110. AT(.com_text.tws.weak)
  111. void tws_time_calc_proc_cb(void) {}
  112. AT(.com_text.tws.weak)
  113. void tws_time_fix_proc(void) {}
  114. AT(.com_text.tws.weak)
  115. void tws_time_proc_cb(u32 tickn) {}
  116. AT(.com_text.tws.weak)
  117. void tws_alarm_proc(uint32_t tickn) {}
  118. AT(.com_text.tws.weak)
  119. void tws_time_alarm_cb(uint32_t params, uint32_t alarm_tickn) {}
  120. void tws_local_alarm_req_cb(uint32_t tickn, uint16_t param) {}
  121. void tws_remote_alarm_req_cb(uint32_t tick, uint16_t param) {}
  122. void tws_local_res_add_cb(uint16_t param) {}
  123. void tws_remote_res_add_cb(uint16_t param) {}
  124. void tws_remote_res_done_cb(uint16_t param) {}
  125. void tws_slave_res_add_req_cb(uint16_t param) {}
  126. void btstack_tws_api(uint param) {}
  127. void bt_wait_tws_switch_end(void) {}
  128. bool bt_tws_is_en(void) {return 0;}
  129. void bt_tws_set_scan(uint8_t scan_en) {}
  130. bool btstack_tws_key(uint8_t key, uint16_t opcode) {return 0;}
  131. uint16_t btstack_get_nego_feat(void) {return 0;}
  132. uint8_t btstack_get_save_feature(uint8_t *bd_addr) {return 0;}
  133. bool btstack_tws_is_connected_for_handle(uint16_t handle) {return 0;}
  134. void btstack_tws_enter_sniff(bool tws_flag, bool tws_role) {}
  135. uint8_t btstack_get_force_feature(void) {return 0;}
  136. bool btstack_set_tws_info(uint8_t *param) {return 0;}
  137. void btstack_get_guid(uint8_t *buf, uint8_t buf_len) {}
  138. bool btstack_get_tws_info(uint8_t *param, uint8_t tws_info) {return 0;}
  139. bool btstack_cmp_guid(uint8_t *buf, uint8_t buf_len) {return 0;}
  140. void btstack_tws_remote_set_codec(uint8_t *param) {}
  141. void btstack_tws_disconnect_do(uint16_t timeout) {}
  142. void btstack_tws_disc_continue(void) {}
  143. uint8_t btstack_get_tws_key(uint msg) {return 0;}
  144. uint btstack_get_tws_msg(uint8_t key) {return 0;}
  145. bool nor_connect_req(uint8_t times, uint32_t connect_flag) {return 0;}
  146. bool btstack_tws_verify_connect(uint8_t *bd_addr) {return 0;}
  147. void btstack_tws_get_tws_name(uint8_t *tws_name) {}
  148. void tws_pair_id_init(void) {}
  149. bool tws_l2cap_set_send_flag(u32 flag) {return 0;}
  150. bool tws_l2cap_msg_send_req(u32 flag) {return 0;}
  151. bool tws_l2cap_msg_mst_set_send_flag(u32 flag) {return 0;}
  152. bool tws_l2cap_msg_mst_send_req(u32 flag) {return 0;}
  153. void tws_establish_service_level_connection(u8 address[]) {}
  154. bool tws_acl_tx_cfm_cb(uint8_t opcode) {return 0;}
  155. void tws_con_init(void) {}
  156. void tws_switch_restort_pend_cb(uint16_t con_handle, uint8_t num_pkts_sent) {}
  157. uint16_t tws_get_snoop_ticks_cb(uint8_t *data_ptr) {return 0;}
  158. uint16_t tws_set_snoop_ticks_cb(uint8_t *data_ptr, uint8_t size) {return 0;}
  159. bool tws_prepare_snoop_service(void) {return 0;}
  160. void tws_send_snoop_service(void) {}
  161. void tws_update_local_addr(uint8_t *address) {}
  162. bool tws_loc_switch_is_allow(void) {return 0;}
  163. AT(.com_text.tws.weak)
  164. bool tws_rem_switch_is_allow(void) {return 0;}
  165. void tws_set_new_avdtp_cid(uint16_t avdtp_cid) {}
  166. void tws_remote_set_discon(uint8_t reason) {}
  167. uint8_t tws_remote_vs_msg_cb(uint8_t opcode, uint8_t *pdu) {return 0;}
  168. void tws_remote_snoop_setup_cb(void) {}
  169. void tws_remote_snoop_lost_cb(void) {}
  170. void tws_remote_ticks_fail_cb(void) {}
  171. void tws_send_set_volume(uint8_t *bd_addr, uint8_t index, uint8_t a2dp_vol) {}
  172. void tws_send_a2dp_feat_record(uint8_t *bd_addr, uint8_t a2dp_feat) {}
  173. bool tws_send_set_key(uint8_t key, uint16_t opcode) { return false; }
  174. void tws_send_set_status(uint8_t status) {}
  175. void tws_send_set_disc_reason(uint8_t reason) {}
  176. void tws_send_set_profile_status(void) {}
  177. void tws_send_set_call_indicate(uint8_t *c_sta, uint8_t siri_sta) {}
  178. bool tws_send_set_latency(uint8_t latency) {return 0;}
  179. void tws_send_set_aap_info(void) {}
  180. void tws_send_set_fota_rsp(void) {}
  181. void tws_send_avdtp_cid(u16 l2cap_cid) {}
  182. void tws_send_avdtp_start_discard(u16 discard_cnt) {}
  183. void tws_set_discon_tx_cfm_cb(void) {}
  184. bool tws_vs_msg_pack_cb(const uint8_t *param) {return 0;}
  185. void tws_vs_msg_free_cb(const uint8_t *param, bool send_msg) {}
  186. void tws_vs_msg_tx_cfm_cb(uint8_t opcode) {}
  187. void tws_send_set_vol_ctrl_status(uint8_t vol_ctrl) {}
  188. void tws_send_ios_flag(uint8_t ios_flag) {}
  189. bool tws_get_snoop_info_bb(uint16_t *acl_conhdl, uint16_t *sco_conhdl, uint8_t *bdaddr) {return 0;}
  190. uint16_t bt_get_snoop_link(uint8_t *data_ptr) {return 0;}
  191. void tws_remote_snoop_lost(void) {}
  192. void tws_remote_snoop_setup(void) {}
  193. void tws_remote_set_codec(uint8_t *param) {}
  194. void tws_remote_ticks_fail(void) {}
  195. void tws_remote_set_speed(uint8_t *param) {}
  196. void tws_remote_snoop_sta(uint8_t status) {}
  197. void tws_sco_remote_setup(uint8_t *pdu) {}
  198. void tws_sco_remote_kill(uint8_t *pdu) {}
  199. void tws_vs_msg_flush(void) {}
  200. void tws_vs_msg_free(void const *msg_ptr, bool send_msg) {}
  201. bool tws_vs_msg_pack(void const *msg_ptr) {return 0;}
  202. void *tws_vs_msg_alloc(uint8_t opcode) {return NULL;}
  203. void tws_vs_msg_send(uint8_t *pdu) {}
  204. void tws_send_set_media_codec(uint16_t media_lcid, void *media_codec, bool scms_en) {}
  205. void tws_send_set_speed(uint8_t speed) {}
  206. void tws_send_set_snoop_sta(uint8_t status) {}
  207. void tws_send_speed_miss(void) {}
  208. void tws_send_set_disconnect(uint8_t reason) {}
  209. void tws_send_switch_req(void) {}
  210. void tws_msg_tx_cfm(uint8_t opcode) {}
  211. void *tws_vs_msg_peek_do(void) {return NULL;}
  212. AT(.com_text.tws.weak)
  213. uint8_t tws_acl_set_tx_ptr(uint16_t buf_ptr) {return 0;}
  214. AT(.com_text.tws.weak)
  215. void tws_acl_free_tx_ptr(uint8_t i) {}
  216. AT(.com_text.tws.weak)
  217. bool tws_acl_check_tx_ptr(uint16_t buf_ptr) {return 0;}
  218. AT(.com_text.tws.weak)
  219. bool tws_evs_get_snoop_offset_do(uint8_t index_s, uint8_t index_t, uint16_t *bitoff, uint32_t *clkoff) {return 0;}
  220. AT(.com_text.tws.weak)
  221. void tws_evs_set_snoop_offset_do(uint8_t index_s, uint8_t index_t, uint32_t clkoff_s, uint16_t bitoff_s) {}
  222. AT(.com_text.tws.weak)
  223. uint8_t tws_acl_tx_lost_pkt(uint16_t rcid, uint8_t *packet, uint8_t flag, uint16_t data_len) {return 0;}
  224. AT(.com_text.tws.weak)
  225. bool tws_acl_tx_is_vaild(void) {return 0;}
  226. void tws_ctl_con_cmp(uint8_t index) {}
  227. void tws_ctl_con_end(void) {}
  228. void tws_ctl_init(bool reset) {}
  229. void tws_set_local_ticks(uint16_t con_handle, uint8_t spr_idx) {}
  230. void tws_free_snoop_link(void) {}
  231. void tws_kill_snoop_link(uint8_t index) {}
  232. void tws_enter_sniff(uint16_t pid) {}
  233. AT(.com_text.tws.weak)
  234. void tws_evs_send_last_seqn_req(void) {}
  235. AT(.com_text.tws.weak)
  236. void tws_evs_send_first_seqn_req(uint32_t e_ticks, uint16_t seqn) {}
  237. AT(.com_text.tws.weak)
  238. void tws_evs_send_sco_req(void) {}
  239. AT(.com_text.tws.weak)
  240. bool tws_evs_send_avdtp_close_req(uint32_t ticks_ms, uint16_t avdtp_cid) {return 0;}
  241. AT(.com_text.tws.weak)
  242. void tws_seqn_clr_local(void) {}
  243. AT(.com_text.tws.weak)
  244. void tws_set_rx_ack2(uint8_t id) {}
  245. void tws_clr_txrx_ack2(void) {}
  246. AT(.com_text.tws.weak)
  247. bool tws_acl_rx_ack2tx(uint16_t stat, uint16_t rh) {return 0;}
  248. AT(.com_text.tws.weak)
  249. void tws_acl_rx_ack2rx(uint16_t rstat, uint16_t rh, uint16_t tstat) {}
  250. AT(.com_text.tws.weak)
  251. void tws_acl_rx_media_pkt(uint8_t *ptr) {}
  252. AT(.com_text.tws.weak)
  253. bool tws_sco_is_active(void) {return 0;}
  254. bool tws_sco_is_slave(void) {return 0;}
  255. void tws_sco_suspend_ack2(uint8_t id) {}
  256. void tws_sco_resume_ack2(uint8_t id) {}
  257. void tws_sco_start_link(uint16_t id, uint8_t sid, uint8_t *ptr) {}
  258. void tws_sco_stop_link(uint16_t id, uint8_t sid) {}
  259. void tws_sco_kill_link(uint8_t id) {}
  260. void tws_sco_buf_init(void) {}
  261. AT(.com_text.tws.weak)
  262. void tws_sco_buf_add(void *pkt_buf, bool pkt_stat, uint pkt_len, uint pkt_frame) {}
  263. AT(.com_text.tws.weak)
  264. bool tws_sco_rx_lost_pkt(uint8_t *ptr, uint16_t len) {return 0;}
  265. AT(.com_text.tws.weak)
  266. void tws_sco_tx_lost_pkt(void) {}
  267. AT(.com_text.tws.weak)
  268. uint8_t tws_vs_switch_is_active(void) {return 0;}
  269. void tws_vs_switch_kill(uint8_t id) {}
  270. void tws_vs_switch_finish(uint8_t id) {}
  271. AT(.com_text.tws.weak)
  272. bool tws_switch_acl_is_pause(uint32_t clock, uint8_t id) {return 0;}
  273. AT(.com_text.tws.weak)
  274. void tws_switch_restore_aclseqn(void) {}
  275. AT(.com_text.tws.weak)
  276. void tws_switch_check_inst(uint8_t *ptr, uint8_t tid, uint32_t clkn) {}
  277. void tws_set_switch_inst(uint32_t instant) {}
  278. bool tws_switch_save_pend(uint8_t type, uint8_t flag, uint8_t *buf, uint16_t len) {return 0;}
  279. bool tws_switch_save_acl_rx(uint8_t *ptr) {return 0;}
  280. void tws_switch_save_acl_tx(uint8_t id) {}
  281. void lc_flush_lmp_tx_pend(uint8_t id) {}
  282. void nanos_flush_pend(uint16_t did) {}
  283. AT(.com_text.ble.tws.weak)
  284. bool ble_scan0_rx_ind(uint8_t sid, uint8_t rid) {return 0;}
  285. bool ble_scan0_end_ind(uint8_t aid) {return 0;}
  286. void ble_page_init(uint8_t init_type) {}
  287. AT(.com_text.ble.tws.weak)
  288. uint8_t ble_page_start(uint8_t index, uint8_t *ptr, uint8_t feature) {return 0;}
  289. AT(.com_text.ble.tws.weak)
  290. uint8_t ble_page_stop(void) {return 0;}
  291. void ble_page_con_init(uint8_t index, void **slave_timing) {}
  292. AT(.com_text.ble.tws.weak)
  293. void ble_page_con_end(uint8_t index) {}
  294. AT(.com_text.ble.tws.weak)
  295. uint8_t ble_inq_start(void) {return 0;}
  296. AT(.com_text.tws.weak)
  297. uint8_t ble_inq_stop(void) {return 0;}
  298. void ble_pscan_init(uint8_t init_type) {}
  299. AT(.com_text.tws.weak)
  300. bool ble_pscan_rx_ind(uint8_t aid, uint8_t rid, uint *ret) {return 0;}
  301. void ble_pscan_set_interval(uint32_t interval) {}
  302. bool ble_pscan_end_ind(uint8_t aid) {return 0;}
  303. void ble_con_adv_restore(void) {}
  304. void ble_pscan_con_end(uint8_t index) {}
  305. void ble_pscan_con_init(uint8_t index, uint8_t lt_addr) {}
  306. void ble_w_scan_ctrl(uint8_t scan_en) {}
  307. #endif
  308. #if !BT_TWS_EN || !BT_HID_EN
  309. uint8_t btstack_get_tws_hid_key(uint msg) {return 0;}
  310. uint btstack_get_tws_hid_msg(uint8_t key) {return 0;}
  311. bool btstack_tws_slave_hid_key(uint8_t key, uint16_t opcode) {return 0;}
  312. #endif