From e6157c8b1fbf6d44efcf2052e8771d1774140d2f Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 17 Jan 2021 01:19:40 +0100 Subject: [PATCH] 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: --- src/modules/bluetooth/backend-native.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c index a01478b10..3567f2fa1 100644 --- a/src/modules/bluetooth/backend-native.c +++ b/src/modules/bluetooth/backend-native.c @@ -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; }