From: tonyblaha AT juno DOT com To: djgpp AT delorie DOT com Subject: modem help Message-ID: <19981010.141012.7911.0.tonyblaha@juno.com> X-Mailer: Juno 1.49 X-Juno-Line-Breaks: 12-26,28-41 Date: Sat, 10 Oct 1998 15:13:06 EDT Reply-To: djgpp AT delorie DOT com I've written the following program to send a string to the modem (COM2 on my computer), but it only works some of the time. It compiles okay with no errors, but doesn't work when I try to run it. But then if I use a comm program like telix (for dos), then try to use the program, it works fine _once_, but the next time I use it, it doesn't work again. The program sends an "ATDT..." string to the modem followed by a "\r". Afterwards, it lets you pick up the phone and press a key before it sends another "\r" to the modem to cut it off. I've tried the program with and without the "fflush(modem);" statements, and I've also tried to initialize the modem with "fputs("ATZ\r", modem);", but none of the that works. From the fact that it works one time after I use telix, I thought that maybe it wasn't being initialized right, but as I've said, I tried using "ATZ\r" which is the same init string telix uses... help? #include int main() { FILE *modem; modem = fopen("COM2", "wb"); if(modem == NULL) { printf("ERROR\n"); exit(0); } printf("Dialing 682-8151...\n\n"); /* the # for the local weather recording */ fputs("ATDT 6828151\r", modem); fflush(modem); printf("Pick up phone and press any key...\n"); getch(); fputs("\r", modem); fflush(modem); fclose(modem); } ___________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com or call Juno at (800) 654-JUNO [654-5866]