Date: Fri, 6 Dec 1996 15:59:18 +1100 From: Bruce Evans <bde@zeta.org.au> To: brandon@glacier.cold.org, mtaylor@cybernet.com Cc: hackers@freebsd.org Subject: RE: Help! Turning off DTR on a serial device Message-ID: <199612060459.PAA10852@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>There is an IOCTL for it. >Look in /usr/include/sys/ttycom.h for TIOCSDTR (set DTR) and TIOCCDTR (clear DTR). There's also TIOCMSET, etc. which can be used to change the other modem control bits. None of these work right for DTR, because: >The only problem youu will find with it is that the DTR is set when you change your >baud rate. There is an 'if' statement in the baud changing code in the kernel's sio >driver which checks if the baud is non-zero, then the DTR will be set. > >So, you can set your baud rate, turn off your DTR, but don't chang your baud rate >again! It will turn ON the DTR (if the new baud rate is not zero). This is why DTR should be controlled using tcsettattr() instead of the old ioctls. Set the output speed to B0 to turn DTR off. Keep it as B0 to keep DTR off. Set it back to the actual speed to turn DTR on. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612060459.PAA10852>