Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site mordor.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!grkermi!panda!talcott!harvard!seismo!ut-sally!mordor!jdb From: jdb@mordor.UUCP Newsgroups: net.micro.mac Subject: serial port I/O Message-ID: <2238@mordor.UUCP> Date: Tue, 11-Jun-85 15:53:15 EDT Article-I.D.: mordor.2238 Posted: Tue Jun 11 15:53:15 1985 Date-Received: Fri, 14-Jun-85 00:16:26 EDT Distribution: net Organization: S-1 Project, LLNL Lines: 26 I've been trying to put together an application which will use the modem port to talk to a standard RS-232C device (modem or VAX). I was able to get it to work, but I've run across a couple of unexpected software problems. I am using the Megamax C compiler. My first problem is that a number of the routines (OpenDriver, SerSetBuf, SerReset) are returning a positive "error code". I interpreted *IM* to say that a successful driver call will return 0 and an unsuccessful one will return a negative error code. The functions I call appear to work, so I now ignore the error code unless it is negative. (Before I had this code debugged I would occasionally see a negative error code, and they were always meaningful.) Does the positive number have any meaning? My second problem concerns the function "SerGetBuf", which is supposed to return the number of bytes which are available for reading. According to *IM* this is implemented as status call #2. As far as I can tell (thanks to the misplaced Sound Driver pages in the *IM* "phone book") it is only supposed to return the count as a longword. However, it is definitely returning more than 32 bits of information. What are these extra words/longwords supposed to mean? -- John Bruner (S-1 Project, Lawrence Livermore National Laboratory) MILNET: jdb@mordor.ARPA [jdb@s1-c] (415) 422-0758 UUCP: ...!ucbvax!dual!mordor!jdb ...!decvax!decwrl!mordor!jdb