only:reducing method visibility
This commit is contained in:
parent
c797697a8a
commit
7363e80f3b
|
@ -17,7 +17,6 @@ import com.rusefi.util.IoUtils;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeSet;
|
||||
|
@ -83,13 +82,6 @@ public class LinkManager implements Closeable {
|
|||
commandQueue = new CommandQueue(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static IoStream open(String port) throws IOException {
|
||||
if (TcpConnector.isTcpPort(port))
|
||||
return TcpIoStream.open(port);
|
||||
return BufferedSerialIoStream.openPort(port);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CountDownLatch connect(String port) {
|
||||
final CountDownLatch connected = new CountDownLatch(1);
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.rusefi.io;
|
||||
|
||||
import com.rusefi.io.serial.BufferedSerialIoStream;
|
||||
import com.rusefi.io.tcp.TcpConnector;
|
||||
import com.rusefi.io.tcp.TcpIoStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class UiLinkManagerHelper {
|
||||
@NotNull
|
||||
public static IoStream open(String port) throws IOException {
|
||||
if (TcpConnector.isTcpPort(port))
|
||||
return TcpIoStream.open(port);
|
||||
return BufferedSerialIoStream.openPort(port);
|
||||
}
|
||||
}
|
|
@ -31,6 +31,7 @@ import com.rusefi.tools.online.Online;
|
|||
import com.rusefi.tune.xml.Msq;
|
||||
import com.rusefi.ui.AuthTokenPanel;
|
||||
import com.rusefi.ui.StatusConsumer;
|
||||
import com.rusefi.io.UiLinkManagerHelper;
|
||||
import com.rusefi.ui.basic.BasicStartupFrame;
|
||||
import com.rusefi.ui.light.LightweightGUI;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -130,7 +131,7 @@ public class ConsoleTools {
|
|||
System.out.println(RUS_EFI_NOT_DETECTED);
|
||||
return;
|
||||
}
|
||||
IoStream ecuStream = LinkManager.open(autoDetectedPort);
|
||||
IoStream ecuStream = UiLinkManagerHelper.open(autoDetectedPort);
|
||||
|
||||
ServerSocketReference serverHolder = BinaryProtocolProxy.createProxy(ecuStream, 29001, new BinaryProtocolProxy.ClientApplicationActivityListener() {
|
||||
@Override
|
||||
|
@ -207,7 +208,7 @@ public class ConsoleTools {
|
|||
String autoDetectedPort = autoDetectPort();
|
||||
if (autoDetectedPort == null)
|
||||
return;
|
||||
IoStream stream = LinkManager.open(autoDetectedPort);
|
||||
IoStream stream = UiLinkManagerHelper.open(autoDetectedPort);
|
||||
byte[] commandBytes = BinaryProtocol.getTextCommandBytes(command);
|
||||
stream.sendPacket(commandBytes);
|
||||
}
|
||||
|
@ -369,7 +370,7 @@ public class ConsoleTools {
|
|||
System.out.println(RUS_EFI_NOT_DETECTED);
|
||||
return;
|
||||
}
|
||||
IoStream stream = LinkManager.open(autoDetectedPort);
|
||||
IoStream stream = UiLinkManagerHelper.open(autoDetectedPort);
|
||||
IncomingDataBuffer incomingData = stream.getDataBuffer();
|
||||
byte[] commandBytes = BinaryProtocol.getTextCommandBytes("hello");
|
||||
stream.sendPacket(commandBytes);
|
||||
|
|
Loading…
Reference in New Issue