sco.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2014 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. enum sco_status {
  11. SCO_STATUS_OK,
  12. SCO_STATUS_ERROR,
  13. };
  14. struct bt_sco;
  15. struct bt_sco *bt_sco_new(const bdaddr_t *local_bdaddr);
  16. struct bt_sco *bt_sco_ref(struct bt_sco *sco);
  17. void bt_sco_unref(struct bt_sco *sco);
  18. bool bt_sco_connect(struct bt_sco *sco, const bdaddr_t *remote_addr,
  19. uint16_t voice_settings);
  20. void bt_sco_disconnect(struct bt_sco *sco);
  21. bool bt_sco_get_fd_and_mtu(struct bt_sco *sco, int *fd, uint16_t *mtu);
  22. typedef bool (*bt_sco_confirm_func_t) (const bdaddr_t *remote_addr,
  23. uint16_t *voice_settings);
  24. typedef void (*bt_sco_conn_func_t) (enum sco_status status,
  25. const bdaddr_t *addr);
  26. typedef void (*bt_sco_disconn_func_t) (const bdaddr_t *addr);
  27. void bt_sco_set_confirm_cb(struct bt_sco *sco,
  28. bt_sco_confirm_func_t func);
  29. void bt_sco_set_connect_cb(struct bt_sco *sco, bt_sco_conn_func_t func);
  30. void bt_sco_set_disconnect_cb(struct bt_sco *sco,
  31. bt_sco_disconn_func_t func);