Detect WebSerial parity errors
Categories
(Core :: DOM: Web Serial, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: gstoll, Assigned: gstoll)
References
Details
Attachments
(5 files)
Right now if the user sets ParityMode.even or ParityMode.odd Firefox doesn't actually detect parity errors. To implement this:
On Mac/Linux - we can set the PARMRK flag and then process the stream looking for the 0xff 0x0 pattern that indicates a parity error, and throwing a ParityError. This also means we have to look for 0xff 0xff (which is used to escape a 0xff byte that does not have a parity error) and remove one of the 0xff's. (Chrome does this with a CheckReceiveError decoder)
On Windows - we can call ClearCommError() to detect errors and throw a ParityError.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
|
||
Also do this for the new NS_ERROR_DOM_SERIAL_PARITY_ERROR nserror. This error
will get returned from parity decoders in parts 4 and 5.
| Assignee | ||
Comment 3•2 months ago
|
||
This just passes the flag along - the actual parity checking will
be done in platform-specific code in parts 4 and 5.
| Assignee | ||
Comment 4•2 months ago
|
||
On Windows, parity errors are reported through ClearCommError(), so add
a Win32SerialParityCheckStream stream wrapper that just calls that
and reports it when appropriate.
| Assignee | ||
Comment 5•2 months ago
|
||
On Mac/Linux, setting the PARMRK flag on a serial port will cause it
to parity check by returning 0xff 0x00 (plus one additional byte) in
case of an error. "regular" 0xff bytes then have to be escaped by
returning 0xff 0xff. The PosixSerialParityDecodeStream handles both
of these cases.
Also add some gtests for PosixSerialParityDecodeStream (that run on all
platforms)
Updated•1 month ago
|
https://hg.mozilla.org/mozilla-central/rev/3581d1b5998a
https://hg.mozilla.org/mozilla-central/rev/736e727307f2
https://hg.mozilla.org/mozilla-central/rev/a06c586f003f
https://hg.mozilla.org/mozilla-central/rev/c9cdda3b196a
https://hg.mozilla.org/mozilla-central/rev/84ea9e6cf653
Updated•23 days ago
|
Description
•