On Sun, Sep 28, 2003 at 10:27:15AM -0700, Srinivas S wrote:
> Hello,
>  
>             I want to program my external modem for communication. If
> anyone could tell me how i could go abt it or send a sample program in
> C/C++, how to program an external modem on a serial port, to initialize
> it and dial a number, it would be of great help.

Srinivas:

You've got two related but different issues here.

The first is how do control the serial port from a C or C++ program,
the second is how to control the modem.

The first is pretty much like any Unix system. There is a HOWTO for
serial programming on Linux, I suggest you look at the HOWTO documents
on your distribution, or check out the LDP (Linux Documentation Project)
for their HOWTO pages.

Regarding programming the modem, you need to know its commandset and 
the responses it sends, so you can (having written the lower-layer
code to handle the serial port) then send it the desired commands
and parse its responses for correctness. Unfortunately, every modem,
even those that proclaim "Hayes Compatible" has its own slightly
incompatible set of commands, so you need the correct documentation
for the exact modem you have, or the one you intend as your program's
target.

Fred
-- 
---- Fred Smith -- [EMAIL PROTECTED] -----------------------------
  "And he will be called Wonderful Counselor, Mighty God, Everlasting Father,
  Prince of Peace. Of the increase of his government there will be no end. He 
 will reign on David's throne and over his kingdom, establishing and upholding
      it with justice and righteousness from that time on and forever."
------------------------------- Isaiah 9:7 (niv) ------------------------------

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to