Allow setting CAN baud rate for SerialBus devices
This commit is contained in:
@@ -87,10 +87,11 @@ Qt::ItemFlags CANConnectionModel::flags(const QModelIndex &index) const
|
|||||||
CANConnection *conn_p = getAtIdx(index.row(), busId);
|
CANConnection *conn_p = getAtIdx(index.row(), busId);
|
||||||
if (!conn_p) return Qt::ItemFlag::NoItemFlags;
|
if (!conn_p) return Qt::ItemFlag::NoItemFlags;
|
||||||
|
|
||||||
//you can't set speed, single wire, or listen only on socketcan devices so
|
//socketcan is limited for what you can set but the other serialbus
|
||||||
//detect if we're using GVRET where you can and turn that functionality on
|
//devices should be able to set the stuff. For now let anyone try
|
||||||
bool editParams = false;
|
//and the underlying drivers can do with them as they will
|
||||||
if (conn_p->getType() == CANCon::GVRET_SERIAL) editParams = true;
|
bool editParams = true;
|
||||||
|
//if (conn_p->getType() == CANCon::GVRET_SERIAL) editParams = true;
|
||||||
|
|
||||||
switch (Column(index.column()))
|
switch (Column(index.column()))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.
|
//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 */
|
/* connect device */
|
||||||
if (!mDev_p->connectDevice()) {
|
if (!mDev_p->connectDevice()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user