Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 9 - IrDA Communication Tool / IrDA Tool Option Reference


Connection Information Option

The second stage of the connection process involves a name lookup of the service to use, or registry of the service provided. The *kCMOIrDAConnectInformation option is used to specify this information.

The following example shows the use of this option:

local option := {

label: kCMOIrDAConnectInformation, // "irci" type: 'option, opCode: opSetRequired, data: { arglist: [ 0, // LSAP id 0, // peer LSAP id 4, // strlen("Test") 5, // strlen("IrLPT") "Test", // my name "IrLPT", // peer name ], typelist: [ 'struct, 'uLong, // fMyLSAPId 'uLong, // fPeerLSAPId 'uLong, // fMyNameLength 'uLong, // fPeerNameLength ['array, 'char, 0], // fMyName ['array, 'char, 0], // fPeerName ], }, };

The fields in the IrDA connection information option frame are described in Table 9-5.

Table 9-5 IrDA connection information option fields
Option fieldDescription
fMyLSAPIdSet to 0 and the IrDA comm tool chooses a random LSAP id (between 1 and 31), or you may set a specific value from 1 to 31. The default is 0.
fPeerLSAPIdSet to 0 to do the service lookup by name, or specify any other value from 1 to 111. If the value is non-zero, then the name lookup phase is skipped and connection is made using an LSAP id with that value. The default is 0.
fMyNameLengthThe length, in characters, of the fMyName string. The default is 1.
fPeerNameLengthThe length, in characters, of the fPeerName string. The default is 1.
fMyNameA string identifying the service provided by the Newton unit. The default is "X".
fPeerNameA string identifying the service provided by the peer device. The default is "X".

Note that the only reason to use a specific value for the fMyLSAPId field would be to advertise your service by number instead of by name--and that is not recommended per IrDA standards. The option is left available in case your application needs to communicate with an older desktop IrDA application.

Likewise for the fPeerLSAPId field--per IrDA standards, services should be identified and looked up by name, not number. But if you need to communicate with an older desktop IrDA application that supports access only by LSAP id (no name look up) then you will be able to by specifying the id number directly.

Note
Fields used during an endpoint Connect operation include fPeerLSAPId, fPeerNameLength and fClassNames. Fields used during an endpoint Listen operation include fMyLSAPId, fMyNameLength and fClassNames.
Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help