beautypg.com

Serial tool with mnp compression 24, Framed asynchronous serial tool 24 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 862

background image

C H A P T E R 2 4

Built-in Communications Tools

24-4

Serial Tool

Serial Tool with MNP Compression

24

The asynchronous serial communications tool with MNP compression works
just like a standard asynchronous serial endpoint, except that it uses MNP data
compression.

The following is an example that shows how to create an endpoint that uses the
serial tool with MNP compression:

myMnpEP := {_proto:protoBasicEndpoint};

myOptions := [

{ label: kCMSMNPID,

type: 'service,

opCode: opSetRequired } ];

returnedOptions:= myMnpEP:Instantiate(myMnpEP,

myOptions);

The serial tool with MNP endpoint uses all of the standard serial options, as well as
two MNP options, which are summarized in Table 24-2. These options are
described in detail in “Options for the Serial Tool with MNP Compression”
(page 21-27) in Newton Programmer’s Reference.

Framed Asynchronous Serial Tool

24

The framed asynchronous serial communications tool is a superset of the standard
asynchronous serial communications tool. This tool supports the sending and
receiving of framed data. If you use this tool and do not specify framing for a send
or receive operation, the framed asynchronous serial tool works exactly like the
standard asynchronous serial tool.

When you use framing for input, the framed asynchronous serial tool discards
characters until a start of frame sequence is detected and terminates input with an
end-of-file (EOF) indication when the end-of-frame sequence is detected. The tool
reports an error is if a CRC error is detected.

When you use framing for output, the data is prefixed with the start-of-frame
sequence. The end-of frame-sequence and the calculated CRC are sent at the end of
the data. The escape character is used for data transparency during framed operations.

Table 24-2

Summary of serial tool with MNP options

Label

Value

Use when

Description

kCMOMNPCompression

"mnpc"

Before connecting

Sets the data compression type.

kCMOMNPDataRate

"eter"

Any time

Configures internal MNP timers.