Skip to content

Fix non-functional USB2CAN interface backend #534

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 1 commit into from
Mar 15, 2019

Conversation

acolomb
Copy link
Contributor

@acolomb acolomb commented Mar 14, 2019

During the refactorization and cleanup in #511, something slipped the review process. I only got to testing on hardware with an actual CAN bus connected today and nothing worked.

Apparently the returned handle from CanalOpen() needs to be saved in a backend-local .handle member for all other API functions to use. With all the confusion about CANAL API return values, the return statement for this got removed by accident.

The internal reference for an opened interface via the CANAL API is
returned as an integer from the CanalOpen() DLL call in
Usb2CanAbstractionLayer.open().  It is supposed to be returned from
the abstraction layer and stored in the Usb2canBus.handle member for
later reference by all other API calls.

Add the missing return statement and adjust the docstring
accordingly.  Only valid handles (greater than 0) will be returned,
otherwise an exception is thrown already.
@felixdivo
Copy link
Collaborator

Ha. That was rather dumb. ^^ Thanks for testing it!

@acolomb
Copy link
Contributor Author

acolomb commented Mar 14, 2019

@felixdivo Would you mind merging this rather quickly? I'd like to update my submodule reference today if possible ;-)

@felixdivo
Copy link
Collaborator

Yep, I'm just waiting for the AppVeyor build to pass.

@codecov
Copy link

codecov bot commented Mar 14, 2019

Codecov Report

Merging #534 into develop will decrease coverage by 0.01%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##           develop     #534      +/-   ##
===========================================
- Coverage    64.46%   64.44%   -0.02%     
===========================================
  Files           63       63              
  Lines         5650     5651       +1     
===========================================
  Hits          3642     3642              
- Misses        2008     2009       +1

@felixdivo felixdivo merged commit 6090e94 into hardbyte:develop Mar 15, 2019
@acolomb
Copy link
Contributor Author

acolomb commented Mar 15, 2019

Thanks!

@acolomb acolomb deleted the usb2can-fix-missing-handle branch March 15, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants