Overview
| Artifact ID: | d5813a1390c6cf5237e41184bfc86760fbfa34f3ddd5c97e1e679fcfbade50ac |
|---|---|
| Ticket: | ea53aa804d4ef48bddf9e20869231d7017331b74
[Serial port] Ignore BREAK condition on read |
| User & Date: | serhiy.storchaka on 2026-10-14 18:48:19 |
Changes
- icomment:
On Windows a serial error such as BREAK is reported by one <nowiki>[read]</nowiki> as an I/O error, with the details in <code>fconfigure $chan -lasterror</code>, and then cleared; the data in the queue is not discarded. So you can catch the error and read again: <verbatim> if {[catch {read $rh} data] && "BREAK" in [fconfigure $rh -lasterror]} { set data [read $rh] } </verbatim> - login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Invalid"
- status changed to: "Closed"