Using IrDA and Bluetooth

The Compact Framework provides an IrDA library; however, there is no matching library in the full framework. Fundamentally, this was designed to work in the same way as sockets programming over TCP. The main difference is that IrDA has the ability to search for nearby devices using the IrDAClient.DiscoverDevices method. The following code sample shows how to perform a discovery:

private void btnDiscover_Click(object sender, EventArgs e)
{
IrDAClient ic = new IrDAClient();
IrDADeviceInfo[] devices = ic.DiscoverDevices(6);
dataGrid1.DataSource = devices;
}

The IrDADeviceInfo class groups together information on a specific device such as its address, display name, and hint bits, which are used to describe the type of device. ...

Get Microsoft® Mobile Development Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.