Commit Graph
59 Commits
Author SHA1 Message Date
RefuhrandClaude Opus 5 2c8f9c6c23 fix: skip saved connections this build cannot create
CanConFactory::create() returns nullptr for a type the platform does not
support, and loadConnections() handed that straight to the model, which
appends it to the connection list unguarded. Every later iteration over that
list then dereferences it.

Reachable by carrying a settings file holding a gs_usb connection from
Windows to another platform, and by any saved type id the factory does not
recognise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZnuZJ7zc3e8hk6C8bGDZN
2026-08-03 13:12:52 +02:00
RefuhrandClaude Opus 5 3ae429ae48 feat: add gs_usb support on Windows
candleLight, CANable, CANnectivity and cantact adapters speak gs_usb. On
Linux and macOS the kernel driver exposes them as SocketCAN interfaces, so
SavvyCAN already reached them through Qt SerialBus. Windows has no such
driver, which left those adapters unusable there.

Add a GSUSBConnection that talks to the hardware directly over WinUSB:

- one connection per physical device, one SavvyCAN bus per CAN channel
- CAN FD including BRS, plus RTR, extended IDs and error frames
- known good bit timings for 16/48/80/160/170 MHz device clocks, with a
  generic solver for clocks the tables do not cover
- hardware timestamps, unwrapped across the 32 bit rollover and anchored
  to the host clock so they line up with the rest of SavvyCAN

gs_usb multiplexes every channel over a single USB bulk IN endpoint, so a
single reader thread drains it and hands frames to the connection thread in
batches, coalescing the wakeups. That keeps one producer on the lock free
queue, which the tx echo path already writes to.

Device scans skip adapters that a live connection holds. candle_dev_open()
shares the file handle and queues read URBs immediately, so probing a device
in use would consume frames the open connection is waiting for.

connections/candle_api is an unmodified copy of the candle Windows API, LGPL
3.0 rather than MIT and only compiled into Windows builds. See its README for
provenance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZnuZJ7zc3e8hk6C8bGDZN
2026-07-29 09:25:32 +02:00
Refuhr d94537d00c feat: add ctrl + r shortcut to reload all connections 2026-07-07 15:41:37 +02:00
Collin Kidder e32c16f661 Merge pull request #895 from wernerc11/complete_connection_save
Implemented connection save with speeds and can fd at least for bus 0.
2025-05-05 18:35:22 -04:00
werner 60b0e65a18 Implemented connection save with speeds and can fd at least for bus 0. 2025-02-13 20:21:15 +01:00
Joris Pevcevicius a3cdbaf685 Fix device deselection after connecting 2024-07-24 00:04:03 +03:00
Alexey Esaulenko 8aa3659999 ConnectionWindow: declare debug output connection as unique to prevent duplicates 2024-01-19 15:40:00 +04:00
maciek16c 190d51ae90 LAWICEL CAN-FD support, CAN-FD data rate selection 2023-11-22 14:39:36 +01:00
Collin Kidder 780e2fb1a2 Several changes suggested in draft pull requests from llange. Fix some
ambiguous places, fix warnings, fix errors when trying to compile with
QT6
2023-04-11 21:15:34 -04:00
Andy Huska 01d793f21f Merge branch 'master' into fix_customsendcrash 2022-11-02 16:52:20 -05:00
Andy Huska 1b41decd20 Custom sender is no longer crashing
There are a TON of explorations I did here, many may be unnecessary, but this is a stake in the ground.

The main issue was the strange queue logic in canconmanager::sendFrame which puts the tx data in the rx
queue so it will show up in the displayed data.  It caused SIGABRT and SIGSEG to show up everywhere.
It is NOT fixed yet, but TX works over the wire you just can't see it in the tableview.

I thought at first it was only when overwrite data was active, so I put in a a pile of changes to keep
frames and filtered frames as two seperate copies of data where frames was always complete and filtered
was only what was seen in the mainwindow.  It made it so the graphing window would work with overwrite
data active which is an improvement.  I wouldn't roll these changes back.  Because of these changes I
had to update the frame sorting code adjust the refresh function in canframemode.cpp

I also thought it was related to UI updates, but its not, that's been confirmed.

I put a mutex around the custom sender tick timer so that the 1ms timer wouldn't re-enter its callback.
This didn't fix the crash, but it sure seems to make a lot of sense, and the way I did it no elasped
time is lost for tracking purposes, and in reality theres no way 1ms was consistent anyway.

I put a mutex around the shrinking of frames and filteredframes to make sure we weren't deleting at
the same time as accessing, but honestly we acccess those lists in many places without semaphores so
that probably did nothing.

Fixed a bug in FrameSenderWindow:DoModifiers that was improperly parsing and sometimes crashing when
looking for the ~ operator before a symbol.

Also added some minor work to keep row expansion functioning when changing filters or sorting.  Need
to make some tweaks so it stops trying so hard when overwrite is not active

Theres also code in main.c taht makes debugging output super verbose.

Committing now to start cleanup
2022-11-01 15:01:07 -05:00
Bohdan Buinich 2c82535ca7 Added support for CAN FD frames to the SERIALBUS 2022-10-11 22:18:58 +03:00
Collin Kidder 677d9ba9f8 Add 83.33k speed to possible CAN speed options in the connections
windows.
2022-10-10 20:09:51 -04:00
Collin Kidder 7678a498db Merge branch 'master' of github.com:collin80/SavvyCAN 2022-10-04 19:59:46 -04:00
Collin Kidder 9ebbaca668 Add a new connection type - Lawicel. It works for some devices, not
all. More development needed but this is a start. Also added ability
to set serial speed and bus speed in the device setup which may be
useful for other connection devices too.
2022-10-04 19:48:11 -04:00
Ludovic LANGE 9fb86e649f remove qRegisterMetaTypeStreamOperators (qt6)
Since Qt6, some methods of [QMetaType are removed](https://doc.qt.io/qt-6/qtcore-changes-qt6.html#the-qmetatype-class).

We remove `qRegisterMetaTypeStreamOperators()` calls for Qt >= 6
2022-09-24 17:51:25 +02:00
Collin Kidder b37af8d948 Fix time formatting for "system clock" mode, fix a few small bugs
elsewhere, add ability to send/receive CAN-FD frames in GVRET.
2022-05-05 20:04:44 -04:00
Collin Kidder 6e0e967ea4 Add 33333 speed to CAN bauds, along with a few more commented out. 2021-09-19 18:22:14 -04:00
Collin Kidder 44a48b3515 Fixed up MQTT connection code, made connection window hook up setup
debugging to the console if it is enabled.
2021-06-15 22:12:43 -04:00
Collin Kidder f53ad8a65a Fixed help system.
Also switched from Sphinx generated HTML to GitHub markup help files.

This improves compatibility and will allow the help files to more easily be viewed on github as well.
2021-05-30 23:40:47 -04:00
Bertrand c49783a55b adding socketcand support 2021-02-23 09:38:19 +01:00
Bertrand 0283571d16 adding connection reordering (move up/down)
replacing connectionwindow.ui with own version
2021-02-23 08:55:24 +01:00
Collin Kidder b345495178 Fix compilation on Windows, fix glitch that could cause windows to appear off the actual screen with no way to get them back. 2020-11-15 01:30:13 -08:00
Collin Kidder 1cb0351c86 Fix gvret code to work with single bus adapters (such as Macchina A0), small change to UDP receiver 2020-07-15 18:25:31 -04:00
Collin Kidder 8beb0e31a0 Converted more code to be easier to generalize to larger CAN payloads
for CAN-FD. Improved some code to be faster. Fixed up some compile
time warnings.
2019-12-15 15:02:06 -05:00
Collin Kidder 09b8d64f4a Add a reset connection button. Automatically disconnects and
reconnects to try to heal a broken connection.
2019-05-13 20:50:16 -04:00
Collin Kidder 5f97e968e3 Remove label for bus number and instead use tabs. The tabs are now
numbered by the actual system bus number and not always based on 1 any
longer.
2019-04-24 22:10:03 -04:00
Collin Kidder c157da0a90 Add back in the ability to suspend/resume all buses from the main
screen. Whoops, it got deleted by accident!
2019-03-14 19:32:14 -04:00
Collin Kidder bf0492e084 Fix an issue with automatic remote detection when multiple instances
of SavvyCAN are running.
2019-03-06 21:02:24 -05:00
Collin Kidder 591ebe71df Fixes to debug console in connection window 2019-03-06 20:20:40 -05:00
Collin Kidder f23abe170f Fix a glitch with the new connection window and bus settings 2019-03-06 19:59:19 -05:00
Collin Kidder ec49413f61 Major revamp of the connection window. Hopefully it is more clear and
intuitive now.
2019-03-05 21:25:32 -05:00
Collin Kidder 70e8af85af Added ability to automatically find ESP32RET devices on the local network 2019-02-27 20:29:08 -05:00
Collin Kidder 35c22936c3 Allow the program to "send" frames even if no buses are configured.
These frames will show up in the main frame list and can be operated
on as if they came into the program. It is likely that only the
playback window will work for this special use. Other sending windows
are to follow.
2019-02-26 21:33:04 -05:00
Collin Kidder b91dad5f03 Reorder Tabs for preference window, add preference for whether to load
and save CAN bus connections.
2019-02-24 20:45:27 -05:00
Collin Kidder 3291869849 Fix automatic loading of connections on start up. Shouldn't crash
now...
2019-02-17 15:15:48 -05:00
Collin Kidder 151217bc3f Merge branch 'master' of github.com:collin80/SavvyCAN into WIP 2019-02-13 21:00:19 -05:00
Collin Kidder fa91de9e4f Tweaks to GVRET code to make it work better with the variety of
compatible hardware.
2019-02-13 20:57:51 -05:00
MartinX 52f04791dd add setWindowFlags(Qt::Window) to improve window management
* improves window handling a lot
	(on Linux GNOME 3 at least: quickly resizing windows left/right, not forced in foreground anymore etc.)
	setWindowFlags() inserted in all *window.cpp files except mainwindow
    * some whitespace at EOL trimmed
2019-02-13 20:08:41 +01:00
Collin Kidder b7bb37048b Enabled ability to use any QT SerialBus driver in SavvyCAN. Now
PeakCAN, ValueCAN, SocketCAN, and J2534 should all work.
2018-10-21 11:50:24 -04:00
Fabián Inostroza dcce8a250f Register metatypes before loading and saving configuration. 2018-06-01 21:26:54 -04:00
Collin Kidder 60abd15461 Added a mode for TCP/IP network connection to a GVRET compatible device (ESP32RET supports this) 2018-04-17 20:01:53 -04:00
Collin Kidder c380e172b0 Add UI elements for a new remote connection system. Just UI and settings for now. 2018-02-11 18:32:18 -05:00
Collin Kidder 9302c18c33 Integrated help into the system. Most all the sub-screens that are actually complete
and working have integrated help now. Press F1 to bring up help for a given window.
2017-11-30 21:02:16 -05:00
Collin Kidder c819459d19 Significant changes to GVRET code to make debugging easier and to make code more robust. 2017-11-26 16:41:10 -05:00
Collin Kidder 61443022a7 Merge branch 'master' of github.com:collin80/SavvyCAN into WIP 2017-11-21 19:52:41 -05:00
Collin Kidder 1ea9ea4fac Add fault handling code mostly used to detect when the serial port disappears while a GVRET style device is connected. Beginnings of code to add a reconnect button. 2017-11-20 22:07:13 -05:00
Collin Kidder 214f5defd8 Fix a compiling bug on windows (was a bug everywhere but only fatal on windows) 2017-11-10 01:23:15 -05:00
Collin Kidder 3bf19fdbc4 Moved a lot of the frame playback window functionality to a new class. This allows the functionality to be run
on a separate thread. The performance is a lot better and "use original timing" is now reasonably accurate.
2017-11-08 20:38:19 -05:00
Collin Kidder bc4e823d3d CAN Connection Window mostly done now. 2017-10-23 19:45:08 -04:00