Date: Sat, 26 Feb 2000 01:32:02 +0100 (CET) From: Juergen Lock <nox@jelal.kn-bremen.de> To: ptacek@dashmail.net Cc: <freebsd-hackers@FreeBSD.ORG>, <freebsd-questions@FreeBSD.ORG> Subject: Re: modem program... Help Message-ID: <200002260032.BAA12178@saturn.kn-bremen.de> In-Reply-To: <200002252012.VAA04133@saturn.kn-bremen.de> References: <Pine.BSF.4.21.0002241741310.17368-100000@boris.netgate.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Forgot something: In article <200002252012.VAA04133@saturn.kn-bremen.de> i wrioe: >Well the normal `unix' way to watch for CD is to turn off CLOCAL, >then you'll get a SIGHUP when the modem loses its connection. >(thats where that signal's name comes from, hangup. people have >dialed into unix boxes over modems long before the internet got >popular...) and to drop DTR you just do the equivalent of a `stty 0'. Or close the tty's fd... and if you don't want it to hang up (drop DTR) on close you reset HUPCL (tho usually thats just what you want.) also note how this means that `ordinary' programs like the login shell don't need to be aware that they're running on a modem line, when the user leaves them the tty driver will tell the modem to hang up and when the connection drops for whatever reason before the user left his shell/program it'll be killed/notified by the SIGHUP. And if you want some examples of modem handling or how to wait for CD to come on or how to portably do serial io efficiently look at uucp (especially /usr/src/gnu/libexec/uucp/libunix/serial.c), or another interesting one may be mgetty (/usr/ports/comms/mgetty+sendfax), that (unlike a `normal' getty) even interprets the modem messages and chats with the modem to be able to handle non-data calls too (i.e. faxes or voice, and if i remember right on some modems it will even get the caller id info...) HTH, -- Juergen Lock <nox.foo@jelal.kn-bremen.de> (remove dot foo from address to reply) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002260032.BAA12178>