From 0bd779fd588a810c48dea58c9edc3e25b280b0b8 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 28 Sep 2021 11:30:22 -0400 Subject: [PATCH] I have a discovery board which does not switch to DFU #3280 better logging --- java_console/io/src/main/java/com/rusefi/io/DfuHelper.java | 2 +- .../com/rusefi/io/serial/SerialIoStreamJSerialComm.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java b/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java index 785a68f815..3b987eec82 100644 --- a/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java +++ b/java_console/io/src/main/java/com/rusefi/io/DfuHelper.java @@ -21,7 +21,7 @@ public class DfuHelper { try { stream.sendPacket(command); stream.close(); - messages.append("Reboot command sent!\n"); + messages.append(String.format("Reboot command [%s] sent into %s!\n", Fields.CMD_REBOOT_DFU, stream)); } catch (IOException e) { messages.append("Error " + e); } diff --git a/java_console/io/src/main/java/com/rusefi/io/serial/SerialIoStreamJSerialComm.java b/java_console/io/src/main/java/com/rusefi/io/serial/SerialIoStreamJSerialComm.java index 1eaf662f99..f6ba8cbab3 100644 --- a/java_console/io/src/main/java/com/rusefi/io/serial/SerialIoStreamJSerialComm.java +++ b/java_console/io/src/main/java/com/rusefi/io/serial/SerialIoStreamJSerialComm.java @@ -18,7 +18,7 @@ import static com.devexperts.logging.Logging.getLogging; */ public class SerialIoStreamJSerialComm extends AbstractIoStream { private static final Logging log = getLogging(SerialIoStreamJSerialComm.class); - private SerialPort sp; + private final SerialPort sp; private final String port; private final IncomingDataBuffer dataBuffer; @@ -99,4 +99,9 @@ public class SerialIoStreamJSerialComm extends AbstractIoStream { // FileLog.LOGGER.info("[SerialIoStreamJSerialComm] opened " + port); return new SerialIoStreamJSerialComm(serialPort, port); } + + @Override + public String toString() { + return port + " " + super.toString(); + } }