hal-handsfree-client.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. // SPDX-License-Identifier: Apache-2.0
  2. /*
  3. * Copyright (C) 2014 Intel Corporation
  4. *
  5. */
  6. #include <stdbool.h>
  7. #include <stddef.h>
  8. #include <string.h>
  9. #include <stdlib.h>
  10. #include <cutils/properties.h>
  11. #include "hal-log.h"
  12. #include "hal.h"
  13. #include "hal-msg.h"
  14. #include "ipc-common.h"
  15. #include "hal-ipc.h"
  16. static const bthf_client_callbacks_t *cbs = NULL;
  17. static bool interface_ready(void)
  18. {
  19. return cbs != NULL;
  20. }
  21. static void handle_conn_state(void *buf, uint16_t len, int fd)
  22. {
  23. struct hal_ev_hf_client_conn_state *ev = buf;
  24. if (cbs->connection_state_cb)
  25. cbs->connection_state_cb(ev->state, ev->peer_feat,
  26. ev->chld_feat,
  27. (bt_bdaddr_t *) ev->bdaddr);
  28. }
  29. static void handle_audio_state(void *buf, uint16_t len, int fd)
  30. {
  31. struct hal_ev_hf_client_audio_state *ev = buf;
  32. if (cbs->audio_state_cb)
  33. cbs->audio_state_cb(ev->state, (bt_bdaddr_t *) (ev->bdaddr));
  34. }
  35. static void handle_vr_state(void *buf, uint16_t len, int fd)
  36. {
  37. struct hal_ev_hf_client_vr_state *ev = buf;
  38. if (cbs->vr_cmd_cb)
  39. cbs->vr_cmd_cb(ev->state);
  40. }
  41. static void handle_network_state(void *buf, uint16_t len, int fd)
  42. {
  43. struct hal_ev_hf_client_net_state *ev = buf;
  44. if (cbs->network_state_cb)
  45. cbs->network_state_cb(ev->state);
  46. }
  47. static void handle_network_roaming(void *buf, uint16_t len, int fd)
  48. {
  49. struct hal_ev_hf_client_net_roaming_type *ev = buf;
  50. if (cbs->network_roaming_cb)
  51. cbs->network_roaming_cb(ev->state);
  52. }
  53. static void handle_network_signal(void *buf, uint16_t len, int fd)
  54. {
  55. struct hal_ev_hf_client_net_signal_strength *ev = buf;
  56. if (cbs->network_signal_cb)
  57. cbs->network_signal_cb(ev->signal_strength);
  58. }
  59. static void handle_battery_level(void *buf, uint16_t len, int fd)
  60. {
  61. struct hal_ev_hf_client_battery_level *ev = buf;
  62. if (cbs->battery_level_cb)
  63. cbs->battery_level_cb(ev->battery_level);
  64. }
  65. static void handle_operator_name(void *buf, uint16_t len, int fd)
  66. {
  67. struct hal_ev_hf_client_operator_name *ev = buf;
  68. uint16_t name_len = ev->name_len;
  69. char *name = NULL;
  70. if (len != sizeof(*ev) + name_len ||
  71. (name_len != 0 && ev->name[name_len - 1] != '\0')) {
  72. error("invalid operator name, aborting");
  73. exit(EXIT_FAILURE);
  74. }
  75. if (name_len)
  76. name = (char *) ev->name;
  77. if (cbs->current_operator_cb)
  78. cbs->current_operator_cb(name);
  79. }
  80. static void handle_call(void *buf, uint16_t len, int fd)
  81. {
  82. struct hal_ev_hf_client_call_indicator *ev = buf;
  83. if (cbs->call_cb)
  84. cbs->call_cb(ev->call);
  85. }
  86. static void handle_call_setup(void *buf, uint16_t len, int fd)
  87. {
  88. struct hal_ev_hf_client_call_setup_indicator *ev = buf;
  89. if (cbs->callsetup_cb)
  90. cbs->callsetup_cb(ev->call_setup);
  91. }
  92. static void handle_call_held(void *buf, uint16_t len, int fd)
  93. {
  94. struct hal_ev_hf_client_call_held_indicator *ev = buf;
  95. if (cbs->callheld_cb)
  96. cbs->callheld_cb(ev->call_held);
  97. }
  98. static void handle_response_and_hold(void *buf, uint16_t len, int fd)
  99. {
  100. struct hal_ev_hf_client_response_and_hold_status *ev = buf;
  101. if (cbs->resp_and_hold_cb)
  102. cbs->resp_and_hold_cb(ev->status);
  103. }
  104. static void handle_clip(void *buf, uint16_t len, int fd)
  105. {
  106. struct hal_ev_hf_client_calling_line_ident *ev = buf;
  107. uint16_t num_len = ev->number_len;
  108. char *number = NULL;
  109. if (len != sizeof(*ev) + num_len ||
  110. (num_len != 0 && ev->number[num_len - 1] != '\0')) {
  111. error("invalid clip, aborting");
  112. exit(EXIT_FAILURE);
  113. }
  114. if (num_len)
  115. number = (char *) ev->number;
  116. if (cbs->clip_cb)
  117. cbs->clip_cb(number);
  118. }
  119. static void handle_call_waiting(void *buf, uint16_t len, int fd)
  120. {
  121. struct hal_ev_hf_client_call_waiting *ev = buf;
  122. uint16_t num_len = ev->number_len;
  123. char *number = NULL;
  124. if (len != sizeof(*ev) + num_len ||
  125. (num_len != 0 && ev->number[num_len - 1] != '\0')) {
  126. error("invalid call waiting, aborting");
  127. exit(EXIT_FAILURE);
  128. }
  129. if (num_len)
  130. number = (char *) ev->number;
  131. if (cbs->call_waiting_cb)
  132. cbs->call_waiting_cb(number);
  133. }
  134. static void handle_current_calls(void *buf, uint16_t len, int fd)
  135. {
  136. struct hal_ev_hf_client_current_call *ev = buf;
  137. uint16_t num_len = ev->number_len;
  138. char *number = NULL;
  139. if (len != sizeof(*ev) + num_len ||
  140. (num_len != 0 && ev->number[num_len - 1] != '\0')) {
  141. error("invalid current calls, aborting");
  142. exit(EXIT_FAILURE);
  143. }
  144. if (num_len)
  145. number = (char *) ev->number;
  146. if (cbs->current_calls_cb)
  147. cbs->current_calls_cb(ev->index, ev->direction, ev->call_state,
  148. ev->multiparty, number);
  149. }
  150. static void handle_volume_change(void *buf, uint16_t len, int fd)
  151. {
  152. struct hal_ev_hf_client_volume_changed *ev = buf;
  153. if (cbs->volume_change_cb)
  154. cbs->volume_change_cb(ev->type, ev->volume);
  155. }
  156. static void handle_command_cmp(void *buf, uint16_t len, int fd)
  157. {
  158. struct hal_ev_hf_client_command_complete *ev = buf;
  159. if (cbs->cmd_complete_cb)
  160. cbs->cmd_complete_cb(ev->type, ev->cme);
  161. }
  162. static void handle_subscriber_info(void *buf, uint16_t len, int fd)
  163. {
  164. const struct hal_ev_hf_client_subscriber_service_info *ev = buf;
  165. uint16_t name_len = ev->name_len;
  166. char *name = NULL;
  167. if (len != sizeof(*ev) + name_len ||
  168. (name_len != 0 && ev->name[name_len - 1] != '\0')) {
  169. error("invalid sunscriber info, aborting");
  170. exit(EXIT_FAILURE);
  171. }
  172. if (name_len)
  173. name = (char *) ev->name;
  174. if (cbs->subscriber_info_cb)
  175. cbs->subscriber_info_cb(name, ev->type);
  176. }
  177. static void handle_in_band_ringtone(void *buf, uint16_t len, int fd)
  178. {
  179. struct hal_ev_hf_client_inband_settings *ev = buf;
  180. if (cbs->in_band_ring_tone_cb)
  181. cbs->in_band_ring_tone_cb(ev->state);
  182. }
  183. static void handle_last_voice_tag_number(void *buf, uint16_t len, int fd)
  184. {
  185. const struct hal_ev_hf_client_last_void_call_tag_num *ev = buf;
  186. char *number = NULL;
  187. uint16_t num_len = ev->number_len;
  188. if (len != sizeof(*ev) + num_len ||
  189. (num_len != 0 && ev->number[num_len - 1] != '\0')) {
  190. error("invalid voice tag, aborting");
  191. exit(EXIT_FAILURE);
  192. }
  193. if (num_len)
  194. number = (char *) ev->number;
  195. if (cbs->last_voice_tag_number_callback)
  196. cbs->last_voice_tag_number_callback(number);
  197. }
  198. static void handle_ring_indication(void *buf, uint16_t len, int fd)
  199. {
  200. if (cbs->ring_indication_cb)
  201. cbs->ring_indication_cb();
  202. }
  203. /*
  204. * handlers will be called from notification thread context,
  205. * index in table equals to 'opcode - HAL_MINIMUM_EVENT'
  206. */
  207. static const struct hal_ipc_handler ev_handlers[] = {
  208. /* HAL_EV_HF_CLIENT_CONN_STATE */
  209. { handle_conn_state, false,
  210. sizeof(struct hal_ev_hf_client_conn_state) },
  211. /* HAL_EV_HF_CLIENT_AUDIO_STATE */
  212. { handle_audio_state, false,
  213. sizeof(struct hal_ev_hf_client_audio_state) },
  214. /* HAL_EV_HF_CLIENT_VR_STATE */
  215. { handle_vr_state, false, sizeof(struct hal_ev_hf_client_vr_state) },
  216. /*HAL_EV_HF_CLIENT_NET_STATE */
  217. { handle_network_state, false,
  218. sizeof(struct hal_ev_hf_client_net_state)},
  219. /*HAL_EV_HF_CLIENT_NET_ROAMING_TYPE */
  220. { handle_network_roaming, false,
  221. sizeof(struct hal_ev_hf_client_net_roaming_type) },
  222. /* HAL_EV_HF_CLIENT_NET_SIGNAL_STRENGTH */
  223. { handle_network_signal, false,
  224. sizeof(struct hal_ev_hf_client_net_signal_strength) },
  225. /* HAL_EV_HF_CLIENT_BATTERY_LEVEL */
  226. { handle_battery_level, false,
  227. sizeof(struct hal_ev_hf_client_battery_level) },
  228. /* HAL_EV_HF_CLIENT_OPERATOR_NAME */
  229. { handle_operator_name, true,
  230. sizeof(struct hal_ev_hf_client_operator_name) },
  231. /* HAL_EV_HF_CLIENT_CALL_INDICATOR */
  232. { handle_call, false,
  233. sizeof(struct hal_ev_hf_client_call_indicator) },
  234. /* HAL_EV_HF_CLIENT_CALL_SETUP_INDICATOR */
  235. { handle_call_setup, false,
  236. sizeof(struct hal_ev_hf_client_call_setup_indicator) },
  237. /* HAL_EV_HF_CLIENT_CALL_HELD_INDICATOR */
  238. { handle_call_held, false,
  239. sizeof(struct hal_ev_hf_client_call_held_indicator) },
  240. /* HAL_EV_HF_CLIENT_RESPONSE_AND_HOLD_STATUS */
  241. { handle_response_and_hold, false,
  242. sizeof(struct hal_ev_hf_client_response_and_hold_status) },
  243. /* HAL_EV_HF_CLIENT_CALLING_LINE_IDENT */
  244. { handle_clip, true,
  245. sizeof(struct hal_ev_hf_client_calling_line_ident) },
  246. /* HAL_EV_HF_CLIENT_CALL_WAITING */
  247. { handle_call_waiting, true,
  248. sizeof(struct hal_ev_hf_client_call_waiting) },
  249. /* HAL_EV_HF_CLIENT_CURRENT_CALL */
  250. { handle_current_calls, true,
  251. sizeof(struct hal_ev_hf_client_current_call) },
  252. /* HAL_EV_CLIENT_VOLUME_CHANGED */
  253. { handle_volume_change, false,
  254. sizeof(struct hal_ev_hf_client_volume_changed) },
  255. /* HAL_EV_CLIENT_COMMAND_COMPLETE */
  256. { handle_command_cmp, false,
  257. sizeof(struct hal_ev_hf_client_command_complete) },
  258. /* HAL_EV_CLIENT_SUBSCRIBER_SERVICE_INFO */
  259. { handle_subscriber_info, true,
  260. sizeof(struct hal_ev_hf_client_subscriber_service_info) },
  261. /* HAL_EV_CLIENT_INBAND_SETTINGS */
  262. { handle_in_band_ringtone, false,
  263. sizeof(struct hal_ev_hf_client_inband_settings) },
  264. /* HAL_EV_CLIENT_LAST_VOICE_CALL_TAG_NUM */
  265. { handle_last_voice_tag_number, true,
  266. sizeof(struct hal_ev_hf_client_last_void_call_tag_num) },
  267. /* HAL_EV_CLIENT_RING_INDICATION */
  268. { handle_ring_indication, false, 0 },
  269. };
  270. static bt_status_t init(bthf_client_callbacks_t *callbacks)
  271. {
  272. struct hal_cmd_register_module cmd;
  273. int ret;
  274. DBG("");
  275. if (interface_ready())
  276. return BT_STATUS_DONE;
  277. cbs = callbacks;
  278. hal_ipc_register(HAL_SERVICE_ID_HANDSFREE_CLIENT, ev_handlers,
  279. sizeof(ev_handlers)/sizeof(ev_handlers[0]));
  280. cmd.service_id = HAL_SERVICE_ID_HANDSFREE_CLIENT;
  281. cmd.mode = HAL_MODE_DEFAULT;
  282. cmd.max_clients = 1;
  283. ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE,
  284. sizeof(cmd), &cmd, NULL, NULL, NULL);
  285. if (ret != BT_STATUS_SUCCESS) {
  286. cbs = NULL;
  287. hal_ipc_unregister(HAL_SERVICE_ID_HANDSFREE_CLIENT);
  288. }
  289. return ret;
  290. }
  291. static bt_status_t hf_client_connect(bt_bdaddr_t *bd_addr)
  292. {
  293. struct hal_cmd_hf_client_connect cmd;
  294. DBG("");
  295. if (!interface_ready())
  296. return BT_STATUS_NOT_READY;
  297. if (!bd_addr)
  298. return BT_STATUS_PARM_INVALID;
  299. memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
  300. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  301. HAL_OP_HF_CLIENT_CONNECT, sizeof(cmd), &cmd,
  302. NULL, NULL, NULL);
  303. }
  304. static bt_status_t disconnect(bt_bdaddr_t *bd_addr)
  305. {
  306. struct hal_cmd_hf_client_disconnect cmd;
  307. DBG("");
  308. if (!interface_ready())
  309. return BT_STATUS_NOT_READY;
  310. if (!bd_addr)
  311. return BT_STATUS_PARM_INVALID;
  312. memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
  313. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  314. HAL_OP_HF_CLIENT_DISCONNECT, sizeof(cmd), &cmd,
  315. NULL, NULL, NULL);
  316. }
  317. static bt_status_t connect_audio(bt_bdaddr_t *bd_addr)
  318. {
  319. struct hal_cmd_hf_client_connect_audio cmd;
  320. DBG("");
  321. if (!interface_ready())
  322. return BT_STATUS_NOT_READY;
  323. if (!bd_addr)
  324. return BT_STATUS_PARM_INVALID;
  325. memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
  326. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  327. HAL_OP_HF_CLIENT_CONNECT_AUDIO, sizeof(cmd),
  328. &cmd, NULL, NULL, NULL);
  329. }
  330. static bt_status_t disconnect_audio(bt_bdaddr_t *bd_addr)
  331. {
  332. struct hal_cmd_hf_client_disconnect_audio cmd;
  333. DBG("");
  334. if (!interface_ready())
  335. return BT_STATUS_NOT_READY;
  336. if (!bd_addr)
  337. return BT_STATUS_PARM_INVALID;
  338. memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
  339. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  340. HAL_OP_HF_CLIENT_DISCONNECT_AUDIO, sizeof(cmd),
  341. &cmd, NULL, NULL, NULL);
  342. }
  343. static bt_status_t start_voice_recognition(void)
  344. {
  345. DBG("");
  346. if (!interface_ready())
  347. return BT_STATUS_NOT_READY;
  348. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  349. HAL_OP_HF_CLIENT_START_VR, 0, NULL, NULL, NULL,
  350. NULL);
  351. }
  352. static bt_status_t stop_voice_recognition(void)
  353. {
  354. DBG("");
  355. if (!interface_ready())
  356. return BT_STATUS_NOT_READY;
  357. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  358. HAL_OP_HF_CLIENT_STOP_VR, 0, NULL, NULL, NULL,
  359. NULL);
  360. }
  361. static bt_status_t volume_control(bthf_client_volume_type_t type,
  362. int volume)
  363. {
  364. struct hal_cmd_hf_client_volume_control cmd;
  365. DBG("");
  366. if (!interface_ready())
  367. return BT_STATUS_NOT_READY;
  368. cmd.type = type;
  369. cmd.volume = volume;
  370. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  371. HAL_OP_HF_CLIENT_VOLUME_CONTROL, sizeof(cmd),
  372. &cmd, NULL, NULL, NULL);
  373. }
  374. static bt_status_t dial(const char *number)
  375. {
  376. char buf[IPC_MTU];
  377. struct hal_cmd_hf_client_dial *cmd = (void *) buf;
  378. size_t len;
  379. DBG("");
  380. if (!interface_ready())
  381. return BT_STATUS_NOT_READY;
  382. if (number) {
  383. cmd->number_len = strlen(number) + 1;
  384. memcpy(cmd->number, number, cmd->number_len);
  385. } else {
  386. cmd->number_len = 0;
  387. }
  388. len = sizeof(*cmd) + cmd->number_len;
  389. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  390. HAL_OP_HF_CLIENT_DIAL, len, cmd, NULL, NULL,
  391. NULL);
  392. }
  393. static bt_status_t dial_memory(int location)
  394. {
  395. struct hal_cmd_hf_client_dial_memory cmd;
  396. DBG("");
  397. if (!interface_ready())
  398. return BT_STATUS_NOT_READY;
  399. cmd.location = location;
  400. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  401. HAL_OP_HF_CLIENT_DIAL_MEMORY,
  402. sizeof(cmd), &cmd, NULL, NULL, NULL);
  403. }
  404. static bt_status_t call_action(bthf_client_call_action_t action, int index)
  405. {
  406. struct hal_cmd_hf_client_call_action cmd;
  407. DBG("");
  408. if (!interface_ready())
  409. return BT_STATUS_NOT_READY;
  410. cmd.action = action;
  411. cmd.index = index;
  412. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  413. HAL_OP_HF_CLIENT_CALL_ACTION, sizeof(cmd), &cmd,
  414. NULL, NULL, NULL);
  415. }
  416. static bt_status_t query_current_calls(void)
  417. {
  418. DBG("");
  419. if (!interface_ready())
  420. return BT_STATUS_NOT_READY;
  421. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  422. HAL_OP_HF_CLIENT_QUERY_CURRENT_CALLS, 0, NULL,
  423. NULL, NULL, NULL);
  424. }
  425. static bt_status_t query_operator_name(void)
  426. {
  427. DBG("");
  428. if (!interface_ready())
  429. return BT_STATUS_NOT_READY;
  430. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  431. HAL_OP_HF_CLIENT_QUERY_OPERATOR_NAME, 0, NULL,
  432. NULL, NULL, NULL);
  433. }
  434. static bt_status_t retrieve_subsr_info(void)
  435. {
  436. DBG("");
  437. if (!interface_ready())
  438. return BT_STATUS_NOT_READY;
  439. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  440. HAL_OP_HF_CLIENT_RETRIEVE_SUBSCR_INFO, 0, NULL,
  441. NULL, NULL, NULL);
  442. }
  443. static bt_status_t send_dtmf(char tone)
  444. {
  445. struct hal_cmd_hf_client_send_dtmf cmd;
  446. DBG("");
  447. if (!interface_ready())
  448. return BT_STATUS_NOT_READY;
  449. cmd.tone = tone;
  450. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  451. HAL_OP_HF_CLIENT_SEND_DTMF, sizeof(cmd), &cmd,
  452. NULL, NULL, NULL);
  453. }
  454. static bt_status_t request_last_voice_tag_number(void)
  455. {
  456. DBG("");
  457. if (!interface_ready())
  458. return BT_STATUS_NOT_READY;
  459. return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE_CLIENT,
  460. HAL_OP_HF_CLIENT_GET_LAST_VOICE_TAG_NUM,
  461. 0, NULL, NULL, NULL, NULL);
  462. }
  463. static void cleanup(void)
  464. {
  465. struct hal_cmd_unregister_module cmd;
  466. DBG("");
  467. if (!interface_ready())
  468. return;
  469. cmd.service_id = HAL_SERVICE_ID_HANDSFREE_CLIENT;
  470. hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
  471. sizeof(cmd), &cmd, NULL, NULL, NULL);
  472. hal_ipc_unregister(HAL_SERVICE_ID_HANDSFREE_CLIENT);
  473. cbs = NULL;
  474. }
  475. static bthf_client_interface_t iface = {
  476. .size = sizeof(iface),
  477. .init = init,
  478. .connect = hf_client_connect,
  479. .disconnect = disconnect,
  480. .connect_audio = connect_audio,
  481. .disconnect_audio = disconnect_audio,
  482. .start_voice_recognition = start_voice_recognition,
  483. .stop_voice_recognition = stop_voice_recognition,
  484. .volume_control = volume_control,
  485. .dial = dial,
  486. .dial_memory = dial_memory,
  487. .handle_call_action = call_action,
  488. .query_current_calls = query_current_calls,
  489. .query_current_operator_name = query_operator_name,
  490. .retrieve_subscriber_info = retrieve_subsr_info,
  491. .send_dtmf = send_dtmf,
  492. .request_last_voice_tag_number = request_last_voice_tag_number,
  493. .cleanup = cleanup
  494. };
  495. bthf_client_interface_t *bt_get_hf_client_interface(void)
  496. {
  497. return &iface;
  498. }