Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!mit-eddie!mit-amt!media-lab.media.mit.edu!smd From: smd@media-lab.media.mit.edu (Steve Drucker) Newsgroups: comp.sys.mac.programmer Subject: Re: Serial Port problem Message-ID: Date: 19 Feb 90 19:09:50 GMT References: Sender: smd@mit-amt.MEDIA.MIT.EDU Distribution: usa Organization: Media Lab Lines: 41 In-reply-to: smd@media-lab.media.mit.edu's message of 19 Feb 90 18:11:36 GMT Can anyone tell me why the following code fragment causes the Mac to hang until I pull out the cable that is connecting the mac to the other computer? One other strange symptom....if I run Red Ryder in the background afterwards, this code fragment works....so what am I setting up wrong??? It's in Think C, and I'm just trying to write some stuff out the serial port. (I'd like to hear of the best way to do this too.) #include #include main() { int i, parm, errno; long int length; char astring[80]; errno = RAMSDOpen(sPortA); if (errno != noErr) printf("problem opening serial port\n"); parm = baud19200; errno = SerReset(AoutRefNum, parm | data8 | stop20 | noParity); if (errno != noErr) printf("problem setting up serial out\n"); for (i=0;i<10;i++) { sprintf(astring, "count: %d\n",i); length = (long)strlen(astring); errno = FSWrite(AoutRefNum, &length, astring); if (errno != noErr) printf("error on writing\n"); } RAMSDClose(sPortA); ExitToShell(); } Thanx, -Steve Drucker