• C

modem question

How do I initialize a modem, recognize dial tone and finally
dial a number?
sassonAsked:
Who is Participating?
 
AlexVirochovskyCommented:
My example programm with OpenComm,...
Regards, Alex
0
 
rbrCommented:
Which modem. Normaly use can use the Hayes-commands. Look at your manual.
0
 
AlexVirochovskyCommented:
Wht is OS: Dos/Windows?
0
KuppingerCole Reviews AlgoSec in Executive Report

Leading analyst firm, KuppingerCole reviews AlgoSec's Security Policy Management Solution, and the security challenges faced by companies today in their Executive View report.

 
AlexVirochovskyCommented:
What is OS: Dos/Windows?
0
 
sassonAuthor Commented:
I Use C Language. How do I approach the port?  Recognize a dial tone.....
0
 
rbrCommented:
Which OS, which modem?
0
 
sassonAuthor Commented:
OS=Win95
Modem = regular analog modem
0
 
rbrCommented:
Is your modem HAYES compatible?
0
 
sassonAuthor Commented:
Yes. It is.
0
 
AlexVirochovskyCommented:
Write you EMail , i can send you example programm
read/write  of Modem
0
 
sassonAuthor Commented:
My email is elisa@orckit.com

Thanks in advance

Eli
0
 
Ready4DisCommented:
Look up bioscom in your help file, it gives you everything you need to make a simple modem program...

#include <bios.h>
#include <conio.h>
#include <iostream.h>

#define COM1       0
#define COM2       1
#define COM3       2
#define COM4       3
#define DATA_READY 0x100
#define TRUE       1
#define FALSE      0

#define SETTINGS ( 0xE0 | 0x02 | 0x00 | 0x00)

void put_one(char t)
{
      bioscom(1,t,COM1);
}

void put_line(char line*)
{
      int ctr;
      for (ctr=0;ctr<sizeof(line);ctr++)
            put_one(line[ctr]);
      put_one(13);
}

int main(void)
{
       int in, out, status, DONE = FALSE;
       char *number;
       bioscom(0, SETTINGS, COM1);
       cout << "What is the number:";
       cin >> number;
       put_line("+++");
       put_one('A');
       put_one('T');
       put_one('D');
       put_one('T');
       put_line(number);
       while (!DONE)
       {
                  status = bioscom(3, 0, COM1);
                  if (status & DATA_READY)
                         if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
                                    putch(out);
                         if (kbhit())
                         {
                                    if ((in = getch()) == 27)
                                           DONE = TRUE;
                                    bioscom(1, in, COM1);
         }
       }
       put_line("+++");
       put_one('A');
       put_one('T');
       put_one('H');
       return 0;
}
0
 
sassonAuthor Commented:
Thanks, but it wasn't what I was looking for.
Besides I got an answer.

regards Eli
0
 
AlexVirochovskyCommented:
In this case you must reject this answer.
I my example , that i have send you, OK, i write it as
reply.
Alex

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.