From 0a48165cffa3ac2538c764a617562fe61928dbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 24 Sep 2022 02:09:09 +0200 Subject: [PATCH] spa: bluez: backend-native: accept "=" for +VGS and +VGM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HFP 1.8 states in 4.35.1: Due to the small inconsistency between the GSM standard [2]) and the current Headset specification ([3]), the HF shall also accept the “=” symbol, in place of “:”, as a valid separator for this unsolicited result code. iOS seems to use "=", so accept that as well. See #2463 --- spa/plugins/bluez5/backend-native.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 7b57ba2f1..a65fecbba 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -970,13 +970,13 @@ static bool rfcomm_hfp_hf(struct rfcomm *rfcomm, char* buf) } } } - } else if (sscanf(token, "+VGM:%u", &gain) == 1) { + } else if (sscanf(token, "+VGM%*1[:=]%u", &gain) == 1) { if (gain <= SPA_BT_VOLUME_HS_MAX) { rfcomm_emit_volume_changed(rfcomm, SPA_BT_VOLUME_ID_TX, gain); } else { spa_log_debug(backend->log, "RFCOMM receive unsupported VGM gain: %s", token); } - } else if (sscanf(token, "+VGS:%u", &gain) == 1) { + } else if (sscanf(token, "+VGS%*1[:=]%u", &gain) == 1) { if (gain <= SPA_BT_VOLUME_HS_MAX) { rfcomm_emit_volume_changed(rfcomm, SPA_BT_VOLUME_ID_RX, gain); } else {