You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.IO.Ports.SerialPort has a property "ParityReplace" which, according to docs, controls how bytes with parity errors are replaced. The docs also state that settings this value to "0" disables replacement and simply accepts even invalid bytes.
This behaviour is important when dealing with low-level serial communication where parity bits are sometimes used as signal bits to wake up devices.
On Linux, this property has no effect since it is not implemented in the source code, which does not match the documentation.
A serial device using Parity.Mark behaviour for indicating the begin of new messages is required to test this.
Expected behavior
Assuming the same input on windows and linux, the same output is expected.
Actual behavior
On Windows, it works as expected, on Linux, all start bits (with the parity bit set to 1) are considered as invalid and are not shown.
Regression?
No response
Known Workarounds
No response
Configuration
NET 9.0
Windows 11 (x64), Debian Bookworm (arm64) (both with latest patches)
Other information
The problem is caused by the ParityReplace property being ignored in the linux source code.
To implement the correct behaviour (or at least the partial correct behaviour which would allow to ignore parity errors) it may be sufficient to add a new parameter to the native methods that sets the IGNPAR flag on the termios struct and set that based on the value of ParityReplace.
The text was updated successfully, but these errors were encountered:
Description
System.IO.Ports.SerialPort has a property "ParityReplace" which, according to docs, controls how bytes with parity errors are replaced. The docs also state that settings this value to "0" disables replacement and simply accepts even invalid bytes.
This behaviour is important when dealing with low-level serial communication where parity bits are sometimes used as signal bits to wake up devices.
On Linux, this property has no effect since it is not implemented in the source code, which does not match the documentation.
Reproduction Steps
A serial device using Parity.Mark behaviour for indicating the begin of new messages is required to test this.
Expected behavior
Assuming the same input on windows and linux, the same output is expected.
Actual behavior
On Windows, it works as expected, on Linux, all start bits (with the parity bit set to 1) are considered as invalid and are not shown.
Regression?
No response
Known Workarounds
No response
Configuration
Other information
The problem is caused by the ParityReplace property being ignored in the linux source code.
To implement the correct behaviour (or at least the partial correct behaviour which would allow to ignore parity errors) it may be sufficient to add a new parameter to the native methods that sets the IGNPAR flag on the termios struct and set that based on the value of ParityReplace.
The text was updated successfully, but these errors were encountered: