mirror of https://github.com/rusefi/RomRaider.git
When called by an OBD connection, handle a null stopRequest gracefully
This commit is contained in:
parent
908ca238e0
commit
6ad0f4357a
|
@ -55,7 +55,7 @@ public final class J2534ConnectionISO15765 implements ConnectionManager {
|
|||
@Override
|
||||
public void open(byte[] start, byte[] stop) {
|
||||
checkNotNull(start, "start");
|
||||
checkNotNull(start, "stop");
|
||||
checkNotNull(stop, "stop");
|
||||
this.stopRequest = stop;
|
||||
LOGGER.debug(String.format("Start Diagnostics Request ---> %s",
|
||||
asHex(start)));
|
||||
|
@ -94,12 +94,14 @@ public final class J2534ConnectionISO15765 implements ConnectionManager {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
LOGGER.debug(String.format("Stop Diagnostics Request ---> %s",
|
||||
asHex(stopRequest)));
|
||||
api.writeMsg(channelId, stopRequest, timeout, TxFlags.ISO15765_FRAME_PAD);
|
||||
final byte[] response = api.readMsg(channelId, 1, timeout);
|
||||
LOGGER.debug(String.format("Stop Diagnostics Response <--- %s",
|
||||
asHex(response)));
|
||||
if (stopRequest != null) { // OBD has no open or close procedure
|
||||
LOGGER.debug(String.format("Stop Diagnostics Request ---> %s",
|
||||
asHex(stopRequest)));
|
||||
api.writeMsg(channelId, stopRequest, timeout, TxFlags.ISO15765_FRAME_PAD);
|
||||
final byte[] response = api.readMsg(channelId, 1, timeout);
|
||||
LOGGER.debug(String.format("Stop Diagnostics Response <--- %s",
|
||||
asHex(response)));
|
||||
}
|
||||
stopFcFilter();
|
||||
disconnectChannel();
|
||||
closeDevice();
|
||||
|
|
Loading…
Reference in New Issue