mirror of https://github.com/rusefi/RomRaider.git
updated ramtune test app
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@643 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
6d164f0f7e
commit
abc2838aac
|
@ -10,15 +10,22 @@ import static enginuity.util.ParamChecker.checkNotNull;
|
||||||
import static enginuity.util.ParamChecker.checkNotNullOrEmpty;
|
import static enginuity.util.ParamChecker.checkNotNullOrEmpty;
|
||||||
|
|
||||||
public final class CommandExecutorImpl implements CommandExecutor {
|
public final class CommandExecutorImpl implements CommandExecutor {
|
||||||
private final EcuConnection ecuConnection;
|
private final ConnectionProperties connectionProperties;
|
||||||
|
private final String port;
|
||||||
|
|
||||||
public CommandExecutorImpl(ConnectionProperties connectionProperties, String port) {
|
public CommandExecutorImpl(ConnectionProperties connectionProperties, String port) {
|
||||||
checkNotNull(connectionProperties);
|
checkNotNull(connectionProperties);
|
||||||
checkNotNullOrEmpty(port, "port");
|
checkNotNullOrEmpty(port, "port");
|
||||||
this.ecuConnection = new EcuConnectionImpl(connectionProperties, port);
|
this.connectionProperties = connectionProperties;
|
||||||
|
this.port = port;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommandResult executeCommand(Command command) {
|
public CommandResult executeCommand(Command command) {
|
||||||
return new CommandResultImpl(ecuConnection.send(command.getBytes()));
|
EcuConnection ecuConnection = new EcuConnectionImpl(connectionProperties, port);
|
||||||
|
try {
|
||||||
|
return new CommandResultImpl(ecuConnection.send(command.getBytes()));
|
||||||
|
} finally {
|
||||||
|
ecuConnection.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue