Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TIOCM_OUT1, TIOCM_OUT2, and TIOCM_LOOP constants to termios #127335

Open
rruuaanng opened this issue Nov 27, 2024 · 1 comment · May be fixed by #127336
Open

Add TIOCM_OUT1, TIOCM_OUT2, and TIOCM_LOOP constants to termios #127335

rruuaanng opened this issue Nov 27, 2024 · 1 comment · May be fixed by #127336
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@rruuaanng
Copy link
Contributor

rruuaanng commented Nov 27, 2024

Feature or enhancement

Proposal:

This issue suggests adding new termios constants.

TIOCM_LOOP


example:

int fd = /* /dev/ttyS0 */
int status = /* modulator status */
status |= TIOCM_LOOP;

ioctl(fd, TIOCMSET, &status);
/* subsequent 'write()' will send data to 'fd' instead of the remote terminal device */

It's used to enable the serial port loopback mode, that is, the local tx will send messages to the local rx instead of the external device

TIOCM_OUT1
TIOCM_OUT2

It's suitable for the physical characteristics of the terminal equipment, such as interrupt and chip select output

for example, a library like this uses.

https://github.com/makerbot/pyserial

ref:
https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/termios.h

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@rruuaanng rruuaanng added the type-feature A feature request or enhancement label Nov 27, 2024
@picnixz picnixz added the extension-modules C modules in the Modules dir label Nov 28, 2024
@erlend-aasland erlend-aasland changed the title Add latest termios constants Add TIOCM_OUT1, TIOCM_OUT2, and TIOCM_LOOP constants to termios Nov 29, 2024
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Nov 29, 2024

This issue suggests adding new termios constants.

Which constants? What do they do? Why are you proposing to add these flags? Always explain proposed changes in detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants