Discovery Option
In the discovery phase of a connection, the Newton unit probes and accumulates a list of other IrDA devices within beaming range. Each device is loosely identified by a service hints field (PDA/Computer/Printer/etc.) and a device nickname. The *kCMOIrDADiscoveryInformation option is used to specify which device to use and also how the Newton unit should appear to other devices that probe it.You can also use this option after a connection has been made, to return information about the connection (the service hints of the discovered device, and its device address).
The following example shows the use of this option:
The fields in the IrDA discovery option frame are described in Table 9-2.local option := {
label: kCMOIrDADiscoveryInformation, // "irdi" type: 'option, opCode: opSetRequired, data: { arglist: [ 8, // 8 probe slots kIrDASvcHintPDAPalmtop,// service hint kIrDASvcHintPrinter,// service hint mask 0, // devAddr of peer device 1, // use standard media busy check ], typelist: [ 'struct, 'uLong, // fProbeSlots 'uLong, // fMyServiceHints 'uLong, // fPeerServiceHints 'uLong, // fPeerDevAddr 'uLong, // fMediaBusyCheck ], }, };
Table 9-2 IrDA discovery option fields
Option field Description fProbeSlots The number of "slots" used during probing. The valid choices are listed in Table 9-3. The default is kIrDA8ProbeSlot
. This value relates to an IrDA collision-avoidance mechanism. It is recommended that you use the default setting unless you have a specific reason for changing it.fMyServiceHints The category of device that you wish to identify yourself as. The service hints are listed in Table 9-4. The default value is kIrDASvcHintPDAPalmtop
.fPeerServiceHints A mask used to identify the categories of devices that you wish to connect to. You can OR together any combination of the values in Table 9-4 to construct this value. The default value is 0xFFFFFFFF
(accept any device during discovery phase).fPeerDevAddr Read-only. Returns the address of the discovered device. fMediaBusyCheck To enable a 600ms. delay before discovery begins, specify true
(default). To disable the delay, specifynil
. It is highly recommended that you use the default setting. If you are using a sender/receiver model (like Newton beaming) then you may want to set this field tonil
. But beware, for this invalidates IrDA compliancy with other IrDA devices.Note that the service hints can be bit-OR'd together.
You can specify whatever you wish for the
fMyServiceHints
field, but the valuekIrDASvcHintPDAPalmtop
is always OR'd in by the IrDA tool.Table 9-3 IrDA discovery option probe slots constants
Constant Value kIrDA1ProbeSlot 1 kIrDA6ProbeSlot 6 kIrDA8ProbeSlot 8 kIrDA12ProbeSlot 12
Table 9-4 IrDA discovery option service hint constants
Constant Value kIrDASvcHintPnPCompatible 0x00000001 kIrDASvcHintPDAPalmtop 0x00000002 kIrDASvcHintComputer 0x00000004 kIrDASvcHintPrinter 0x00000008 kIrDASvcHintModem 0x00000010 kIrDASvcHintFAX 0x00000020 kIrDASvcHintLanAccess 0x00000040 kIrDASvcHintTelephony 0x00000100 kIrDASvcHintFileServer 0x00000200 When used with the opcode
opGetCurrent,
the fieldfPeerServiceHints
returns the service hints reported by the discovered device.
- Note
- Fields used during an endpoint
Connect
operation includefProbeSlots
,fPeerServiceHints
andfMediaBusyCheck
. Fields used during an endpointListen
operation includefMyServiceHints
.![]()
![]()
![]()
![]()
![]()
© Apple Computer, Inc.
26 APR 1997Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help