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

SensirionShdlcTxFrame: In begin() why is _index not set to 0? #9

Open
Guswib opened this issue Oct 11, 2024 · 2 comments
Open

SensirionShdlcTxFrame: In begin() why is _index not set to 0? #9

Guswib opened this issue Oct 11, 2024 · 2 comments

Comments

@Guswib
Copy link
Contributor

Guswib commented Oct 11, 2024

Is there a reason why ìn the class SensirionShdlcTxFrame, the begin() function does not set the _index variable to 0?

As the _index is only set to 0 when the SensirionShdlcTxFrame is initialized and is private, it is not possible to make SensirionShdlcTxFrame global and reusable, which means I have to create new instantce everytime I want to use SensirionShdlcTxFrame.
As the protocol only seem to allow one frame at the time to be sent, I dont see the reason why begin does not set _index to 0 in the begin function.

@sdmueller
Copy link

Hi @Guswib

I don't think there is a specific reason for why the index does not get set to 0.
It was just not designed with reusability in mind.

You are however very welcome to create a pull request to make it reusable.

@Guswib
Copy link
Contributor Author

Guswib commented Nov 2, 2024

Just did a pull request

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

No branches or pull requests

2 participants