[net.micro.mac] Wierdness with serial drivers

deboor@ucbarpa.Berkeley.EDU (CS55 Porting Project) (09/28/86)

Has anyone else had problems using the FSRead() and FSWrite() routines?

I am using them to read from and write to the modem port (sPortA).
I have opened the drivers (".AIn" and ".AOut") and used SerReset() to get
the baud rates etc set correctly, but when I go to write a character to the
port the machine hangs inside FSWrite().

I have read through IM several times to see if I missed something, but I can't
find it.

Thanks for any help,

-wedge-

st94wb@sdcc12.UUCP (wade blomgren) (09/29/86)

In article <15852@ucbvax.BERKELEY.EDU>, deboor@ucbarpa.Berkeley.EDU (CS55 Porting Project) writes:
> Has anyone else had problems using the FSRead() and FSWrite() routines?
> 
> I am using them to read from and write to the modem port (sPortA).
> I have opened the drivers (".AIn" and ".AOut") and used SerReset() to get
> the baud rates etc set correctly, but when I go to write a character to the
> port the machine hangs inside FSWrite().
> 
> I have read through IM several times to see if I missed something, but I can't
> find it.

  Depending on which development system you are using, you could be a victim of
type mis-matching. For example, when porting a C application from  SUMacC to
LightspeedC I encountered *exactly* the same problem. It turned out that the
character count parameter for the FS routines needed to be declared as 'long' 
in LightspeedC but had somehow worked as type 'int' in SUMacC. Also make sure 
you evaluate the results of all the Serial Driver functions (they return type
OSErr) to make sure everything worked OK when opening and initializing the
driver.


Wade Blomgren
UC San Diego, ACS
 ....!sdcsvax!sdacs!wade