diff --git a/java_console/bin/broadcast.sh b/java_console/bin/broadcast.sh new file mode 100755 index 0000000000..d28ab62499 --- /dev/null +++ b/java_console/bin/broadcast.sh @@ -0,0 +1 @@ +java -jar console/rusefi_console.jar network_connector \ No newline at end of file diff --git a/java_console/bin/switch_to_dfu.sh b/java_console/bin/switch_to_dfu.sh new file mode 100755 index 0000000000..45c9727db2 --- /dev/null +++ b/java_console/bin/switch_to_dfu.sh @@ -0,0 +1 @@ +java -jar console/rusefi_console.jar reboot_dfu \ No newline at end of file diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java index e64ac26d0e..539467b597 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java @@ -231,7 +231,7 @@ public class BinaryProtocol implements BinaryProtocolCommands { public void run() { while (!isClosed) { // FileLog.rlog("queue: " + LinkManager.COMMUNICATION_QUEUE.toString()); - if (linkManager.COMMUNICATION_QUEUE.isEmpty()) { + if (linkManager.COMMUNICATION_QUEUE.isEmpty() && linkManager.getNeedPullData()) { linkManager.submit(new Runnable() { @Override public void run() { diff --git a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java index c119d85d43..1ea8b9bf4e 100644 --- a/java_console/io/src/main/java/com/rusefi/io/LinkManager.java +++ b/java_console/io/src/main/java/com/rusefi/io/LinkManager.java @@ -42,6 +42,7 @@ public class LinkManager { private LinkConnector connector; private boolean isStarted; private boolean compositeLogicEnabled = true; + private boolean needPullData = true; public LinkManager(Logger logger) { this.logger = logger; @@ -107,14 +108,24 @@ public class LinkManager { return commandQueue; } - public void setCompositeLogicEnabled(boolean compositeLogicEnabled) { + public LinkManager setCompositeLogicEnabled(boolean compositeLogicEnabled) { this.compositeLogicEnabled = compositeLogicEnabled; + return this; } public boolean getCompositeLogicEnabled() { return compositeLogicEnabled; } + public boolean getNeedPullData() { + return needPullData; + } + + public LinkManager setNeedPullData(boolean needPullData) { + this.needPullData = needPullData; + return this; + } + public enum LogLevel { INFO, DEBUG, diff --git a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java index fd754a40a7..4e12f2b196 100644 --- a/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java +++ b/java_console/ui/src/main/java/com/rusefi/tools/NetworkConnectorStartup.java @@ -19,8 +19,9 @@ public class NetworkConnectorStartup { } - LinkManager linkManager = new LinkManager(Logger.CONSOLE); - linkManager.setCompositeLogicEnabled(false); + LinkManager linkManager = new LinkManager(Logger.CONSOLE) + .setCompositeLogicEnabled(false) + .setNeedPullData(false); linkManager.startAndConnect(autoDetectedPort, ConnectionStateListener.VOID); String authToken = AuthTokenPanel.getAuthToken();