From 75ae86bf134f8c9cf610800c25c08100a646fbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Thu, 15 Sep 2022 16:19:26 +0200 Subject: [PATCH] bluez5: backend-native: Only send one error message When rfcomm_hfp_ag() returns false, an "ERROR" reply is sent. When testing if the SLC is configured, 2 "ERROR" replies are sent, which should not be done. --- spa/plugins/bluez5/backend-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index c38656bbb..b7034ec1e 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -809,7 +809,7 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf) } else if (!rfcomm->slc_configured) { spa_log_warn(backend->log, "RFCOMM receive command before SLC completed: %s", buf); rfcomm_send_reply(rfcomm, "ERROR"); - return false; + return true; } else if (sscanf(buf, "AT+BCS=%u", &selected_codec) == 1) { /* parse BCS(=Bluetooth Codec Selection) reply */ bool was_switching_codec = rfcomm->hfp_ag_switching_codec && (rfcomm->device != NULL);