diff --git a/vesc_tool.pro b/vesc_tool.pro index 1eeb7a6e4..e008a4cdc 100644 --- a/vesc_tool.pro +++ b/vesc_tool.pro @@ -63,7 +63,7 @@ ios: { # CAN bus available # Adding serialbus to Qt seems to break the serial port on static builds. TODO: Figure out why. -#DEFINES += HAS_CANBUS +DEFINES += HAS_CANBUS # Positioning DEFINES += HAS_POS diff --git a/vescinterface.cpp b/vescinterface.cpp index 0deba4150..499c8661b 100755 --- a/vescinterface.cpp +++ b/vescinterface.cpp @@ -2373,7 +2373,9 @@ bool VescInterface::connectCANbus(QString backend, QString ifName, int bitrate) mCanDevice->setConfigurationParameter(QCanBusDevice::ReceiveOwnKey, false); // bitrate change not supported yet by socketcan. It is possible to set the rate when // configuring the CAN network interface using the ip link command. - // mCanDevice->setConfigurationParameter(QCanBusDevice::BitRateKey, bitrate); + // This needs to happen or Qt will try and set a default bitrate which libsocketsocket can doesn't accept + mCanDevice->setConfigurationParameter(QCanBusDevice::BitRateKey, QVariant()); + mCanDevice->setConfigurationParameter(QCanBusDevice::CanFdKey, false); mCanDevice->setConfigurationParameter(QCanBusDevice::ReceiveOwnKey, false);