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

Add support for virtual can #197

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 08:48
Copy link
Member

@Edholm Edholm 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 the contribution 💯

@Edholm
Copy link
Member

Edholm commented Sep 6, 2023

Please change your commit message to follow conventional commit style

@ardrabczyk
Copy link
Contributor Author

Sorry, should have run make before pushing. One test still fails though.

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