hci_lmp.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. #ifndef LMP_API_H
  2. #define LMP_API_H
  3. int lmp_private_is_clearing_a2dp_packet(void *_conn);
  4. int lmp_private_a2dp_channel_exist(void *_conn);
  5. int lmp_private_get_sbc_remain_time(void *_conn, u8 include_tws);
  6. void *lmp_private_open_sbc_channel(u8 *addr, u16 channel, u8 codec_type);
  7. void lmp_private_free_sbc_packet(void *_conn, void *packet);
  8. int lmp_private_get_sbc_data_len(void *_conn);
  9. int lmp_private_get_rx_buffer_size();
  10. void lmp_private_set_max_rx_buf_persent(u8 *addr, int persent);
  11. void *lmp_private_fetch_sbc_packet(void *_conn, int *len, void *_prev, int);
  12. int lmp_private_get_sbc_packet_num(void *_conn);
  13. void lmp_private_close_sbc_channel(void *_conn);
  14. int lmp_private_get_sbc_packet(void *_conn, u8 **frame, int block);
  15. u8 *lmp_private_get_tx_packet_buffer(int size);
  16. int lmp_private_clear_a2dp_packet(void *_conn, u16 seqn_number);
  17. int lmp_private_send_esco_packet(void *priv, u8 *packet, int len);
  18. u8 *lmp_private_remote_addr_for_handler(int handle);
  19. u16 lmp_private_handler_for_remote_addr(u8 *addr, int link_type);
  20. int lmp_private_get_rx_buffer_total_size(void *_conn);
  21. int lmp_private_get_rx_buffer_remain_size(void *_conn);
  22. void lmp_hci_private_hold_acl_packet(u8 *packet);
  23. void lmp_hci_private_free_acl_packet(u8 *packet);
  24. void lmp_hci_private_try_free_acl_packet(u8 *packet);
  25. int lmp_hci_send_packet(u8 *packet, int len);
  26. int lmp_hci_send_packet_standard(const u8 *packet, int len);
  27. int lmp_hci_reset();
  28. int lmp_hci_write_scan_enable(u8 enable);
  29. void lmp_hci_write_class_of_device(int dev_class);
  30. void lmp_hci_write_local_name(const char *name);
  31. void lmp_hci_write_local_priv_version(const char *ic_verson, const char *priv_version, u8 *tws_local_addr);
  32. void lmp_hci_write_local_address(const u8 *addr);
  33. void lmp_hci_write_simple_pairing_mode(u8 enable);
  34. void lmp_hci_write_super_timeout(u16 timeout);
  35. void lmp_hci_write_page_timeout(u16 timeout);
  36. void lmp_hci_write_tws_internal_addr(u8 *internal_addr_local, u8 *internal_addr_remote);
  37. void lmp_hci_write_link_supervision_timeout(u16 handle, int);
  38. int lmp_hci_write_le_host_support(int features);
  39. int lmp_hci_read_pin_type();
  40. void lmp_hci_set_pin_code(const char *code, u8 len);
  41. void lmp_hci_pin_code_request_reply(u8 *addr, u8 len, u8 *pin_code);
  42. void lmp_hci_pin_code_request_negative_reply(u8 *addr);
  43. int lmp_hci_write_pin_type(u8 type);
  44. int lmp_hci_set_connection_encryption(u16 handle, int enable);
  45. void lmp_hci_io_capability_request_reply(u8 *addr, u8 io_cap, u8 oob_data, u8 auth_req);
  46. void lmp_hci_user_confirmation_request_reply(u8 *address);
  47. void lmp_hci_user_confirmation_request_negative_reply(u8 *addr);
  48. int lmp_hci_disconnect(u16 handle, u8 reason);
  49. int lmp_hci_test_key_cmd(u8 cmd, u16 handle);
  50. int lmp_hci_send_user_info_cmd(u32 info, u16 handle);
  51. void lmp_hci_accept_connection_request(u8 *addr, u8 role);
  52. void lmp_hci_accept_sco_connection_request(u8 *addr, u32 tx_bandwidth,
  53. u32 rx_bandwidth, u16 max_latency, u16 content_format,
  54. u8 retransmission, u16 packey_type);
  55. void lmp_hci_reject_connection_request(u8 *addr, u8 reason);
  56. void lmp_hci_switch_role_command(u8 *addr, u8 role);
  57. void lmp_hci_authentication_requested(u16 handler);
  58. void lmp_hci_link_key_request_reply(u8 *addr, u8 *link_key);
  59. void lmp_hci_link_key_request_negative_reply(u8 *addr);
  60. void lmp_hci_write_default_link_policy_settings(u16 setting);
  61. void lmp_hci_release_packet(u8 *packet);
  62. void lmp_hci_create_connection(const u8 *addr, u16 packet_type,
  63. u8 repetition_mode, u8 reserved,
  64. u16 clk_offset, u8 allow_role_switch);
  65. void lmp_hci_connection_cancel(u8 *addr);;
  66. void lmp_hci_cancel_page();
  67. void lmp_hci_inquiry(int lap, u8 length, u8 num);
  68. void lmp_hci_cancel_inquiry();
  69. void lmp_hci_sniff_mode_command(u16 handle, u16 max_interval, u16 min_interval, u16 attempt, u16 timeout);
  70. void lmp_hci_exit_sniff_mode_command(u16 handle);
  71. void lmp_hci_host_num_of_completed_packets(u16 handle, u16 num_of_completed_packet);
  72. int lmp_hci_read_remote_version_information(u16 handle);
  73. void lmp_hci_read_remote_supported_features(u16 handle);
  74. void lmp_hci_read_remote_extended_features(u16 handle);
  75. void lmp_hci_role_discovery(u16 handle);
  76. void lmp_hci_read_clock_offset(u16 handle);
  77. void lmp_hci_read_link_policy_settings(u16 handle);
  78. void lmp_hci_write_link_policy_settings(u16 handle, u16 policy);
  79. void lmp_hci_remote_name_request(u8 *addr, u8 page_scan_repetition_mode, u16 clk_offset);
  80. void lmp_set_sniff_establish_by_remote(u8 enable);
  81. void lmp_set_sniff_disable(void);
  82. u8 lmp_hci_read_local_supported_features(int octet);
  83. void lmp_hci_write_local_supported_features(u8 features, int octet);
  84. u8 lmp_standard_connect_check(void);
  85. void lmp_hci_send_keypress_notification(u8 *addr, u8 key);
  86. void lmp_hci_user_keypress_request_reply(u8 *addr, u32 key);
  87. void lmp_hci_user_keypress_request_negative_reply(u8 *addr, u8 key);
  88. void lmp_hci_set_role_switch_supported(bool enable);
  89. void lmp_hci_tx_channel_chassification(u8 *map);
  90. u8 *get_tws_internal_addr(int channel);
  91. extern int lmp_private_esco_suspend_resume(int flag);;
  92. void user_set_tws_box_mode(u8 mode);
  93. void bt_set_tx_power(u8 txpower);
  94. void bredr_bulk_change(u8 mode);
  95. extern u8 get_bredr_link_state();
  96. extern u32 get_bt_slot_time(u8 type, u32 time, int *ret_time, int (*local_us_time)(void));
  97. extern u32 get_sync_rec_instant_us_time();
  98. extern u8 tws_remote_state_check(void);
  99. extern void tws_remote_state_clear(void);
  100. extern void user_set_tws_box_mode(u8 mode);
  101. extern void bredr_fcc_init(u8 mode, u8 fre);
  102. extern void bredr_set_dut_enble(u8 en, u8 phone);
  103. extern int a2dp_media_clear_packet_before_seqn(u16 seqn_number);
  104. struct link_fix_rx_result {
  105. u32 rx_err_b; //接收到err bit
  106. u32 rx_sum_b; //接收到正确bit
  107. u32 rx_perr_p; //接收到crc 错误 包数
  108. u32 rx_herr_p; //接收到crc 以外其他错误包数
  109. u32 rx_invail_p; //接收到crc错误bit太多的包数,丢弃不统计到err bit中
  110. };
  111. #define DH1_1 0
  112. #define DH3_1 1
  113. #define DH5_1 2
  114. #define DH1_2 3
  115. #define DH3_2 4
  116. #define DH5_2 5
  117. int link_fix_tx_enable(u8 *remote_addr, u8 fre, u8 packet_type, u16 payload);
  118. int link_fix_rx_enable(u8 *remote_addr, u8 fre, u8 packet_type, u16 payload);
  119. void link_fix_txrx_disable();
  120. void link_fix_rx_update_result(struct link_fix_rx_result *result);
  121. void link_fix_rx_dump_result();
  122. #endif