wm_bt_hf_client.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. /**
  2. * @file wm_bt_hf_client.h
  3. *
  4. * @brief Bluetooth API
  5. *
  6. * @author WinnerMicro
  7. *
  8. * Copyright (c) 2020 Winner Microelectronics Co., Ltd.
  9. */
  10. #ifndef __WM_BT_HF_CLIENT_H__
  11. #define __WM_BT_HF_CLIENT_H__
  12. #include "wm_bt.h"
  13. /**
  14. * @defgroup BT_APIs Bluetooth APIs
  15. * @brief Bluetooth related APIs
  16. */
  17. /**
  18. * @addtogroup BT_APIs
  19. * @{
  20. */
  21. /**
  22. * @defgroup BT_HF_CLIENT_APIs
  23. * @brief BT_HF_CLIENT APIs
  24. */
  25. /**
  26. * @addtogroup BT_HF_CLIENT_APIs
  27. * @{
  28. */
  29. /**
  30. * @brief initializes the hf client interface
  31. *
  32. * @param[in] callback pointer on callback function
  33. *
  34. * @retval @ref tls_bt_status_t
  35. *
  36. * @note None
  37. */
  38. tls_bt_status_t tls_bt_hf_client_init(tls_bthf_client_callback_t callback);
  39. /**
  40. * @brief Closes the HF client interface
  41. *
  42. * @param None
  43. *
  44. * @retval @ref tls_bt_status_t
  45. *
  46. * @note None
  47. */
  48. tls_bt_status_t tls_bt_hf_client_deinit(void);
  49. /**
  50. * @brief connect to audio gateway
  51. *
  52. * @param[in] *bd_addr remote device bluetooth device address
  53. *
  54. * @retval @ref tls_bt_status_t
  55. *
  56. * @note None
  57. */
  58. tls_bt_status_t tls_bt_hf_client_connect(tls_bt_addr_t *bd_addr);
  59. /**
  60. * @brief disconnect from audio gateway
  61. *
  62. * @param[in] *bd_addr remote device bluetooth device address
  63. *
  64. * @retval @ref tls_bt_status_t
  65. *
  66. * @note None
  67. */
  68. tls_bt_status_t tls_bt_hf_client_disconnect(tls_bt_addr_t *bd_addr);
  69. /**
  70. * @brief create an audio connection
  71. *
  72. * @param[in] *bd_addr remote device bluetooth device address
  73. *
  74. * @retval @ref tls_bt_status_t
  75. *
  76. * @note None
  77. */
  78. tls_bt_status_t tls_bt_hf_client_connect_audio(tls_bt_addr_t *bd_addr);
  79. /**
  80. * @brief close the audio connection
  81. *
  82. * @param[in] *bd_addr remote device bluetooth device address
  83. *
  84. * @retval @ref tls_bt_status_t
  85. *
  86. * @note None
  87. */
  88. tls_bt_status_t tls_bt_hf_client_disconnect_audio(tls_bt_addr_t *bd_addr);
  89. /**
  90. * @brief start voice recognition
  91. *
  92. * @param[in] None
  93. *
  94. * @retval @ref tls_bt_status_t
  95. *
  96. * @note None
  97. */
  98. tls_bt_status_t tls_bt_hf_client_start_voice_recognition(void);
  99. /**
  100. * @brief stop voice recognition
  101. *
  102. * @param[in] None
  103. *
  104. * @retval @ref tls_bt_status_t
  105. *
  106. * @note None
  107. */
  108. tls_bt_status_t tls_bt_hf_client_stop_voice_recognition(void);
  109. /**
  110. * @brief volume control
  111. *
  112. * @param[in] type Mic or speaker
  113. * @param[in] volume index value
  114. *
  115. * @retval @ref tls_bt_status_t
  116. *
  117. * @note None
  118. */
  119. tls_bt_status_t tls_bt_hf_client_volume_control(tls_bthf_client_volume_type_t type, int volume);
  120. /**
  121. * @brief place a call
  122. *
  123. * @param[in] number phone number to be called
  124. *
  125. * @retval @ref tls_bt_status_t
  126. *
  127. * @note None
  128. */
  129. tls_bt_status_t tls_bt_hf_client_dial(const char *number);
  130. /**
  131. * @brief place a call with number specified by location (speed dial)
  132. *
  133. * @param[in] location
  134. *
  135. * @retval @ref tls_bt_status_t
  136. *
  137. * @note None
  138. */
  139. tls_bt_status_t tls_bt_hf_client_dial_memory(int location);
  140. /**
  141. * @brief handle specified call related action
  142. *
  143. * @param[in] action call action
  144. * @param[in] idx index indicator
  145. *
  146. * @retval @ref tls_bt_status_t
  147. *
  148. * @note None
  149. */
  150. tls_bt_status_t tls_bt_hf_client_handle_call_action(tls_bthf_client_call_action_t action, int idx);
  151. /**
  152. * @brief query list of current calls
  153. *
  154. * @param[in] None
  155. *
  156. * @retval @ref tls_bt_status_t
  157. *
  158. * @note None
  159. */
  160. tls_bt_status_t tls_bt_hf_client_query_current_calls(void);
  161. /**
  162. * @brief query current selected operator name
  163. *
  164. * @param[in] None
  165. *
  166. * @retval @ref tls_bt_status_t
  167. *
  168. * @note None
  169. */
  170. tls_bt_status_t tls_bt_hf_client_query_current_operator_name(void);
  171. /**
  172. * @brief retrieve subscriber number information
  173. *
  174. * @param[in] None
  175. *
  176. * @retval @ref tls_bt_status_t
  177. *
  178. * @note None
  179. */
  180. tls_bt_status_t tls_bt_hf_client_retrieve_subscriber_info(void);
  181. /**
  182. * @brief send dtmf
  183. *
  184. * @param[in] code number code
  185. *
  186. * @retval @ref tls_bt_status_t
  187. *
  188. * @note None
  189. */
  190. tls_bt_status_t tls_bt_hf_client_send_dtmf(char code);
  191. /**
  192. * @brief Request number from AG for VR purposes
  193. *
  194. * @param[in] None
  195. *
  196. * @retval @ref tls_bt_status_t
  197. *
  198. * @note None
  199. */
  200. tls_bt_status_t tls_bt_hf_client_request_last_voice_tag_number(void);
  201. /**
  202. * @brief Send requested AT command to remote device
  203. *
  204. * @param[in] cmd
  205. * @param[in] val1
  206. * @param[in] val2
  207. * @param[in] arg
  208. *
  209. * @retval @ref tls_bt_status_t
  210. *
  211. * @note None
  212. */
  213. tls_bt_status_t tls_bt_hf_client_send_at_cmd(int cmd, int val1, int val2, const char *arg);
  214. /**
  215. * @brief Send audio to audio gateway
  216. *
  217. * @param[in] bd_addr bluetooth address of audio gateway
  218. * @param[in] p_data audio data
  219. * @param[in] length audio length
  220. *
  221. * @retval @ref tls_bt_status_t
  222. *
  223. * @note None
  224. */
  225. tls_bt_status_t tls_bt_hf_client_send_audio(tls_bt_addr_t *bd_addr, uint8_t *p_data, uint16_t length);
  226. #endif