From f362b67516d6a1ac9d3c24abfa2af611e1fe066b Mon Sep 17 00:00:00 2001 From: Geoff McIver Date: Wed, 7 Dec 2022 15:13:40 +1300 Subject: [PATCH 1/2] Fool Qt serial into not attempting to set a socketcan bitrate --- vescinterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); From 3dbd46945abb4638fe659d054e1ca5cf5d7c731e Mon Sep 17 00:00:00 2001 From: Geoff McIver Date: Wed, 7 Dec 2022 15:14:18 +1300 Subject: [PATCH 2/2] enable can in the build --- vesc_tool.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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