auto-sync
This commit is contained in:
parent
bc2f08b124
commit
9e83b22bb0
|
@ -0,0 +1,50 @@
|
|||
package com.rusefi.io.tcp;
|
||||
|
||||
import com.rusefi.FileLog;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
/**
|
||||
* This class makes rusEfi console a proxy for other tuning software, this way we can have two tools connected via same
|
||||
* serial port simultaniously
|
||||
*
|
||||
* @author Andrey Belomutskiy
|
||||
* 11/24/15
|
||||
*/
|
||||
|
||||
public class BinaryProtocolServer {
|
||||
private static final int PROXY_PORT = 2390;
|
||||
|
||||
public static void start() {
|
||||
FileLog.MAIN.logLine("BinaryProtocolServer on " + PROXY_PORT);
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ServerSocket serverSocket;
|
||||
try {
|
||||
serverSocket = new ServerSocket(PROXY_PORT, 1);
|
||||
|
||||
while (true) {
|
||||
// Wait for a connection
|
||||
final Socket clientSocket = serverSocket.accept();
|
||||
FileLog.MAIN.logLine("Binary protocol proxy port connection");
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runProxy(clientSocket);
|
||||
}
|
||||
}, "proxy connection").start();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
};
|
||||
new Thread(runnable, "BinaryProtocolServer").start();
|
||||
}
|
||||
|
||||
private static void runProxy(Socket clientSocket) {
|
||||
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.rusefi.binaryprotocol.BinaryProtocol;
|
|||
import com.rusefi.core.EngineState;
|
||||
import com.rusefi.core.MessagesCentral;
|
||||
import com.rusefi.io.LinkManager;
|
||||
import com.rusefi.io.tcp.BinaryProtocolServer;
|
||||
import com.rusefi.maintenance.VersionChecker;
|
||||
import com.rusefi.ui.*;
|
||||
import com.rusefi.ui.engine.EngineSnifferPanel;
|
||||
|
@ -32,7 +33,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
* @see com.rusefi.StartupFrame
|
||||
*/
|
||||
public class Launcher {
|
||||
public static final int CONSOLE_VERSION = 20151117;
|
||||
public static final int CONSOLE_VERSION = 20151124;
|
||||
public static final boolean SHOW_STIMULATOR = false;
|
||||
private static final String TAB_INDEX = "main_tab";
|
||||
protected static final String PORT_KEY = "port";
|
||||
|
@ -80,6 +81,7 @@ public class Launcher {
|
|||
tabbedPane.add("Log Viewer", new LogViewer(engineSnifferPanel));
|
||||
|
||||
ConnectionWatchdog.start();
|
||||
BinaryProtocolServer.start();
|
||||
|
||||
tabbedPane.addTab("Gauges", new GaugesPanel(getConfig().getRoot().getChild("gauges")).getContent());
|
||||
tabbedPane.addTab("Engine Sniffer", engineSnifferPanel.getPanel());
|
||||
|
|
Loading…
Reference in New Issue