Skip to content

The gs_usb interface support #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Nov 16, 2020
Merged

Conversation

jxltom
Copy link
Contributor

@jxltom jxltom commented Sep 12, 2020

The gs_usb is the interface for Geschwister Schneider USB/CAN devices and bytewerk.org candleLight USB CAN devices such as candlelight, canable, cantact, etc. Refer to https://github.com/torvalds/linux/blob/master/drivers/net/can/usb/gs_usb.c and https://github.com/candle-usb/candleLight_fw

This PR implements the general driver for gs_usb devices based on pyusb, tested on Windows/Linux/Mac.

It looks like one of the gs_usb device cantact is supported in #853. However, that interface might diverge from gs_usb since it is going to add CAN FD support. This PR is more universal for gs_usb devices. Since this interface is using pyusb as backend, it has better crossplatform compatibility.

@jxltom jxltom force-pushed the feature/gs-usb-support branch from 87930a0 to 52a2aab Compare September 12, 2020 09:38
@codecov
Copy link

codecov bot commented Sep 12, 2020

Codecov Report

Merging #905 (17f05d7) into develop (72c4ac9) will decrease coverage by 0.42%.
The diff coverage is 4.44%.

@@             Coverage Diff             @@
##           develop     #905      +/-   ##
===========================================
- Coverage    70.76%   70.34%   -0.43%     
===========================================
  Files           71       72       +1     
  Lines         7061     7106      +45     
===========================================
+ Hits          4997     4999       +2     
- Misses        2064     2107      +43     

Copy link
Owner

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks very clean, just minor comments mostly around documentation.

Bit of a shame to not have support for periodic messages or filtering.

@hardbyte
Copy link
Owner

@ericevenchick any chance you could provide your thoughts?

@ericevenchick
Copy link
Contributor

@jxltom is right, CANtact is diverging a bit from gs_usb to add FD support. There's already a gs_usb_fd Linux kernel module for this: https://github.com/linklayer/gs_usb_fd

The goal was to keep support with the original gs_usb, but that's not my standard to modify. The gs_usb_fd module supports normal gs_usb devices, and FD devices provide a flag to show they have support.

@jxltom jxltom force-pushed the feature/gs-usb-support branch from 3402873 to 676dd7c Compare October 22, 2020 06:34
@jxltom
Copy link
Contributor Author

jxltom commented Oct 22, 2020

Hey @hardbyte thanks for your time for reviewing. I've already updated the PR according to the comments. Just let me know if there are more concerns. Thanks!

Copy link
Owner

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making all those changes this looks good to merge.

@mergify mergify bot merged commit e381a64 into hardbyte:develop Nov 16, 2020
@jxltom jxltom deleted the feature/gs-usb-support branch November 16, 2020 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants