简体   繁体   中英

Set serial port flow control lines from bash script?

Is it possible to manually control the handshaking/flow control lines of a serial port from a bash script? I'm referring to RTS, CTS, DTR and DSR. I don't want to enable automatic flow control, but manually manipulate these signals. In my application, those lines control LEDs. I've seen C code to do this using IOCtl(), but am wondering if it is possible via bash?

There were no responses here and I couldn't find anything else on the web. So I decided to write my own C program I could call from bash. It was actually quite simple to control the handshaking lines via C - just an open() and a couple of ioctl() calls. See https://www.cmrr.umn.edu/~strupp/serial.html#5_1 if you are interested in the details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM