Solved

MODEM INTERFACE

Posted on 1998-08-14
6
338 Views
Last Modified: 2010-04-01
I wish to send files via modem (COM2). I use Visual C++ 5.0 under NT4.0. I know to send chars to RS232. But I don't know how to comunnicate with the modem to compose a phone number to send a file to an other distant machine. How can I use the S registers of the modem, and the AT commnands on a US robotic SPORTSTER MESSAGE plus (33600 x2)
Where can I find TAPI (Telephony API)documentation?
Note: I wish only use C functions and not C++ functions, it isn't a real windows application.
0
Comment
Question by:etep
6 Comments
 
LVL 6

Expert Comment

by:snoegler
Comment Utility
Take a look into the TAPI documentation (TAPI=Telephony API).
The TAPI contains many functions to access modem capabilities independent of the vendor
of your modem as long as it is installed correctly. For what purpose do you need access
to the 'S' registers?
( To set a value: ATS<number>=<value>,
  To get a value: ATS<number>?  are the usual ways to get/set the 'S' registers )
0
 

Author Comment

by:etep
Comment Utility
Edited text of question
0
 
LVL 6

Expert Comment

by:snoegler
Comment Utility
You should not edit the text of the question after someone has posted a comment or answer ...
It makes it hard for other experts to follow what has already been suggested. Just post a
comment with your changes, it is much better to understand.
To your question: The TAPI documentation is provided with your Visual C++ - just search
for TAPI and you'll get the information. You can use it with a 'console application' - i think that
is what you wanted ( or what did you mean with 'it isn't a real windows application'?)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:newexpert
Comment Utility
* Most modem's AT commands are standardised I think.
* DOS application ran under windows can assume they can "access com port directly".  Windows will route I/O through appropriate VxD. (ie do it as you were in DOS)
* TAPI documentation can also be download from ftp://ftp.microsoft.com/developr/TAPI/tapi14.zip It's a zip archive of a Word Document.

0
 

Author Comment

by:etep
Comment Utility
This zip archive only describe the new TAPI functions. Have you already use the TAPI functions? Where can I find sample or example?
0
 

Accepted Solution

by:
Forge earned 100 total points
Comment Utility
You said you had a routine to send chars to the modem (com2).
If the modem is not connected, the chars are interpreted by the modem chip as commands, the AT commands. To connect, send this:
(assuming your send routine is called Send():)
Send(COM2, "ATDT0123456789i\n");
Then it dials that number and tries to connect. THe modem sends back either "CONNECT ..." , "BUSY", "NO DIALTONE" or something.
If you receive a string "RING", that means someone is calling you,
You can then Send(COM2, "ATA"); to answer. And Send(COM2, "+++~~~ATH"); to hang up. And of course, to init the modem: Send(Com2, "ATZ");

That's all the commands you need. If you're connected, all chars you send will be sent to the other side, and not interpreted as commands. If you send "+++" and wait a sec ("~~~" is a delay) then the modem will get back into command mode but stays connected. Then you can send the "ATH" command to hang up.  If you want to get back online, just send ("ATO");

I wrote a BBS that use only these commands..
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now