I'm trying for the first time to make a small program to access a modem
on a tty.
I thought the flow control was handled by the tty-driver, but now
I realize that I probably have to do some flowcontrol. But *HOW* do I do that?
This is basically the code in C which I have coded so far:
if((fd = open(tty,O_EXCL|O_RDWR))>0)
lockStruct.l_type = F_WRLCK;
lockStruct.l_whence = SEEK_SET;
lockStruct.l_start = 0;
lockStruct.l_len = 0;
if(fcntl(fd,F_SETLKW,&lockStruct) == -1)
t.c_iflag = IGNBRK|IGNPAR|IXANY;
t.c_oflag = 0;
t.c_cflag = B1200|CS8|CREAD|HUPCL;
t.c_lflag = 0;
t.c_cc[VMIN] = 0;
t.c_cc[VTIME] = TIMEOUTVAL;
WritePort(fd,"AT&F&D0E0B0S0=2X3\r",slow); /* Do pauses between characters */
This is all i write or read from the port.
When I run this, all I get is \r\nOK\r\n and then \r\nNO CARRIER\r\n from the modem.
When I use Pcomm or ate i get CONNECT 1200.
I've compiled the program with cc under AIX 3.2 on an RS/6000.
The modem is a 2400 Hayes-modem.
I was told that the init. string for the modem was right, but
how about the rest?
What am I doing wrong? What do I have to add?
Thanks in advance!
| mail : Birkebeinervg. 6
The Norwegian Institute of Technology | N-7031 TRONDHEIM
| phone: +47 73 59 29 72 (work)
(Confuser Science) | +47 73 94 18 44 (home)
"I believe OS/2 is destined to be the most important operating
system, and possible program, of all time." - Bill Gates, 1987