From 2df7a2a9fc95e2b4085ec59270195a5908584be3 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 21 Oct 2018 15:07:16 -0400 Subject: [PATCH] Allow setting CAN baud rate for SerialBus devices --- connections/canconnectionmodel.cpp | 9 +++++---- connections/serialbusconnection.cpp | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/connections/canconnectionmodel.cpp b/connections/canconnectionmodel.cpp index ef4b5f8..ac07450 100644 --- a/connections/canconnectionmodel.cpp +++ b/connections/canconnectionmodel.cpp @@ -87,10 +87,11 @@ Qt::ItemFlags CANConnectionModel::flags(const QModelIndex &index) const CANConnection *conn_p = getAtIdx(index.row(), busId); if (!conn_p) return Qt::ItemFlag::NoItemFlags; - //you can't set speed, single wire, or listen only on socketcan devices so - //detect if we're using GVRET where you can and turn that functionality on - bool editParams = false; - if (conn_p->getType() == CANCon::GVRET_SERIAL) editParams = true; + //socketcan is limited for what you can set but the other serialbus + //devices should be able to set the stuff. For now let anyone try + //and the underlying drivers can do with them as they will + bool editParams = true; + //if (conn_p->getType() == CANCon::GVRET_SERIAL) editParams = true; switch (Column(index.column())) { diff --git a/connections/serialbusconnection.cpp b/connections/serialbusconnection.cpp index cf16461..6566233 100644 --- a/connections/serialbusconnection.cpp +++ b/connections/serialbusconnection.cpp @@ -96,7 +96,8 @@ void SerialBusConnection::piSetBusSettings(int pBusIdx, CANBus bus) }*/ //You cannot set the speed of a socketcan interface, it has to be set with console commands. - //mDev_p->setConfigurationParameter(QCanBusDevice::BitRateKey, bus.speed); + //But, you can probabaly set the speed of many of the other serialbus devices so go ahead and try + mDev_p->setConfigurationParameter(QCanBusDevice::BitRateKey, bus.speed); /* connect device */ if (!mDev_p->connectDevice()) {