Newton 2.0 Communications

COURSE INTRODUCTION


Overview
Prerequisites
Required Equipment
Course Outline

Communications Overview Module
Desktop Integration Libraries (DILs) Module
Endpoint Module

Review Questions
References
Where To Go From Here




Welcome to Newton Programming: Communications 2.0 Self-Paced Training! This course will provide you with a comprehensive overview of communications on the 2.0 Newton operating system and its Desktop Integration Libraries (DILs).

After finishing this course you should understand the structure of communications on the 2.0 platform and, if you were a Newton OS 1.x communications programmer, the changes to the 2.0 communications API. Armed with this knowledge you should be able to make a fairly accurate appraisal of what communications programming you will need to do for your Newton application to make it 2.0 savvy.

The student should be an experienced NewtonScript programmer though he or she need not be familiar with Newton communications programming. Having experience with communications programming in general is helpful but not strictly necessary.


You should have a 2.0 Newton, the Newton Toolkit (NTK) version 1.5 or later running on a desktop machine, the appropriate cable for connecting the Newton to a desktop machine and a desktop machine to connect to with the cables. While not strictly necessary (electronic copies are included in the course materials), printed copies of the Newton documentation Newton Programmer's Guide: Communications and Newton Programmer's Guide: System Software are useful. Also, it is a good idea to have QuickTime or QuickTime for Windows installed on your desktop machine to play the animations which come with the course and which are used to highlight some of the dynamic qualities of the communications system.



This outline describes the elements of this section. It is not necessary or even desirable for the student to go through each of these elements. Instead he or she should choose the pieces which seem appropriate and should also feel free to branch off into items referenced in the course materials whether the references are to other parts of the course or to other materials all together.

Overview Module

Article: 2.0 Communications Overview

This article is designed for experienced Newton programmers who have not implemented communications on the Newton platform. It gives a brief summary of all the components in the Newton operating system which have to do with communications as well as describing the DILs (Desktop Integration Libraries). This article gives new programmers a brief overview without overwhelming them with technical details. Instead there are numerous references to where these details may be found.


Article: 1.x To 2.0 Communications

This article is designed for experienced Newton communications programmers who want a quick summary of the changes between the 1.x system and the 2.0 system. It goes into quite a bit more detail than the general overview article but still avoids code examples and instead relies on references to code to point the student in the right direction.


Animation: Flow of Control in the Newton Communications

This QuickTime animation allows the student to step through the flow of messages and control between major components of the communications system. This and other animations are most useful if played one frame at a time using the controls in the SimplePlayer or MoviePlayer applications. Download ZipIt for the Macintosh.



Animation: DILs and the Newton

This QuickTime animation shows the interaction between desktop machines and the Newton using the Desktop Integration Libraries. Download ZipIt for the Macintosh.


DILs Module


Article: DILs Overview

This article describes the main features of the Desktop Integration Libraries without getting into specific technical details. It covers the main features and uses of the CDIL, FDIL and PDIL along with some of the main concepts embodied in the DILs.

Article: CDIL Details

This article describes the technical details of using the CDIL (Connection Desktop Integration Library) including the main sequence of calls and sample code detailing the use of the CDIL in connecting to a desktop machine.

Article: FDIL Details

This article does the same thing for the FDIL (Frame Desktop Integration Library) describing the main features of the API and presenting sample code showing the use of the FDIL to transfer data to and from NewtonScript frames.

Article: SoupDrink Walkthrough

This article examines the DTS sample code: SoupDrink which uses the DILs to connect and upload or download the contents of a Newton soup. It first presents the CDIL code, then the FDIL code which is built on top of the CDIL code.

Lab: DIL Archive - ( CDIL Archive Lab, FDIL Archive Lab)

Using the DILs, this lab the student in using the CDIL to connect and backup simple data strings on a desktop machine. Once that is accomplished the lab continues and uses the FDIL to backup and restore NewtonScript frames to or from a desktop machine.

Endpoint Module

Article: Endpoint Overview

This article describes the main features of the communications scripting API on the Newton. It describes the features and major characteristics of Endpoints without going into excessive technical detail.

Article: An Introduction To Communications State Machines

This article discusses the use of state machines for handling interrupt driven communications and in particular discusses the implementation of communications state machines on the Newton. It is designed for programmers who have no exposure to communications state machines but because of the Newton-specific bent, it may also be useful to experienced communications programmers.

Animation: InputSpec Animation This animation gives a dynamic display of how the Newton handles incoming data based on the programmers specification of his or her state machine. Download ZipIt for the Macintosh. Article: Endpoint Details

This article details the fundamental endpoint API. It covers creation, use for both input and output and destruction of endpoint objects. These details are general to all endpoints though specific uses and kinds of endpoints are not covered in detail.

Lab: Coding a Simple Endpoint

This lab is designed to teach the student the basics of creating and using a simple serial endpoint. The student creates a simple serial endpoint which is used to connect to a desktop machine in order to send and receive data strings.

Article: Data

NewtonScript endpoints provide a rich API for working with incoming and outgoing data. This article details the various methods for transferring different types of data including filtering, translating and moving binary data objects.

Article: Endpoint Flavors

While the Endpoint Details article is designed to give an overview of the technical details of all endpoints, this article is designed to give specific details about specific sub-classes of endpoints including serial, modem, AppleTalk, Infrared, streaming and telecommunications endpoints.

Article: Debugging Endpoints

Because of the asynchronous nature of most communications and the dependence on specific hardware and software protocols, debugging endpoint scripting code can be difficult. This article outlines strategies for debugging endpoint code and in particular it describes common pitfalls.

Lab: IR Detector

This lab works with an asynchronous infrared endpoint to create a "detector" which detects the strength of signal as represented by a constant transfer speed when communicating between two Newtons.

Lab: Using the New Endpoints

Under the 2.0 operating system, there is new support for different kinds of communications. This lab will walk through code which demonstrates the TC and Streaming endpoints which support telecommunications and the transfer of large streams of data.

Lab: Converting 1.x Endpoint Code to 2.0

This lab is for those students who already have existing endpoint code who want to convert it to the 2.0 endpoint system. In particular, it focuses on new capabilities as well as necessary changes to the old communications scripting.





Name the major components of the 2.0 communications system and give an example when you might use each of them in an application.

Summarize the lifecycle of an endpoint.

What DIL code runs on the Newton?

Can endpoint calls be made asynchronously? DIL calls?

What part of the communications system do transports interact with?

Click here for answers!




Newton Programmer's Guide: Communications for Newton communications programming methods and theory.

Newton Programmer's Guide: System Software details other features of the operating system.

The NewtonScript Programming Language for details on NewtonScript.

The DILBOOK.PDF has details on DIL structures, calls and usage. This is an Adobe Acrobat file so you must have the Acrobat reader or an application which can read Acrobat files.

Newton DTS Sample Code is the first place to look for code examples on Newton programming. It is included in the materials on the CD which come with this course.





+If you have no Newton programming experience, you may want to take the Newton Programming: Essentials 2.0 course available from Apple's Developer University , or check out our free online Programming for the Newton course.

Within this course the best place to go is whatever module you want to know more about. If you want to learn about endpoint code, go to the module on communications scripting, the DILs module covers the Desktop Integration Libraries, etc.

If you want to start looking at code, the lab solutions in these modules are available as well as the DTS sample code.

For the literary minded, the Newton Programmer's Guide books are necessary reading while new Newton programmers may consider taking one of Apple's introductory courses on Newton Programming.


Navigation graphic, see text links

Developer Services | Technical Information | Tools | Sample Code

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help


Copyright Apple Computer, Inc.
Maintained online by commscourse@newton.apple.com
Updated 26-Sep-96 by pmr