mirror of https://github.com/rusefi/rusefi-1.git
command line switch to DFU
This commit is contained in:
parent
f78889c1b3
commit
b504b170d0
|
@ -0,0 +1,8 @@
|
||||||
|
rem
|
||||||
|
rem auto-detects connected running rusEfi serial port and send text 'reboot' command
|
||||||
|
rem flashes DFU
|
||||||
|
rem
|
||||||
|
|
||||||
|
java -jar ../java_console_binary/rusefi_console.jar reboot_dfu
|
||||||
|
sleep 10
|
||||||
|
..\misc\install\DfuSe\DfuSeCommand.exe -c -d --fn deliver/rusefi.dfu
|
|
@ -229,7 +229,11 @@ public class Launcher {
|
||||||
FileLog.MAIN.start();
|
FileLog.MAIN.start();
|
||||||
|
|
||||||
if (TOOL_NAME_REBOOT_ECU.equalsIgnoreCase(toolName)) {
|
if (TOOL_NAME_REBOOT_ECU.equalsIgnoreCase(toolName)) {
|
||||||
invokeRebootTool();
|
sendCommand(Fields.CMD_REBOOT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Fields.CMD_REBOOT_DFU.equalsIgnoreCase(toolName)) {
|
||||||
|
sendCommand(Fields.CMD_REBOOT_DFU);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +256,7 @@ public class Launcher {
|
||||||
return CompileTool.run(Arrays.asList(args).subList(1, args.length));
|
return CompileTool.run(Arrays.asList(args).subList(1, args.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void invokeRebootTool() throws IOException {
|
private static void sendCommand(String command) throws IOException {
|
||||||
String autoDetectedPort = PortDetector.autoDetectPort(null);
|
String autoDetectedPort = PortDetector.autoDetectPort(null);
|
||||||
if (autoDetectedPort == null) {
|
if (autoDetectedPort == null) {
|
||||||
System.err.println("rusEfi not detected");
|
System.err.println("rusEfi not detected");
|
||||||
|
@ -262,7 +266,7 @@ public class Launcher {
|
||||||
if (!establishConnection.isConnected())
|
if (!establishConnection.isConnected())
|
||||||
return;
|
return;
|
||||||
IoStream stream = establishConnection.getStream();
|
IoStream stream = establishConnection.getStream();
|
||||||
byte[] commandBytes = BinaryProtocol.getTextCommandBytes(Fields.CMD_REBOOT);
|
byte[] commandBytes = BinaryProtocol.getTextCommandBytes(command);
|
||||||
stream.sendPacket(commandBytes, FileLog.LOGGER);
|
stream.sendPacket(commandBytes, FileLog.LOGGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue