ql_api_bt_spp.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*================================================================
  2. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  3. Quectel Wireless Solutions Proprietary and Confidential.
  4. =================================================================*/
  5. #ifndef QL_API_BT_SPP_H
  6. #define QL_API_BT_SPP_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #include "ql_api_bt_common.h"
  11. typedef struct
  12. {
  13. int state; //different from evnet type
  14. ql_bt_addr_s addr; //remote address
  15. }ql_bt_spp_event_info_t;
  16. typedef struct
  17. {
  18. uint8 *buf;
  19. uint16 dataLen;
  20. } ql_bt_spp_data_info_t;
  21. /*****************************************************************
  22. * Function: ql_bt_spp_init
  23. *
  24. * Description:
  25. * 初始化BT SPP并注册回调函数。初始化会设置BT的mac地址
  26. *
  27. * Parameters:
  28. * bt_cb [in] 回调函数
  29. *
  30. * Return:ql_errcode_bt_e
  31. *
  32. *****************************************************************/
  33. ql_errcode_bt_e ql_bt_spp_init(ql_bt_callback bt_cb);
  34. /*****************************************************************
  35. * Function: ql_bt_spp_connect_req
  36. *
  37. * Description:
  38. *
  39. *
  40. * Parameters:
  41. * bdAddr [in] 设备地址
  42. *
  43. * Return:ql_errcode_bt_e
  44. *
  45. *****************************************************************/
  46. ql_errcode_bt_e ql_bt_spp_connect(ql_bt_addr_s bdAddr);
  47. /*****************************************************************
  48. * Function: ql_bt_spp_disconnect_req
  49. *
  50. * Description:
  51. *
  52. *
  53. * Parameters:
  54. *
  55. *
  56. * Return:ql_errcode_bt_e
  57. *
  58. *****************************************************************/
  59. ql_errcode_bt_e ql_bt_spp_disconnect(void);
  60. /*****************************************************************
  61. * Function: ql_bt_spp_data_send_req
  62. *
  63. * Description:
  64. *
  65. *
  66. * Parameters:
  67. *
  68. *
  69. * Return:ql_errcode_bt_e
  70. *
  71. *****************************************************************/
  72. ql_errcode_bt_e ql_bt_spp_data_send(uint8 *src_buf, uint16 data_len);
  73. /*****************************************************************
  74. * Function: ql_bt_spp_release
  75. *
  76. * Description:
  77. * BT SPP释放资源
  78. *
  79. * Parameters:
  80. *
  81. * Return:ql_errcode_bt_e
  82. *
  83. *****************************************************************/
  84. ql_errcode_bt_e ql_bt_spp_release(void);
  85. #ifdef __cplusplus
  86. } /*"C" */
  87. #endif
  88. #endif /* QL_API_BT_SPP_H */