home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!news.funet.fi!funic!convex!asunta
- From: asunta@convex.csc.FI (Miika Asunta)
- Subject: Re: looking for telecomm app source
- Message-ID: <1992Nov12.160833.796@nic.funet.fi>
- Keywords: modem, communications, serial, driver, src
- Sender: usenet@nic.funet.fi
- Nntp-Posting-Host: convex.csc.fi
- Organization: Finnish Academic and Research Network Project - FUNET
- References: <1992Nov11.191302.29668@ircam.fr>
- Date: Thu, 12 Nov 92 16:08:33 GMT
- Lines: 42
-
- In <1992Nov11.191302.29668@ircam.fr> tanaka@ircam.fr writes:
-
- As a programming excercise, I am writing a small utility to
- send data out the Mac serial port to a modem. I am wondering
- if there are any good public domain examples and source code
- examples that would help me get started.
-
- Does this mean I have to write a serial driver? I need to
- set up communicationswith a Hayes compatible modem, send dialing
- commands, etc. Any pointers would
- be greatly appreciated.
-
- Read Inside Macitosh vol II, chapter Serial Drivers, and you find out
- it's a really easy job to do.
-
- You open modem or pringer port, and configurate it and then send
- and read the data, and finally close it.
-
- ie.
-
- main()
- {
- InitMac(); // Macintosh Init routines - you write it yourself...
-
- RAMSDOpen(sPortA); // modem port, sPortB is printer port
-
- SerReset(-6,baud2400+stop1+data8); // -6=Modem port in; printer= -8
- SerReset(-7,baud2400+stop1+data8); // -7=modem out; printer= -9
-
- FSWrite(-7,&count,dataptr); // Read data
- FSRead(-6,&count,dataptr); // Write data
-
- RAMSDClose(sPortA);
- }
-
- That's it! For more complicated modem operations I suggest use of
- communications toolbox; the comm tools provide really sophisticated
- means of controlling communication devices.
- --
- Miika Asunta
- asunta@convex.csc.fi Double Bass Player
- tel. +358-0-494 093 Macintosh Programmer
-