Question on toggling DTR for controlling non-terminal serial devices

daniel@schuler.net daniel@schuler.net
Tue, 17 Aug 2004 21:11:41 -0700 (PDT)


Hello,

I have a question about toggling DTR only once, unlike using the hangup command (CTRL-A H), which
clears and then sets DTR after a given time interval. My intent is to connect minicom to a
microcontroller, which uses DTR to switch between run and programming modes. Therefore, I need DTR
to be cleared (for run mode), and for the terminal to continue working while DTR is cleared.

I tried modifying m_dtrtoggle(), which appears to have several versions based on the OS in question.
The first version would make this easy enough (with TIOCSDTR), which appears to be for Sun Micro.
computers. However, I am running Linux, which uses the second version of the function (with
POSIX_TERMIOS). This version of the function toggles DTR somewhat indirectly, by setting the line
speed to 0 and the back to the previous state.

Unfortunately this won't work for me, since I need to be able to use the terminal with DTR cleared.
Now I'm wondering if there is a way to clear/set DTR under Linux without using the line-speed trick?
I've looked at POSIX terminal control, but that doesn't seem to do it (other than hardware flow
control, which is isn't what I need).

Any advice would be appreciated!
Sincerely,

    Daniel Schuler
    Cal State Long Beach, Micromouse Team