From effc1974e3947b4829a195ac5fbd1b61e3c29e08 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 25 Jan 2023 19:28:50 +0200 Subject: [PATCH] bluez5: backend-native: HFP should reply OK to no commands HFP 1.8 -> 3GPP 27.007 -> ITU-T Rec. V.250 Sec. 5.6, which indicates to reply OK to no commands on command line, not ERROR. --- spa/plugins/bluez5/backend-native.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index ab543a621..77dd637ba 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -880,6 +880,9 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf) rfcomm_emit_volume_changed(rfcomm, -1, SPA_BT_VOLUME_INVALID); } } + } else if (strspn(buf, " ") == strlen(buf)) { + /* No commands, reply OK (ITU-T Rec. V.250 Sec. 5.2.1 & 5.6) */ + rfcomm_send_reply(rfcomm, "OK"); } else if (!rfcomm->slc_configured) { spa_log_warn(backend->log, "RFCOMM receive command before SLC completed: %s", buf); rfcomm_send_error(rfcomm, CMEE_AG_FAILURE);