Fixes for Linux and POSIX speed interfaces; support "sane" termios systems#24
Fixes for Linux and POSIX speed interfaces; support "sane" termios systems#24hpax wants to merge 3 commits intosigrokproject:masterfrom
Conversation
In case the serial port was already set up with split speed, using one of the standard speed constants (i.e. not BOTHER) it is necessary to clear CIBAUD to revert back to single speed. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
POSIX is pretty clear that if only one speed is supported, it is the output speed setting that counts. On some platforms, the input speed can even end up being reported as 0 for single speed configuration. Thus, look at the output speed setting, not the input speed setting. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
If termios speed_t is a direct mapping to bauds, it is presumably safe to assume that it can be used as a generic interface. This applies to Linux with glibc 2.42+, GNU Hurd, and at least some BSDs. Try to detect this case and if so, do the simple thing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
I regularly use gtkterm to send commands to a serial device. On the latest version of Fedora (43), there is no communication. I don't know if the command is being sent or if the response is not being received. I recreated the gtkterm profile, but the problem persists. This could be related to changes made to termios in glibc 2.42 that were integrated into Fedora 43.
|
This is not related to libserialport as gtkterm doesn't use it; you should file a bug report to the appropriate plate for gtkterm or to the Fedora bugzilla. You can use stty to verify or adjust the serial port parameters; the stty in Fedora 43 is aware of arbitrary baud rates and split speed. |
I ran into a problem with libserialport on Fedora 43 beta, which
includes glibc 2.42 which updates termios to actually handle arbitrary
speeds.
The first patch contains the fix for that problem (must clean CIBAUD.)
The second patch contains a fix for reading the current speed: per
POSIX, if only one speed is supported, it is the output speed that
counts, not the input speed.
The third patch contains machinery to detect if termios.h Bxxx
constants are identity mapped, and if so, simply uses them as numbers
-- which is of course what they should have been from the start.