Enabled ability to use any QT SerialBus driver in SavvyCAN. Now

PeakCAN, ValueCAN, SocketCAN, and J2534 should all work.
This commit is contained in:
Collin Kidder
2018-10-21 11:50:24 -04:00
parent ecf4c1788b
commit b7bb37048b
12 changed files with 118 additions and 68 deletions
+4 -4
View File
@@ -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;
}