Page 96 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 96
PDA 05 5/30/03 11:35 AM Page 72
PDA Robotics
nection is used, the assumption is made that both sides have the same
communications parameters and features. A wired connection has no
need to identify the other connector because it is assumed that the
connectors are properly connected. In the IrDA standard, a connection
process has been defined to identify other IrDA compatible devices
and establish a communication link. These two devices (PDA and
PDA Robot) go through three steps to make this connection. They are:
• Normal disconnect mode (NDM)
• Discovery mode
• Normal connect mode (NCM)
Figure 5.28 shows the connection sequence.
Normal Disconnect Mode (NDM)
When two IrDA standard compatible devices come into range, they
must first recognize each other. The basis of this process is that one
device has some task to accomplish, and the other device has a
resource needed to accomplish this task. One device is referred to as a
primary device and the other is referred to as a secondary device. This
distinction between primary device and secondary device is impor-
tant. In our case, the PDA is the primary device and PDA Robot is the
secondary. It is the responsibility of the primary device to provide the
mechanism to recognize other devices.
So the primary device must first poll for nearby IrDA standard com-
patible devices. During this polling, the default baud rate of 9600 baud
is used by both devices. For example, to print from an IrDA-equipped
laptop to an IrDA printer, utilizing the IrDA standard feature, first
bring your laptop in range of the printer. In this case, the laptop has
something to do and the printer has the resource to do it. The laptop
is called the primary device and the printer is the secondary device.
Some data-capable cell phones have IrDA standard IR ports. If you
used such a cell phone with a PDA, the PDA that supports the IrDA
standard feature would be the primary device, and the cell phone
would be the secondary device.
When a primary device polls for another device, a nearby secondary
device may respond. When a secondary device responds, the two
devices are defined to be in the NDM state. NDM is established by the
72