proxy progress - application side UI
This commit is contained in:
parent
4896ab3c4d
commit
c0791090e6
|
@ -1,6 +1,7 @@
|
||||||
package com.rusefi.proxy;
|
package com.rusefi.proxy;
|
||||||
|
|
||||||
import com.opensr5.Logger;
|
import com.opensr5.Logger;
|
||||||
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import com.rusefi.io.commands.HelloCommand;
|
import com.rusefi.io.commands.HelloCommand;
|
||||||
|
@ -34,13 +35,14 @@ public class BaseBroadcastingThread {
|
||||||
|
|
||||||
if (command == Fields.TS_HELLO_COMMAND) {
|
if (command == Fields.TS_HELLO_COMMAND) {
|
||||||
// respond on hello request with information about session
|
// respond on hello request with information about session
|
||||||
|
logger.info("Sending out " + sessionDetails);
|
||||||
new HelloCommand(logger, sessionDetails.toJson()).handle(stream);
|
new HelloCommand(logger, sessionDetails.toJson()).handle(stream);
|
||||||
} else {
|
} else {
|
||||||
handleCommand(packet, stream);
|
handleCommand(packet, stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
logger.error("exiting thread " + e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi.proxy;
|
||||||
|
|
||||||
import com.opensr5.ConfigurationImage;
|
import com.opensr5.ConfigurationImage;
|
||||||
import com.opensr5.Logger;
|
import com.opensr5.Logger;
|
||||||
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.config.generated.Fields;
|
||||||
import com.rusefi.io.ConnectionStateListener;
|
import com.rusefi.io.ConnectionStateListener;
|
||||||
import com.rusefi.io.IoStream;
|
import com.rusefi.io.IoStream;
|
||||||
|
@ -71,9 +72,11 @@ public class NetworkConnector {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCommand(BinaryProtocolServer.Packet packet, TcpIoStream stream) throws IOException {
|
protected void handleCommand(BinaryProtocolServer.Packet packet, TcpIoStream stream) throws IOException {
|
||||||
super.handleCommand(packet, stream);
|
super.handleCommand(packet, stream);
|
||||||
|
logger.info("Relaying request to controller " + BinaryProtocol.findCommand(packet.getPacket()[0]));
|
||||||
targetEcuSocket.sendPacket(packet);
|
targetEcuSocket.sendPacket(packet);
|
||||||
|
|
||||||
BinaryProtocolServer.Packet response = targetEcuSocket.readPacket();
|
BinaryProtocolServer.Packet response = targetEcuSocket.readPacket();
|
||||||
|
logger.info("Relaying response to proxy size=" + response.getPacket().length);
|
||||||
stream.sendPacket(response);
|
stream.sendPacket(response);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue