Date: Tue, 9 Sep 1997 01:03:42 -0700 From: John-Mark Gurney <gurney_j@efn.org> To: Jaye Mathisen <mrcpu@cdsnet.net> Cc: hackers@FreeBSD.ORG Subject: Re: How the heck do you drop DTR? Message-ID: <19970909010342.45615@hydrogen.nike.efn.org> In-Reply-To: <Pine.NEB.3.95.970908231659.8638B-100000@mail.cdsnet.net>; from Jaye Mathisen on Mon, Sep 08, 1997 at 11:33:12PM -0700 References: <Pine.NEB.3.95.970908231659.8638B-100000@mail.cdsnet.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Jaye Mathisen scribbled this message on Sep 8: > > Taking my ppp problem /modem interaction to its illogical extreme, I > hacked up a simple modem dialler test system under perl5. > > It works OK, after having to define some constants like CCTS_IFLOW and > CRTS_OFLOW that for some reason the POSIX module for perl5 doesn't define. > > However, for the life of me, I can't figure out how to actually drop > DTR. > > I thought closing the file handle would do it, but it doesn't, after > my program exits, the modem is still on-line, and DTR is still > asserted. wierd... assuming that all file descriptors to the modem is closed, DTR should drop... > I've looked through the termios.h include file, and can't even find > any kind of constant that may have something to do with it. what you need to do is set the speed to B0.. this will tell the modem to stop asserting DTR... > Looking at the source for ppp, there's something in a HangupModem() > function about setting the baud rate to 0. It looks like this > does the trick, but I'm not sure it's the "right" way to do it. yup.. this is the right way to do it... a bit of useful information from Advanced Programming in the Unix Environment (Stevens): "The constant B) means "hangup." When B0 is specified as the output baud rate when tcsetattr is called, the modem control lines are no longer asserted." ttyl.. -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970909010342.45615>