raiden00pl opened a new pull request, #22227:
URL: https://github.com/apache/nuttx/pull/22227
## Summary
Fixes a regression from #21153 (commit 765f45385a, "drivers/serial/pty:
Set the terminal of the slave also through the master.").
The pty master maps CR to NL on write with its own OPOST | OCRNL flags.
Since that commit TCSETS sets the flags of the slave on both ends, so
nothing can clear the flags of the master any more. A raw mode set with
cfmakeraw() still changed 0x0d to 0x0a in the data written to the
master, which breaks binary protocols over a pty.
The data written to the master is the input of the terminal, so the
mapping belongs to ICRNL of the slave. This change does the mapping in
the read of the slave with ICRNL, which is now set by default, and
leaves only OPOST on the master.
## Impact
The default behavior is the same: CR written to the master is read as NL
on the slave.
A raw mode set through either end now turns the mapping off. A program
on the slave that clears ICRNL now reads CR as CR; before, the master
always changed it to NL.
TCGETS now reports ICRNL in c_iflag for a new pty.
## Testing
sim, binary serial protocol over /dev/pty0 with the slave in raw mode:
frames with 0x0d bytes were corrupted before the change and pass after.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]