From owner-freebsd-questions Thu Feb 24 21: 3:30 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guppy.pond.net (guppy.pond.net [205.240.25.2]) by hub.freebsd.org (Postfix) with ESMTP id E005937B58B; Thu, 24 Feb 2000 21:03:23 -0800 (PST) (envelope-from ptacek@dashmail.net) Received: from Ptacek (rc1s7p8.dashmail.net [216.36.33.80]) by guppy.pond.net (8.9.3/8.9.3) with SMTP id UAA16263; Thu, 24 Feb 2000 20:48:45 -0800 (PST) Message-ID: <015201bf7f4d$ac963e00$0301a8c0@Ptacek> From: "Ptacek" To: , References: Subject: Re: modem program... Help Date: Thu, 24 Feb 2000 21:03:36 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks to all that replied... I have the +++ <2sec. delay>ATH working. I guess my only question now is how do I access the DTR, CD, etc signals from my code. Is there an example somewhere? I have looked through the termios man file but couldn't find anything? - Chris ----- Original Message ----- From: wellsian To: Daniel O'Connor Cc: Ptacek ; ; Sent: Thursday, February 24, 2000 6:11 PM Subject: RE: modem program... Help > You have to control and respond to state changes yourself. There is no > "backchannel" available to tell you what's going on. More directly, there > is no way to know if the modem is in command or data mode without keeping > an eye on the data stream and handshake lines, sometimes injecting your > own data to test the situation. In the case you brought up, you could only > reliably know about the disconnect if you watch the CD line. You can > certainly make your code smart, to look for delicate combinations like "NO > CARRIER" but it gets annoying if you don't have to do it. > > If you have reasonable control over of the installation, the modem, and > use of the software, say for a limited project, then you can write your > code to rely on DTR/DSR/CD (and maybe RI) for most needs. This will > give you the most reliable control, assuming you configure the modems > properly and that they handle the lines correctly (not all do). > > Most commercial software uses both a configurable set of hardware lines > and modem definition files describing modems' responses to commands and > state changes. This is because the author rarely has any control over the > type of modem. And often, the cable or other elements of the install > aren't trustworthy. Writing a program for this environment - one that > works reliably across a wide range of modems - can be quite difficult and > usually results in "Yet Another Modem Control Language". :) If you have > the choice, go for hardware control. It's the closest thing you have to a > backchannel, and it removes a large portion of the guessing involved in > automating modem connections. What remains is sending dial commands and > recognizing a few "OK, BUSY, etc." messages. Much simpler. > > Been there...good luck. > > Dave > > On Fri, 25 Feb 2000, Daniel O'Connor wrote: > > > > > On 25-Feb-00 Ptacek wrote: > > > I just can't seem to get the modem to hangup. I probably have > > > to bring the DTR low (+++ATH doesn't work). How > > > do I do this? Also how can I detect if the modem is in > > > command mode, for example if the line gets unplugged and I > > > get a NO CARRIER back how do I know to read that as a > > > command instead of data? > > > > Your '+++ATH0' won't work because there is no delay between the +++ and the > > ATH0. ie do '+++' wait 2 seconds then send 'ATH0' > > > > Or you could set the modem to go into command mode on DTR drop.. > > > > --- > > Daniel O'Connor software and network engineer > > for Genesis Software - http://www.gsoft.com.au > > "The nice thing about standards is that there > > are so many of them to choose from." > > -- Andrew Tanenbaum > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message