Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!rice!uw-beaver!uw-june!chou From: chou@cs.washington.edu (Pai Chou) Newsgroups: comp.sys.mac.programmer Subject: Re: Serial Driver Routines in Think C Message-ID: <15294@june.cs.washington.edu> Date: 2 Mar 91 03:53:54 GMT References: <10686@bunny.GTE.COM> Reply-To: chou@june.cs.washington.edu (Pai Chou) Organization: University of Washington, Computer Science, Seattle Lines: 25 In article <10686@bunny.GTE.COM> rc05@gte.com (Ramesh Chandak) writes: >I'm looking for the serial driver routine that will allow sending characters >over the modem port. I realize that the Inside Macintosh Volume II has >a list of commands, but I haven't come across that helps you shipping >characters over the serial line. > >I believe the function SerGetBuf allows you to receive characters. Again >with this function how do you determine that the character you have received >is "a" or "b" ? SerGetBuf() lets you find how HOW MANY BYTES there are left to be read, but it DOES NOT read the characters. You should call it like err = SerGetBuf(-6, &count) where count is a longint. Once you find out count > 0, then you call FSRead() to read the chars. You should use FSRead(-6, count, &buf) and FSWrite(-7, count, &buf) to read/write the modem port. FSRead(-8,..) and FSWrite(-9,..) for the printer port. Pai Chou chou@june.cs.washington.edu