Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!ncrlnk!ncr-sd!crash!news From: news@crash.cts.com (Usenet News) Newsgroups: comp.sys.amiga Subject: C Help Message-ID: <4552@crash.cts.com> Date: 3 Jul 89 11:26:55 GMT Organization: Crash TS, San Diego, CA Lines: 210 Ok, this is my first post to the net.....Lesse if this works... Oh, and this is a ----PROGRAMMING PROBLEM---- abort if you aren't interested Following is a short program I wrote that supposedly will send stuff to the modem. Kind of a Very Dumb Terminal program. Everything seems to work fine (the Modem Ready light comes on and when I type something the Send light flashes). But if I were to send ATZ or ATDT5551212, nothing happens. The modem doesn't reset or dial or nutin'. H E L P!!!!!! /*** Modem.C Modem Control Program */ #include #include #include #include #include #include #include #include #include extern struct MsgPort *CreatePort(); struct IOExtSer *mySerReq, *mySerWriteReq; main() { LONG error, i; struct MsgPort *mySerPort, *mySerWritePort; BYTE *b, *c; char GetData[100], SendData[100]; mySerPort = CreatePort("mySerial",0); if(mySerPort==NULL) exit(100); mySerReq = (struct IOExtSer *)CreateExtIO(mySerPort,sizeof(struct IOExtSer)); if(mySerReq==NULL) goto cleanup1; mySerReq->io_SerFlags = 0; error = OpenDevice("serial.device",0,mySerReq,0); if(error !=0) goto cleanup2; mySerWritePort = CreatePort("mySerialWrite",0); mySerWriteReq = (struct IOExtSer *)CreateExtIO(mySerWritePort,sizeof(struct IOExtSer)); b=(BYTE *)mySerReq; c=(BYTE *)mySerWriteReq; for(i=0;iIOSer.io_Message.mn_ReplyPort = mySerWritePort; GetData[0] = '\0'; while(GetData[0] != '*') { printf("Enter Text to Send to Modem...\"*\" to end\n"); scanf("%s",&GetData); sprintf(SendData,"%s\n\000",GetData); WriteSer(SendData); } cleanup2: CloseDevice(mySerReq); CloseDevice(mySerWriteReq); cleanup1: DeletePort(mySerWritePort); DeletePort(mySerPort); } WriteSer(modemdata) char *modemdata; { int error; mySerReq->io_Baud = 1200; mySerReq->io_StopBits = 1; mySerReq->io_ReadLen = 7; mySerReq->io_WriteLen = 7; mySerReq->IOSer.io_Data = (APTR)modemdata; mySerReq->IOSer.io_Length = -1; mySerReq->IOSer.io_Command = CMD_WRITE; if((error = DoIO(mySerReq)) != 0) { printf("Serial.Device write error &ld \n",error); } return(error); } Please, bear with me. I am one of those "Teach yourself C" guys. If it's a stupid answer, please send it to me anyway! All this is from the oh-so-accurate CA books (first edition). And I'm using a 1000 with a 2400 baud hayes-compat modem and 2 floppies (just in case anyone cares). SORRY THIS IS SUCH A LONG POST!!!! (modified) ====================================[+][-] | UUCP: crash!pro-graphics!RogerG | | | InterNet: crash!RogerG@pro-graphics.cts.com | | | ARPA/DDN: crash!pro-graphics!RogerG@nosc.mil | | |___________________________________________________________________________X|