mirror of https://github.com/rusefi/RomRaider.git
Add support to use Linux Openport 2.0 library if available.
This commit is contained in:
parent
84f6e0f230
commit
cf02bd3e3d
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||||
* Copyright (C) 2006-2012 RomRaider.com
|
* Copyright (C) 2006-2015 RomRaider.com
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,6 +24,7 @@ import static com.romraider.util.Platform.isPlatform;
|
||||||
import static com.romraider.util.proxy.Proxifier.proxy;
|
import static com.romraider.util.proxy.Proxifier.proxy;
|
||||||
import static org.apache.log4j.Logger.getLogger;
|
import static org.apache.log4j.Logger.getLogger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -60,8 +61,21 @@ public final class ConnectionManagerFactory {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (!isPlatform(WINDOWS))
|
if (!isPlatform(WINDOWS)) {
|
||||||
throw new RuntimeException("J2534 is not support on this platform");
|
final String op2Lib = "/usr/local/lib/j2534.so";
|
||||||
|
final File libFile = new File(op2Lib);
|
||||||
|
if (libFile.exists()) {
|
||||||
|
return J2534TransportFactory.getManager(
|
||||||
|
settings.getTransportProtocol().toUpperCase(),
|
||||||
|
connectionProperties,
|
||||||
|
op2Lib);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new RuntimeException(
|
||||||
|
"Linux Openport 2.0 library not found in: " +
|
||||||
|
op2Lib);
|
||||||
|
}
|
||||||
|
}
|
||||||
Set<J2534Library> libraries =
|
Set<J2534Library> libraries =
|
||||||
J2534DllLocator.listLibraries(
|
J2534DllLocator.listLibraries(
|
||||||
settings.getTransportProtocol().toUpperCase());
|
settings.getTransportProtocol().toUpperCase());
|
||||||
|
|
Loading…
Reference in New Issue