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.
This commit is contained in:
Pauli Virtanen 2023-01-25 19:28:50 +02:00
parent 6e99ccb73e
commit effc1974e3

View file

@ -880,6 +880,9 @@ static bool rfcomm_hfp_ag(struct rfcomm *rfcomm, char* buf)
rfcomm_emit_volume_changed(rfcomm, -1, SPA_BT_VOLUME_INVALID); 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) { } else if (!rfcomm->slc_configured) {
spa_log_warn(backend->log, "RFCOMM receive command before SLC completed: %s", buf); spa_log_warn(backend->log, "RFCOMM receive command before SLC completed: %s", buf);
rfcomm_send_error(rfcomm, CMEE_AG_FAILURE); rfcomm_send_error(rfcomm, CMEE_AG_FAILURE);