/* ** Newton Developer Technical Support Sample Code ** ** DILette, minimal code to demonstrate use of the CDILs ** ** by David Fedor, Newton Developer Technical Support ** ** Copyright © 1996-1997 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 the bare minimum code necessary to demonstrate use of the CDILs and still run as a standalone application. There is no UI at all in DILette. DILette expects to run on a Macintosh and use the Modem Port for a serial connection to a Newton device which is running the SoupDrink package. If you want to use a different port (or use ADSP or straight serial without MNP error correction), uncomment the appropriate lines in the source. DILette will connect to the Newton device and send a command to the Newton SoupDrink application so that SoupDrink will respond with "Hello". DILette then closes the connection. If DILette believes everything worked properly, it will beep twice and immediately exit. If any errors occur, a message will be printed in MacsBug. Press "g" and hit return to have the connection closed down properly, otherwise you'll probably have to reboot your Macintosh in order to use the serial port again. Note that the CSTR resource file must be linked in to every DIL application. It contains resources used internally by the CDIL to find the appropriate Communications Toolbox files. Also note that the names of the serial ports ("Modem Port") etc will have to be modified to use DILette on a non-English version of the Macintosh System. Modified April 1997 - converted to CodeWarrior 11. Note that DILette still uses the old ANSI libraries, not the MSL ones which are the default ones for CW11. Why? Because the MSL libraries don't by default include one for 2-byte integers and 8-byte longs, which is what the Mac DILs use right now. If you build your own 2i8d MSL library, things should work fine too.