bt/native: Answer AT command with ERROR if unhandled

The peer will wait some time and eventually time out the connection if
no reply is sent back. When sending `ERROR` the peer can decide to break
the RFCOMM connection immediately or continue when a command is not
critical.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/482>
This commit is contained in:
Marijn Suijten 2021-01-17 01:19:40 +01:00
parent 4cbac23894
commit e6157c8b1f

View file

@ -764,6 +764,7 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
} else if (t->config) { /* t->config is only non-null for hfp profile */
do_reply = hfp_rfcomm_handle(fd, t, buf);
} else {
rfcomm_write_response(fd, "ERROR");
do_reply = false;
}