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

How to set and clear the break bit #46

Open
dignifiedquire opened this issue Nov 21, 2024 · 1 comment
Open

How to set and clear the break bit #46

dignifiedquire opened this issue Nov 21, 2024 · 1 comment

Comments

@dignifiedquire
Copy link

I need to set and clear the break bit, which should be possibl on linux at least using TIOCSBRK and TIOCCBRK

Asfaict this is not exposed, but could be through the internal set_pin functionality

References

@de-vri-es
Copy link
Owner

de-vri-es commented Nov 25, 2024

Hey! Thanks for reporting the issue.

Currently you can not force a break condition using serial2. I think this definitely needs to be fixed.

However, there is no break "bit". A break condition is when a transmitter holds it's line in a logical 0 state for more than a whole byte.

We have a few options to model this. One is to have a function to hold the line in break condition for a given amount of time. Advantage is that it's hard to mis-use. You won't accidentally hold the line in break condition, since the function itself will clear it.

But such a function would also block the current thread, which is a bit of a waste. So toggling the break condition on/off might be a better API.

However, keep in mind that the API needs to be possible on Windows too.

I see you started on a PR already. Would you like to continue with that? :)

/edit: Windows has SetCommBreak and ClearCommBreak

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