Re: Talking to a serial port
Re: Talking to a serial port
- Subject: Re: Talking to a serial port
- From: Chris Boot <email@hidden>
- Date: Fri, 17 Aug 2001 21:29:11 +0200
Hi,
>
What is the suggested method of talking to a serial device on a G4? I
>
have a keyspan adapter, but all of my example code is for OS9. I need
>
this to work under OSX. Suggestions?
First of all, you'll need the Mac OS X beta Keyspan drivers. Once installed
and rebooted, the serial ports are available as devices in /dev. I can't
remember exactly what the names are or anything (and I think they vary
depending on exactly what USB ports and through which hubs the adapter is
plugged in to), so you'll just have to peruse /dev manually with the aid of
Terminal. In any case, you'll want to ask the end user to choose a serial
port from certain choices.
Once you have the device file, you'll need to use POSIX APIs to
set-up/read/write to device. Of course, I can't remember any of that
either.
There may be (and probably is) a simpler way of doing this through Cocoa,
but I have no idea how.
--
Chris Boot
email@hidden
"Unix is user friendly. It's just selective when choosing friends."