Apple Newton Utilities Podręcznik Użytkownika Strona 863

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 942
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 862
CHAPTER 24
Built-in Communications Tools
Serial Tool 24-5
An endpoint can include kPacket, kEOP, and kMore ags to control the sending
and receiving of framed (packetized) data with the framed asynchronous serial
tool. For more information on these ags, see “Sending Data” (page 23-11).
The following is an example that shows how to create an endpoint that uses the
framed asynchronous serial tool:
myFramedEP := {_proto:protoBasicEndpoint};
myOptions := [
{ label: kCMSFramedAsyncSerial,
type: 'service,
opCode: opSetRequired } ];
returnedOptions:= myFramedEP:Instantiate(myFramedEP,
myOptions);
The framed asynchronous serial tool uses the standard asynchronous serial tool
options, as well as two framing options, which are summarized in Table 24-3.
These options are described in detail in “Options for the Framed Asynchronous
Serial Tool” (page 21-29) in Newton Programmers Reference.
The default settings for the
kCMOFramingParms option implement BSC framing,
as shown in Figure 24-1.
Figure 24-1 Default serial framing
Each packet is framed at the beginning by the 3-character SYN-DLE-STX header.
The packet data follows; if a DLE (escape character) occurs in the data stream,
Table 24-3 Summary of framed serial options
Label Value Use when Description
kCMOFramingParms
"fram" Any time Congures data framing parameters.
kCMOFramedAsyncStats
"frst" Any time Read-only option returns the number
of bytes discarded while looking for
a valid header.
Octet 1
SYN
Flag
0001011
DLE
Flag
0001000
STX
Flag
0000001
Message . . . DLE
Flag
0001000
ETX
Flag
0000001
Frame
Check
Sequence
23. . . . . . . . . . . . . . . . . . N-3 N-2 N-1 N
Przeglądanie stron 862
1 2 ... 858 859 860 861 862 863 864 865 866 867 868 ... 941 942

Komentarze do niniejszej Instrukcji

Brak uwag