Apple Newton Utilities Podręcznik Użytkownika Strona 837

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 942
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 836
CHAPTER 23
Endpoint Interface
Using the Endpoint Interface 23-9
All option data you set gets packed together into one block of data. Each option
within this block must be long-word aligned for the communication tools. So,
when using the
'template data form, you need to use the 'struct type (at the
beginning of the
typelist array) to guarantee that the option is long-word
aligned and padded. To set the serial input/output parameters, for instance, the
option frame might look like this:
serialIOParms := {
type: 'option,
label: kCMOSerialIOParms,
opCode: opSetNegotiate,
data: {
arglist: [
kNoParity, // parity
k1StopBits, // stopBits
k8DataBits, // dataBits
k9600bps, // bps
],
typelist: [
'struct,
'uLong,
'long,
'long,
'long
]
}
};
To get the connection information, the option frame you construct might look like this:
connectInfoParms := {
type: 'option,
label: kCMOSerialIOParms,
opCode: opGetCurrent,
data: {
arglist: [
0, // parity placeholder
0, // stopBits placeholder
0, // dataBits placeholder
0, // bps placeholder
],
typelist: [
'struct,
'ulong,
'long,
Przeglądanie stron 836
1 2 ... 832 833 834 835 836 837 838 839 840 841 842 ... 941 942

Komentarze do niniejszej Instrukcji

Brak uwag