Fix PeakCAN listen-only mode with native PCAN-Basic configuration - #2
Fix PeakCAN listen-only mode with native PCAN-Basic configuration#2RMBmd wants to merge 1 commit into
Conversation
Upstream submissionThe production branch is based directly on https://github.com/collin80/SavvyCAN/compare/master...RMBmd:fix/peakcan-native-listen-only?expand=1 The connected GitHub App can write to this fork but is not installed with write permission on Validated buildThe exact commit
The temporary validation PR was closed after both jobs passed. The production branch contains no temporary workflow files. |
|
Superseded by upstream SavvyCAN PR collin80#1104: The exact submitted commit compiled successfully and has passed physical |
Problem
SavvyCAN currently represents listen-only mode as bit 0 of
QCanBusDevice::UserKey. Qt'speakcanbackend does not consume that key; it supports bitrate/CAN-FD configuration but rejects the customUserKey. Consequently, checking Listen Only in SavvyCAN can still initialize a PEAK interface in active mode, where it may acknowledge frames or emit active error flags.This is observable during sensitive diagnostic transitions such as UDS programming-session entry: PCAN-View in native listen-only mode is non-intrusive, while SavvyCAN with the same UI option can alter bus behavior.
Fix
This change:
peakcanbackend.usb0-usb15,pci0-pci15) to PCAN-Basic channel handles.CAN_SetValue(..., PCAN_LISTEN_ONLY, ...)beforeQCanBusDevice::connectDevice()initializes the channel.UserKeybehavior for non-Peak Qt SerialBus backends.PCAN-Basic is already the runtime API used by Qt's PeakCAN plugin, so this does not add a new external runtime requirement for users of that backend.
Validation
The exact production commit was compiled successfully with:
The validation branch used a temporary same-repository workflow; this submitted branch contains only the production source change.
Hardware acceptance criteria for a PEAK interface are:
PCAN_LISTEN_ONLY=ONafter initialization.Reference
PEAK documents
PCAN_LISTEN_ONLYas the controller's passive monitoring mode and permits it to be configured before channel initialization:https://www.peak-system.com/produktcd/Develop/PC%20interfaces/Windows/PCAN-Basic%20API/PCAN-Parameter_Documentation.pdf