spa: bluez: backend-native: accept "=" for +VGS and +VGM

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
This commit is contained in:
Barnabás Pőcze 2022-09-24 02:09:09 +02:00
parent 0ee4fea03d
commit 0a48165cff

View file

@ -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 {