/*
**      Newton Developer Technical Support Sample Code
** 
**      SoupDrink, code to communicate with desktop DIL applications
**
**      by David Fedor, Rob Langhorne, J. Christopher Bell, & Jim Schram
**
**      Copyright © 1995-1996 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/


This is a Newton package which communicates with the MacOS or Windows
SoupDrink applications, as well as the DILette sample application, all
of which you probably also got with this sample code.


SoupDrink can connect over ADSP or the serial port.  It expects one of
three commands from the desktop machine:  "DRNK", "NAME", or "HELO".

*  "DRNK" will initiate a "soup drink" - the contents of a soup will be
transmitted to the desktop computer through a sequence of commands sent
back and forth.

*  "NAME" means a frame is being sent from the desktop which should be
added to the Names soup.

*  "HELO" causes SoupDrink to respond "Hello" to the desktop, then
immediately drop the connection.  This is primarily for use by DILette to
demonstrate that basic communications were successful.

In this case, we are trying to simulate the asychronous nature of communications
code (see the Communications chapter of the NPG 2.0 for more info).  The
communications code is based on ProtoFSM (finite state machine) that was
created by Jim Schram of Newton DTS.

WARNING: The communications code finite state machine is NOT discussed in this
sample. For information about how to write code based on the protoFSM proto,
see the April, 1996 (Volume II, Number 2) NTJ article titled "Finite-State
Machines: A Model for Newton Communications". Also see the DTS sample code
"Comms FSM" and "protoFSM" for the most recent version of this proto and more
information about how it works.


==version history
Version 2 no longer implements the "spit" (string-only) protocol.
This is because it is a Newton 2.0 OS specific application, and can
use the frame flattening/unflattening routines exclusively for all
desktop communications.

version 3: protoBasicEndpoint and protoFSM
