summaryrefslogtreecommitdiff
path: root/cras/src/server/cras_bt_device.h
diff options
context:
space:
mode:
authorHsin-Yu Chao <hychao@google.com>2019-05-15 15:55:22 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-06-03 06:22:55 -0700
commit0f2e551efcb072f5578750e8819355fbffd9d698 (patch)
treefbb7c9a4a028f05e95ac329ec4fe0a72bfc46829 /cras/src/server/cras_bt_device.h
parent149c4ed4c1cc7e4b345f128a01302a5061d7ae8c (diff)
downloadadhd-0f2e551efcb072f5578750e8819355fbffd9d698.tar.gz
CRAS: hfp - mSBC codec read write
This change implements basic audio input and output of wideband speech mode of HFP, using mSBC codec. BUG=chromium:843048 TEST=Apply full patch set, manual test with Bose QC35 II Change-Id: I7577daa62248c8e2219a33baf019953d6bb0f613 Reviewed-on: https://chromium-review.googlesource.com/1362734 Commit-Ready: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Diffstat (limited to 'cras/src/server/cras_bt_device.h')
-rw-r--r--cras/src/server/cras_bt_device.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/cras/src/server/cras_bt_device.h b/cras/src/server/cras_bt_device.h
index 3325450c..de3a7836 100644
--- a/cras/src/server/cras_bt_device.h
+++ b/cras/src/server/cras_bt_device.h
@@ -85,11 +85,22 @@ int cras_bt_device_disconnect(DBusConnection *conn,
/* Gets the SCO socket for the device.
* Args:
* device - The device object to get SCO socket for.
+ * codec - 1 for CVSD, 2 for mSBC
*/
-int cras_bt_device_sco_connect(struct cras_bt_device *device);
+int cras_bt_device_sco_connect(struct cras_bt_device *device, int codec);
-/* Queries the preffered mtu value for SCO socket. */
-int cras_bt_device_sco_mtu(struct cras_bt_device *device, int sco_socket);
+/* Gets the SCO packet size in bytes, used by HFP iodev for audio I/O.
+ * The logic is built base on experience: for USB bus, respect BT Core spec
+ * that has clear recommendation of packet size of codecs (CVSD, mSBC).
+ * As for other buses, use the MTU value of SCO socket filled by driver.
+ * Args:
+ * device - The bt device to query mtu.
+ * sco_socket - The SCO socket.
+ * codec - 1 for CVSD, 2 for mSBC per HFP 1.7 specification.
+ */
+int cras_bt_device_sco_packet_size(struct cras_bt_device *device,
+ int sco_socket,
+ int codec);
/* Appends an iodev to bt device.
* Args:
@@ -172,11 +183,12 @@ int cras_bt_device_audio_gateway_initialized(struct cras_bt_device *device);
* Establishes SCO connection if it has not been established on the BT device.
* Note: this function should be only used for hfp_alsa_io.
* Args:
- * device - The bluetooth device.
+ * device - The bluetooth device.
+ * codec - 1 for CVSD, 2 for mSBC
* Returns:
* 0 on success, error code otherwise.
*/
-int cras_bt_device_get_sco(struct cras_bt_device *device);
+int cras_bt_device_get_sco(struct cras_bt_device *device, int codec);
/*
* Closes SCO connection if the caller is the last user for the connection on