From: schulte@klin.far.ruu.nl (Bas Schulte, Spider)
Newsgroups: comp.sys.mac.programmer
Subject: CTB Problem?
Date: 19 Nov 1992 09:15:36 -0600
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu

Hi,

[this is a long one, non-CTB wizards can skip to the next message]

I'm in the process of writing an application (that is a _real_ one, not some crummy hack) that 
communicates over modems/phonelines. As always when there's a way to not to reinvent the wheel, I 
decided to give the Communication Toolbox a try. A real try this time, not at all like the 
(succesfull) tricks I did in the past.

While developing the applications (a client talking to a host), I tested using the Serial Tool and 
the Apple Modem Tool (1.1, not 1.1.1!) fooled to work over AppleTalk (through a product called 
NetConnect, this emulates a modem over AppleTalk, standard disclaimers...). Everything went pretty 
smooth, I got it to work.

Then when I got to some real testing using two Hayes Ultra 144 modems, it didn't work! Here's a 
summary of the problems I had:

1. Apple Modem Tool 1.1 (and later on 1.1.1) had problems setting it's configuration.

When CMSetConfig'ing with a pointer to a previously saved configuration string that specifies the 
tool the answer the phone after x rings, the tool accepts CMSetConfig (i.e. it doesn't return an 
error), but it switches back to 'Dial phone number...'! It does use the other settings in the 
configuration string, but it refuses to keep the 'Answer phone after x rings'.

In other words: not usable! My host application is supposed to answer the phone, but I can't get 
Apple Modem Tool 1.1 or 1.1.1 to do it. Version 1.0 DOES remember it's settings correctly.


2. The Hayes Modem Tool 1.0 does not allow CMOpen calls to be asynchronously.

Calling CMOpen with async = true does exactly the same as when I tell it async = false, i.e. it does 
not return until it establishes a connection. I DO NOT want this!


These two points made me use the Apple Modem Tool 1.0. I do recall that this version had bugs. That 
must be the case, since I had all kinds of failures with it. Basic sending/receiving of data wasn't 
the problem, nor was filetransfer using standard XModem. Any other XModem lead to aborted 
transmissions, disconnects, etc. etc.


So far my experiences with the CTB. As you can imagine, I was pretty fed up with it, especially 
considering my app's didn't work during a demo in front of more than a 100 people (I had to use 
another application for the actual transmission, can you imagine what that must have looked like!).

All this made me decide to not use the CTB. So, back to the drawing board, and start to develop my 
own serial routines, modem handling and all that. That's what I'm doing right now, studying the AT 
command set, implementing asynchronous IO, etc. etc. Not nice!

I desperately would like to get back at using the CTB, so I would like comments/suggestions on the 
problem I had. Maybe one of you can tell me what I was doing wrong, whether other versions of the 
connection tools DO work, or just about anything that can prevent me from going crazy over PBStatus 
calls to the serial driver... Comments on the performance of the CTB vs. doing it y'rself are 
welcome too. 

Note that I am aware of a possible performance penalty for using the CTB vs. your own serial/modem 
handling, but I hope that is minimal in my case (I do not use terminals, nor do I intend to keep 
using FT tools, I want to implement a FT protocol simply above the connection manager (or has it 
gotten any easier to do a zmodem ft tool?)).

Thanks in advance, and sorry for the long message,

Bas A. Schulte

####   Internet: schulte@klin.far.ruu.nl (through ARA and MacTCP)    ####