Hi,
I have a simple program to dial out via a hayes modem. When run, the
modem RD and TD lights blink showing that it receives the dial string
from the program but doesn't really dial out.
Here is the relevant piece of code. Any help is appreciated.
Thanks
Atiq
-------------------------------------
void sttyModem(int fd)
{
struct termio tbuf;
if (ioctl(fd, TCGETA, &tbuf) < 0 )
cerr << "ioctl(TCGETA) failed; errno = "<< errno << endl;
tbuf.c_iflag = IXON | IXOFF | ISTRIP | IGNBRK | IGNPAR;
tbuf.c_oflag = 0;
tbuf.c_lflag = 0;
tbuf.c_cflag = B300 | CS7 | CREAD | HUPCL | PARENB;
tbuf.c_cc[4] = 1; // MIN
tbuf.c_cc[5] = 0; // TIME
if (ioctl(fd, TCSETAF, &tbuf))
cerr << "ioctl(TCSETAF) failed; errno = "<< errno << endl;
main()Quote:}
{
int tty_fd;
tty_fd=open(....) etc.
sttyModem(tty_fd);
char *str="ATDT91(800)222-3333\r"; //some number
char ss[10];
write(tty_fd, str, strlen(str));
read(tty_fd, ss, 1);
// other code..........
exit(0);
Quote:}