Repository navigation
Add break support - #148
Open
Happyfield7 wants to merge 2 commits into
Open
Happyfield7 wants to merge 2 commits into
Happyfield7 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #148 +/- ##
==========================================
+ Coverage 94.38% 94.59% +0.20%
==========================================
Files 25 25
Lines 4437 4532 +95
==========================================
+ Hits 4188 4287 +99
+ Misses 249 245 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Happyfield7
force-pushed
the
add-break-support
branch
from
November 20, 2026 19:04
26c83c9 to
85d7f31
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A break holds the TX line low for longer than one character, which writing data cannot do. Devices and serial buses use it as a signal outside the data stream: to wake or reset the other side, or to mark where a frame starts. serialx cannot send one yet, so pyserial code that calls
send_break()or setsbreak_conditionfails on serialx andserialx-compat.Change
BaseSerialgainsbreak_condition,set_break_condition()andsend_break(duration=0.25)with pyserial's names;BaseSerialTransportandAsyncSerialgain asyncset_break_condition()andsend_break().TIOCSBRK/TIOCCBRK. Python'stermioslacks them, so the numbers are hardcoded per platform (generic Linux, BSDs and Linux SPARC);ENOTTYraisesUnsupportedSetting.SetCommBreak/ClearCommBreak, RFC 2217 sendsSET_CONTROLbreak on/off, and Web Serial usessetSignals({break}).UnsupportedSetting.close(). A cancelled asyncsend_break()releases the break.Testing
NO_BREAKquirk for socket and ESPHome), mocked ioctl and Win32 tests, async cancellation and close tests, and compat tests.ruff,mypy,pylintorcodespell. The com0com pair tests were not run locally.00byte and the line returns to normal afterwards, on Linux, macOS and Windows.