console does not send commands fix #3928

This commit is contained in:
rusefillc 2022-02-12 10:36:04 -05:00
parent 432d048355
commit 34295e7108
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher reboot_ecu" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.rusefi.Launcher" />
<module name="ui" />
<option name="PROGRAM_PARAMETERS" value="reboot_ecu" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@ -501,7 +501,7 @@ public class BinaryProtocol {
* @return true in case of timeout, false if got proper confirmation
*/
private boolean sendTextCommand(String text) {
byte[] command = getTextCommandBytes(text);
byte[] command = getTextCommandBytesOnlyTest(text);
long start = System.currentTimeMillis();
while (!isClosed && (System.currentTimeMillis() - start < Timeouts.BINARY_IO_TIMEOUT)) {
@ -515,6 +515,14 @@ public class BinaryProtocol {
}
public static byte[] getTextCommandBytes(String text) {
byte[] asBytes = text.getBytes();
byte[] command = new byte[asBytes.length + 1];
command[0] = Fields.TS_EXECUTE;
System.arraycopy(asBytes, 0, command, 1, asBytes.length);
return command;
}
public static byte[] getTextCommandBytesOnlyTest(String text) {
return text.getBytes();
}