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

Handle re-opening a closed bus #107

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

henrik-nil-acc
Copy link
Contributor

Set address and _force_last to their initial values to be able to handle an open -> close -> open sequence.

Set address and _force_last to their initial values to be able
to handle an open -> close -> open sequence.
Copy link

sonarcloud bot commented Mar 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kplindegaard
Copy link
Owner

Hi @henrik-nil-acc. Just so I understand what the intent is: You want to keep the SMBus object alive also after a close(), I presume. Later, you open the bus again. Is it potential lack of setting the address on after subsequent open() call that causes problems for you?

@henrik-nil-acc
Copy link
Contributor Author

@kplindegaard, correct. I'm thinking it's a valid use-case and from the existing code in close() it looks like it might been intended to be supported since self._pec is set to it's initial value.

@kplindegaard
Copy link
Owner

Fair point, thanks.

@kplindegaard kplindegaard self-requested a review March 25, 2024 18:37
@kplindegaard
Copy link
Owner

@henrik-nil-acc I'm on holiday but will make a new patch version soon.

@kplindegaard kplindegaard merged commit a7bede7 into kplindegaard:master Mar 25, 2024
9 checks passed
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