Skip to content
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

feat: add support for virtual can #198

Closed
wants to merge 1 commit into from

Conversation

ardrabczyk
Copy link
Contributor

I'm going to use it like that in an algorithm for auto-detecting CAN speed (I also need listen-only mode for that #174):

canInfo, err := d.Info()
if err != nil {
        return err
}

if canInfo.Type == candevice.VcanLinkType {
        log.Println("Type is vcan, cancel auto-detecting CAN speed")
        return nil
}

SetBitrate() and others don't have to changed, they will return netlink receive: operation not supported errors. Receive() and TransmitFrame() will continue working without any changes.

There are no tests, I thought I could add them to pkg/candevice/device_integration_test.go but nothing there uses vcan0 at this moment.

@ardrabczyk ardrabczyk requested a review from a team as a code owner September 6, 2023 09:20
@Edholm
Copy link
Member

Edholm commented Sep 13, 2023

Please have a look at the failing CI

@ardrabczyk
Copy link
Contributor Author

yeah I know that tests fail but IMO it should be fixed elsewhere because all builds fail since Sep 4 https://github.com/einride/can-go/actions and by the time when I pushed this PR they were already failing.

@Edholm
Copy link
Member

Edholm commented Sep 14, 2023

Yeah I noticed after I wrote. I will take a look. I suspect it is due to the Go version having been bumped to 1.21 :)

@Edholm
Copy link
Member

Edholm commented Sep 18, 2023

Should be fixed now. You can rebase on master :)

@ardrabczyk ardrabczyk closed this Sep 19, 2023
@ardrabczyk ardrabczyk deleted the support-Virtual-Can branch September 19, 2023 13:58
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.

2 participants