Files
giesCANne/ui/newconnectiondialog.ui
T
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

202 lines
5.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewConnectionDialog</class>
<widget class="QDialog" name="NewConnectionDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>426</width>
<height>540</height>
</rect>
</property>
<property name="windowTitle">
<string>New Connection</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="gbType">
<property name="title">
<string>Connection Type</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<widget class="QRadioButton" name="rbKayak">
<property name="text">
<string>socketcand (SocketCAN over Ethernet)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QRadioButton" name="rbSocketCAN">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>QT SerialBus Devices (SocketCAN, PeakCAN, etc)</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QRadioButton" name="rbMQTT">
<property name="text">
<string>MQTT Connection</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="rbGVRET">
<property name="text">
<string>Serial Connection (GVRET)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="rbRemote">
<property name="text">
<string>Network connection (GVRET)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="rbLawicel">
<property name="text">
<string>LAWICEL / SLCAN Serial</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QRadioButton" name="rbCANserver">
<property name="text">
<string>CANserver</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QRadioButton" name="rbCanlogserver">
<property name="text">
<string>CANlogserver</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QRadioButton" name="rbGSUSB">
<property name="text">
<string>gs_usb (candleLight, CANable, CANnectivity)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDeviceType">
<property name="text">
<string>SerialBus Device Type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbDeviceType"/>
</item>
<item>
<widget class="QLabel" name="lPort">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Serial Port:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbPort">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>341</width>
<height>16777215</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblSerialSpeed">
<property name="text">
<string>Serial Port Speed:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbSerialSpeed"/>
</item>
<item>
<widget class="QLabel" name="lblCANSpeed">
<property name="text">
<string>CAN Bus Speed:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbCANSpeed"/>
</item>
<item>
<widget class="QCheckBox" name="cbCanFd">
<property name="text">
<string>CAN-FD</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDataRate">
<property name="text">
<string>CAN-FD data rate</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbDataRate"/>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnOK">
<property name="text">
<string>Create New Connection</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>