DCD may be programmed as input <<OR>> output?

Hi there,

I'm monitoring/setting the RS232 status line DCD by the ioctl (sioControlStatusHandle, TIOCMGET, &sioControlInfo) and ioctl (sioControlStatusHandle, TIOCMSET, &sioControlInfo) commands.

What I don't understand is the question how the Linux-driver recognizes whether I'm programming a modem or a terminal, i.e. whether the DCD-signal acts as an output (setting/writing the TIOCM_CD - bit as a modem) or as an input (getting/reading the TIOCM_CD - bit as a terminal). Actually I'm programming a modem.

The serial device was opened by sioHandle = open (devString, O_RDWR | O_NONBLOCK | O_NOCTTY);

Thanks for your help!

Olaf

Reply to
ergo
Loading thread data ...

There is, per channel on a UART, one DCD line. It is an *input* to the UART.

For asynchronous operation, other modem control inputs are RI, DSR, and CTS; and modem control outputs are DTR and RTS.

On a standard PC, running Linux and using the standard serial port driver, the UART's DCD input is connected to put 8 of a 25 pin serial port connector. Hence when you read the DCD line, you see the status of what is connected to it. Attempting to set it is meaningless, and does nothing in the serial driver.

On the other hand... if you are writing firmware for a modem, it all depends on what signal from the UART is connected to pin

8 on the connector! Obviously a standard modem does *not* connect the UART's DCD line to pin 8 (generally that would either be the UART's DTR line or a separate signal generated external to the UART).
--
Floyd L. Davidson           
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com
Reply to
Floyd L. Davidson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.