Wednesday, August 22, 2007

Infrared Programming Using the .NET Compact Framework

Infrared communication is one of the most common forms of communication for devices today. If you've ever used a TV remote control, you've experienced the convenience of using infrared communications. While infrared communications require line-of-sight between the sending and receiving devices, they are a quick and cheap way of communicating between devices.

Most Windows Mobile devices you buy today come with an infrared port, but latley it seems like Bluetooth has been taking the limelight because it has a wider operating radius and most importantly it does not require line-of-sight in order to work. Despite this limitation, infrared requires no pairing of devices, and certainly does not require the hassles of exchanging secret pin numbers. For this reason, it is quite suitable for applications that require fast exchanges of information.

Using infrared on Windows Mobile Pocket PCs is easy using the System.Net.IrDA library, available in the .NET Compact Framework. What about using infrared on the desktop PC? Unfortunately, the .NET Framework does not come with the System.Net.IrDA library, which means you cannot use infrared using the .NET Framework directly. To do so, you'll need the 32feet.NET library,written by fellow MVP, Peter Foot (http://www.peterfoot.net/). This library makes infrared programming available to managed developers. 32feet.NET is a project that aims to make wireless networking (via Bluetooth and IrDA) much more easily accessible from .NET code, whether it's on mobile devices or desktop computers. You can download the latest version of 32feet.NET (v2.0.60828) from here.

No comments: