Re: Re: modem communication (fred smith)

Robert Brown <[email protected]> Mon, 8 Dec 2003 11:29:13 -0600 (CST)
Newsgroups gmane.linux.redhat.ppp,gmane.linux.redhat.general
Message-ID <[email protected]>
srinath c writes:
 > 
 > hi,
 > 
 > The communication is taking place with modems on either side.  I'm
 > using nothing but system calls along with Hayes AT commands.  No other
 > utility is being used.  It a program written in c++.  Kindly help.

If your local program issues a system call to disconnect the line,
your rs-232 hardware should drop the CD line (data terminal ready) to
the local modem.  Unless you have your modem configured in a weird
way, this will cause it to hang up the phone.  This, of couse, causes
the modem at the other send to stop seeing the carrier on the line.
After a time-out of several seconds, the remote modem should hang up.
When it does, it will drop the data set ready line to the remote
computer's rs-232 port.  This should cause the remote rs-232 serial
driver to raise a SIG-HUP signal to the program that had the port
open.  The remote program will terminate on the SIG-HUP unless you
have installed a signal handler to cause it to do otherwise.
Typically, such a handler would close files and clean up before
exiting.