Ptacek wrote to [EMAIL PROTECTED] and [EMAIL PROTECTED]:

> Hi,  I am currently writing a program that will use an attached 
> modem to dial and connect to a remote site to gather data.  I
> have been able to dial, connect, send data back and forth, but
> I just can't seem to get the modem to hangup.  I probably have
> to bring the DTR low (+++ATH<CR> 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?  
> 
>  Thanks,
>    Chris

Hayes-compatible modems require a 1 or 2 second delay in between the +++
escape and the command.  Sleep for 2 seconds before issuing any commands.

The "NO CARRIER" is a message intended mainly for the terminal user to
see.  You should never attempt to parse messages like that.  Instead, you
should detect carrier in the hardware.

-- 
  Ryan Thompson <[EMAIL PROTECTED]>
  Systems Administrator, Accounts
  Phone: +1 (306) 664-1161

  SaskNow Technologies     http://www.sasknow.com
  #106-380 3120 8th St E   Saskatoon, SK  S7H 0W2



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to