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.
This commit is contained in:
Frédéric Danis 2022-09-15 16:19:26 +02:00
parent 9755cb9083
commit 75ae86bf13

View file

@ -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);