ELM327 bugfix: baud rate
This commit is contained in:
parent
1a6483757a
commit
b8f7efb437
|
@ -3,6 +3,7 @@ package com.rusefi.autodetect;
|
||||||
import com.devexperts.logging.Logging;
|
import com.devexperts.logging.Logging;
|
||||||
import com.rusefi.NamedThreadFactory;
|
import com.rusefi.NamedThreadFactory;
|
||||||
import com.rusefi.io.LinkManager;
|
import com.rusefi.io.LinkManager;
|
||||||
|
import com.rusefi.io.serial.BaudRateHolder;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -15,6 +16,8 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import static com.rusefi.io.can.Elm327Connector.ELM327_DEFAULT_BAUDRATE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
*/
|
*/
|
||||||
|
@ -58,6 +61,9 @@ public class PortDetector {
|
||||||
Thread thread = AUTO_DETECT_PORT.newThread(new Runnable() {
|
Thread thread = AUTO_DETECT_PORT.newThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (mode == DetectorMode.DETECT_ELM327) {
|
||||||
|
BaudRateHolder.INSTANCE.baudRate = ELM327_DEFAULT_BAUDRATE;
|
||||||
|
}
|
||||||
new SerialAutoChecker(mode, serialPort, portFound).openAndCheckResponse(result, callback);
|
new SerialAutoChecker(mode, serialPort, portFound).openAndCheckResponse(result, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue