pmaports/temp/pulseaudio/0010-bluetooth-support-AT-BCC.patch
Dylan Van Assche f9c7ffa9b6
temp/pulseaudio: fork for Bluetooth HFP/HSP support (MR 3080)
PulseAudio is used for handling all audio on postmarketOS.
This also involves Bluetooth audio such as A2DP, HSP and HFP audio.
In the case of HFP/HSP, the HF and AG can interact with each other
through AT commands defined in the Bluetooth HFP 1.8 spec.

This set of patches implements HFP support to allow Bluetooth devices
to accept/reject/hangup calls, dial numbers, DTMF tone generation,
query signal strength, roaming status, service status, AG battery level,
call status, etc.

More details in the upstream MR:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/693

Available in edge for testing this merge request with a broader user
base. Not intended for backporting to stable branches.

[ci:skip-build]: already built successfully in CI
2022-06-16 09:33:35 +02:00

33 lines
1.2 KiB
Diff

From 79d8cf24785fc52a3d0cee48590143fb409201b8 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Thu, 14 Apr 2022 19:15:34 +0200
Subject: [PATCH 10/26] bluetooth: support AT+BCC
HFs send AT+BCC to (re)start codec negotiations.
Support this command by (re)setting the codec negotiations state and
reply OK.
---
src/modules/bluetooth/backend-native.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
index 394c2a4da..89a174f9a 100644
--- a/src/modules/bluetooth/backend-native.c
+++ b/src/modules/bluetooth/backend-native.c
@@ -666,7 +666,12 @@ static bool hfp_rfcomm_handle(int fd, pa_bluetooth_transport *t, const char *buf
c->selected_codec = 1;
/* stateful negotiation */
- if (c->state == 0 && sscanf(buf, "AT+BRSF=%d", &val) == 1) {
+ if (strstr(buf, "AT+BCC")) {
+ pa_log_debug("HF asked to start codec negotiations");
+ c->state = 0;
+ return true;
+ }
+ else if (c->state == 0 && sscanf(buf, "AT+BRSF=%d", &val) == 1) {
c->capabilities = val;
pa_log_info("HFP capabilities returns 0x%x", val);
rfcomm_write_response(fd, "+BRSF: %d", hfp_features);
--
2.35.1