From 690d6bc90c1b5bde1d11ffe4c00d8c906b3fdb40 Mon Sep 17 00:00:00 2001 From: Peter Gebruers Date: Tue, 21 Jan 2020 08:52:35 +0100 Subject: [PATCH] Fix handling of controller CAN (#2049) The key change is that before this commit "CAN received...triggering resend" immediately leads to outbound data "Sending (Command) message (Attempt 2". After this PR then "CAN received...triggering resend will handle the incoming data "Unsolicited message received while waiting for ACK." --- cpp/src/Driver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/Driver.cpp b/cpp/src/Driver.cpp index 7a31b5952a..2f005b2c19 100644 --- a/cpp/src/Driver.cpp +++ b/cpp/src/Driver.cpp @@ -1723,7 +1723,8 @@ bool Driver::ReadMsg() Log::Write(LogLevel_Warning, "m_currentMsg was NULL when trying to set MaxSendAttempts"); Log::QueueDump(); } - WriteMsg("CAN"); + // Don't do WriteMsg("CAN"); here, the controller has data waiting to be handled by OZW. + // Instead, let the main loop handle incoming message first to flush the buffer(s) break; }