Apple Newton Utilities Guide de l'utilisateur Page 837

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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,
Vue de la page 836
1 2 ... 832 833 834 835 836 837 838 839 840 841 842 ... 941 942

Commentaires sur ces manuels

Pas de commentaire