As infrared data communications, based on standards from the Infrared Data Association (IrDA), become widely available on personal computers and peripherals, a timely opportunity exists for effective and inexpensive short range wireless communications on embedded systems and devices of all types.
The Infrared Data Association (IrDA) is an industry-based group of over 150 companies that have developed communication standards especially suited for low cost, short range, cross-platform, point-to-point communications at a wide range of speeds. These standards have been implemented on various computer platforms and more recently have become available for many embedded applications.
What is an IrDA Protocol Stack :
Communications protocols deal with many issues, and so are generally broken into layers, each of which deals with a manageable set of responsibilities and supplies needed capabilities to the layers above and below. When you place the layers on top of each other, you get what is called a protocol stack, rather like a stack of pancakes or a stack of plates. An IrDA protocol stack is the layered set of protocols particularly aimed at point-to-point infrared communications and the applications needed in that environment.
Below is a picture of the IrDA protocol layers.
The layers within this stack can be divided into two groups : -- 1.required protocol
Required IrDA Protocols : -
The required layers of an IrDA protocol stack are in unshaded boxes in the diagram above and include the following:
• Physical Layer: Specifies optical characteristics, encoding of data, and framing for various speeds.
• IrLAP: Link Access Protocol. Establishes the basic reliable connection.
• IrLMP: Link Management Protocol. Multiplexes services and applications on the LAP connection.
• IAS: Information Access Service. Provides a "yellow pages" of services on a device.
Optional IrDA Protocols :
The optional protocols are shown above in shaded boxes. The use of the optional layers depends upon the particular application. The optional protocols are:
• TinyTP: Tiny Transport Protocol. Adds per-channel flow control to keep things moving smoothly. This is a very important function and is required in many cases.
• IrOBEX: The Object Exchange protocol. Easy transfer of files and other data objects.
• IrCOMM: Serial and Parallel Port emulation, enabling existing apps that use serial and parallel communications to use IR without change.
• IrLAN: Local Area Network access, enabling walk-up IR LAN access for laptops and other devices.
Physical Layer and the Framer :
The Physical layer includes the optical transceiver, and deals with shaping and other characteristics of infrared signals including the encoding of data bits, and some framing data such as begin and end of frame flags (BOFs and EOFs) and cyclic redundancy checks (CRCs). This layer must be at least partially implemented in hardware, but in some cases is handled entirely by hardware.
In order to isolate the remainder of the stack from the ever-changing hardware layer, a software layer called the framer is created. Its primary responsibility is to accept incoming frames from the hardware and present them to the Link Access Protocol layer (IrLAP). This includes accepting outgoing frames and doing whatever is necessary to send them.
IrLAP - Link Access Protocol :
The framer we encounter the IrLAP layer, also known as the Link Access Protocol, or LAP for short. IrLAP is a required IrDA protocol corresponding to OSI layer 2 (data link protocol). It is based on High-Level Data Link Control (HDLC) and Synchronous Data Link Control (SDLC) with extensions for some unique characteristics of infrared communications.
IrLAP provides reliable data transfer using the following mechanisms:
• Low-level flow control. (TinyTP provides high-level flow control and should almost always be used in place of IrLAP flow control.)
• Error detection.
Environmental Characteristics :
Several environmental factors influenced the development of the IrLAP layer. These include the following:
• Point-to-point. Connections are one-to-one, such as camera to PC or data collector to printer. The range is typically zero to one meter, although extended range up to 10 meters or more is under development. This is not like a local area network (many-to-many) protocol.
• Half-duplex. Infrared light, and therefore data, is sent in one direction at a time. However, the link changes directions frequently and can simulate full duplex in cases where timing is not extremely sensitive.
• Narrow infrared cone. The infrared transmission is directional within a 15 degree half angle in order to minimize interference with surrounding devices.
• Hidden Nodes. Other IR devices approaching an existing connection may not be immediately aware of the connection if they approach from behind the current transmitter. They must wait and see if the link turns around before stepping in. Interference. IrLAP must overcome interference from fluorescent lights, other IR devices, sunlight, moonbeams, and so forth.
• No collision detection. The design of the hardware is such that collisions are not detected, so the software must handle cases where collisions cause lost data with methods such as random back off.
IrLAP is built around two modes of operation, corresponding to whether or not a connection exists.
Normal Disconnect Mode (NDM) :
NDM is also known as contention state, and is the default state of disconnected devices. In this mode a device must observe a set of media access rules. Of utmost importance, a device in NDM must check whether other transmissions are occurring (a condition known as media busy) before transmitting. This is accomplished by listening for activity. If no activity is detected for greater than 500 milliseconds (the maximum time for the link to turn around), the media is considered to be available for establishment of a connection.
Normal Response Mode (NRM) :-
NRM is the mode of operation for connected devices. Once both sides are talking using the best possible communication parameters (established during NDM), higher stack layers use normal command and response frames to exchange information.
IrLAP Services :
A number of services are defined in the IrLAP specification. Not all services are necessary for all devices, and the IrLAP specification (along with the IrDA Lite standard) describes the minimum requirements. The most important services include the following:
• Device Discovery: Explores the nearby IR-space to see who is present and get some hint as to what they can do
• Connect: Chooses a specific partner, negotiates the best possible communication parameters supported by both sides, and connects.
• Send Data: The whole reason for all this effort—used by higher layer protocols for almost all of their work.
• Disconnect: Closes down and returns to the NDM state, ready for a new connection.