Enabled ability to use any QT SerialBus driver in SavvyCAN. Now
PeakCAN, ValueCAN, SocketCAN, and J2534 should all work.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
/**** class definition ****/
|
||||
/***********************************/
|
||||
|
||||
SerialBusConnection::SerialBusConnection(QString portName) :
|
||||
CANConnection(portName, CANCon::SOCKETCAN, 1, 4000, true),
|
||||
SerialBusConnection::SerialBusConnection(QString portName, QString driverName) :
|
||||
CANConnection(portName, driverName, CANCon::SERIALBUS, 1, 4000, true),
|
||||
mTimer(this) /*NB: set connection as parent of timer to manage it from working thread */
|
||||
{
|
||||
}
|
||||
@@ -77,10 +77,10 @@ void SerialBusConnection::piSetBusSettings(int pBusIdx, CANBus bus)
|
||||
|
||||
/* create device */
|
||||
QString errorString;
|
||||
mDev_p = QCanBus::instance()->createDevice("socketcan", getPort(), &errorString);
|
||||
mDev_p = QCanBus::instance()->createDevice(getDriver(), getPort(), &errorString);
|
||||
if (!mDev_p) {
|
||||
disconnectDevice();
|
||||
qDebug() << "Error: createDevice(" << getType() << getPort() << "):" << errorString;
|
||||
qDebug() << "Error: createDevice(" << getType() << getDriver() << getPort() << "):" << errorString;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user