[comp.sys.mac.programmer] Serial Driver Routines in Think C

rc05@gte.com (Ramesh Chandak) (03/02/91)

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" ?

Please email your replies to Ramesh at rc05@gte.com or at loverboy@athena.mit.
edu

Thank You.

- Ramesh Chandak

chou@cs.washington.edu (Pai Chou) (03/02/91)

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

merlyn@digibd.com (Merlyn LeRoy) (03/06/91)

chou@cs.washington.edu (Pai Chou) writes:
>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.

You should NOT use a literal -6, -7, etc.  Use the results of your
OpenDriver() call!  Use the Comm Toolbox to get the port or at
least make the string in OpenDriver() a resource, not a literal string.
That way you'll have a hope of changing the port easily.

---
Merlyn LeRoy

minich@unx2.ucc.okstate.edu (Robert Minich) (03/06/91)

by merlyn@digibd.com (Merlyn LeRoy):
| chou@cs.washington.edu (Pai Chou) writes:
|>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.
| 
| You should NOT use a literal -6, -7, etc.  Use the results of your
| OpenDriver() call!  Use the Comm Toolbox to get the port or at
| least make the string in OpenDriver() a resource, not a literal string.
| That way you'll have a hope of changing the port easily.

This is just a personal gripe, but I feel the need to vent some spleen:

Inside Mac VI damn well better be ready as soon, if not before, Sys 7 is
in users' hands. I can't afford to buy all the pieces that Apple offers
(Comm Toolbox, for one) that will be part of Sys 7, especially since I'll
have to get IM VI anyway for all the other goodies! I don't make any money
off my programming and I certainly can't afford any official developer
type status. Is Apple going to screw me by being slow on the release of
this info to the general public? I hope not. Can anyone from Apple comment
via this group or email? I hope so. :-)
  with all the hype about talking of Sys 7 so developers will have running
apps at release, plus the delays of the software, is it not reasonable to
have documentation RSN?
-- 
|_    /| | Robert Minich            |
|\'o.O'  | Oklahoma State University| "I'm not discouraging others from using
|=(___)= | minich@d.cs.okstate.edu  |  their power of the pen, but mine will
|   U    | - "Ackphtth"             |  continue to do the crossword."  M. Ho

palmer@nntp-server.caltech.edu (David Palmer) (03/06/91)

minich@unx2.ucc.okstate.edu (Robert Minich) writes:
>This is just a personal gripe, but I feel the need to vent some spleen:
>
>Inside Mac VI damn well better be ready as soon, if not before, Sys 7 is
>in users' hands. I can't afford to buy all the pieces that Apple offers
>(Comm Toolbox, for one) that will be part of Sys 7, especially since I'll
>have to get IM VI anyway for all the other goodies! I don't make any money
>off my programming and I certainly can't afford any official developer
>type status. Is Apple going to screw me by being slow on the release of
>this info to the general public? I hope not. Can anyone from Apple comment
>via this group or email? I hope so. :-)
>  with all the hype about talking of Sys 7 so developers will have running
>apps at release, plus the delays of the software, is it not reasonable to
>have documentation RSN?

I need to vent the same spleen.

Apparently, Inside Mac VI and all the other documentation is just
sitting there on bric-a-brac.apple.com (aka ftp.apple.com) just waiting
for someone to shoot the lawyers and reset a few file protection bits.

I don't know how to use the sound manager, I don't know how to use the
sound-input manager, I don't know how to use the serial ports (on the
IIfx, which has been out for years) I don't know how to use inter-app
communications, or even what it will be like so I can design my code to
integrate it later.

All I have access to is the technotes (those more than 7 months old)
and the ancient Inside Mac books.  NONE of the machines that were
available at the time the last Inside Mac Volume was released are still
in production.

Is it too much to ask that the people who can't afford to spend
thousands of dollars on documentation at least have a source that will
allow them to write software for the beast?

How about an ETO CDROM (I don't know what ETO stands for, I can't
afford the initiation rites that would reveal that knowledge to me)
that has all the high-cost development systems disabled?  That way it
could be sold for an affordable price (as opposed to the $900
it costs now), poor people could read it on
their bargain-basement, 1200 ms seek-time CD_ROM drives, (bought just
so that they could use SpInside Mac) and maybe you would see some
innovative new software from people who have more ideas than money.

Nah, on second thought, why bother.  Nothing could ever come of one or
two guys developing something in their garage.  All the exciting stuff
comes from the big companies, like Lotus ('Jazz' revolutionized the
way we think of spreadsheets) and Microsoft ('Word' revolutionized
the way we think about the Mac User Interface.)

OK, my spleen is now vented.  You can stop reading now.

-- 
		David Palmer
		palmer@gap.cco.caltech.edu
		...rutgers!cit-vax!gap.cco.caltech.edu!palmer
	"Operator, get me the number for 911"  --Homer Simpson