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


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:

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 ], }, };

The fields in the IrDA discovery option frame are described in Table 9-2.

Table 9-2 IrDA discovery option fields
Option fieldDescription
fProbeSlotsThe 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.
fMyServiceHintsThe category of device that you wish to identify yourself as. The service hints are listed in Table 9-4. The default value is kIrDASvcHintPDAPalmtop.
fPeerServiceHintsA 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).
fPeerDevAddrRead-only. Returns the address of the discovered device.
fMediaBusyCheckTo enable a 600ms. delay before discovery begins, specify true (default). To disable the delay, specify nil. 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 to nil. 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 value kIrDASvcHintPDAPalmtop is always OR'd in by the IrDA tool.

Table 9-3 IrDA discovery option probe slots constants
ConstantValue
kIrDA1ProbeSlot1
kIrDA6ProbeSlot6
kIrDA8ProbeSlot8
kIrDA12ProbeSlot12

Table 9-4 IrDA discovery option service hint constants
ConstantValue
kIrDASvcHintPnPCompatible0x00000001
kIrDASvcHintPDAPalmtop0x00000002
kIrDASvcHintComputer0x00000004
kIrDASvcHintPrinter0x00000008
kIrDASvcHintModem0x00000010
kIrDASvcHintFAX0x00000020
kIrDASvcHintLanAccess0x00000040
kIrDASvcHintTelephony0x00000100
kIrDASvcHintFileServer0x00000200

When used with the opcode opGetCurrent, the field fPeerServiceHints returns the service hints reported by the discovered device.

Note
Fields used during an endpoint Connect operation include fProbeSlots, fPeerServiceHints and fMediaBusyCheck. Fields used during an endpoint Listen operation include fMyServiceHints.
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