Skip to content

Report why Windows CAN plugins failed to open through get_last_error - #759

Merged
sujandumaru merged 5 commits into
mainfrom
sujan/windows-driver-errors
Oct 7, 2026
Merged

sujandumaru merged 5 commits into
mainfrom
sujan/windows-driver-errors

Conversation

@sujandumaru

Copy link
Copy Markdown
Member

Describe your changes

Follow up to #747. The four Windows CAN plugins (PCAN-Basic, TouCAN, SYS TEC, InnoMaker USB2CAN) now override get_last_error(), so the VT Start alert can show the real reason when open() fails.

  • PCAN-Basic: driver error text and code, with a hint for no adapter, no driver, or adapter in use.
  • TouCAN: says the adapter could not be opened. The handle check is now 0 < tempHandle, because CanalOpen returns a negative value on error.
  • SYS TEC: readable text for the common UCANRET errors. It also releases the handle if CAN init fails after the hardware init worked.
  • InnoMaker: now checks the result of urbSetupDevice(), and drops the second openInnoMakerDevice() call that was ignoring its result.

Comment thread hardware_integration/src/innomaker_usb2can_windows_plugin.cpp Outdated
Comment thread hardware_integration/src/toucan_vscp_canal.cpp
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@sujandumaru
sujandumaru merged commit 1a037ee into main Oct 7, 2026
11 checks passed
@sujandumaru
sujandumaru deleted the sujan/windows-driver-errors branch October 7, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os: windows Related to usage on Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants