From 494beb3a60a88a9ca45e57361b2c785c622a1cd3 Mon Sep 17 00:00:00 2001 From: Stefan Mertl Date: Wed, 19 Sep 2018 16:48:44 +0200 Subject: [PATCH] Check the serial connection in record mode using parsed sample data. The other version didn't trigger the watchdog when invalid data arrived at the serial port. This happened with the older versions of Ruwai which use the USB port for the serial communication. --- software/c++/ruwaicom/src/serial_parser.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/software/c++/ruwaicom/src/serial_parser.cpp b/software/c++/ruwaicom/src/serial_parser.cpp index 33adf00..5a61691 100644 --- a/software/c++/ruwaicom/src/serial_parser.cpp +++ b/software/c++/ruwaicom/src/serial_parser.cpp @@ -369,10 +369,6 @@ SerialParser::read_and_parse(void) count++; } - if (record_mode) - { - alarm(1); - } // Check for timeout. /* if (record_mode) @@ -451,10 +447,12 @@ SerialParser::parse_serial_buffer(void) if (msg_id == RW_SMP_ID_24BIT) { parse_smp_24bit(payload); + alarm(1); } else if (msg_id == RW_SMP_ID_24BIT_TSP) { parse_smp_24bit_tsp(payload); + alarm(1); } } else if (msg_class == RW_CLASS_ACK) { -- 2.11.4.GIT