pl2303.c and the pin status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently if we want to read the status of the PINs on a serial port, I need to open the file (e.g. /dev/ttyUSB0) unfortunately in doing so we *change* RTS/DTR

How difficult would it be to extent the usb_serial driver to expose the pin status like this:

/sys/class/tty/ttyUSB0/device/RTS (rw, Request To Send)
/sys/class/tty/ttyUSB0/device/CTS (r,  Clear To Send)
/sys/class/tty/ttyUSB0/device/DSR (r,  Data Set Ready)
/sys/class/tty/ttyUSB0/device/DCD (r,  Data Carrier Detect)
/sys/class/tty/ttyUSB0/device/DTR (rw, Data Terminal Ready)
/sys/class/tty/ttyUSB0/device/RI  (r,  Ring Indicator)

We could then simply read the file /sys/class/tty/ttyUSB0/device/DCD and get a 1 if it is high.

We could also control RTS/DTS by using something like:
echo 1 > /sys/class/tty/ttyUSB0/device/DTR

I realize that if we LIMIT our usage of the serial port to ONLY serial communication then there is not value is this extension. But the moment you start using it to drive DIY electronics it would be a VERY welcomed addition.

Thanks,
Gérald


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux