Udostępnij za pośrednictwem


Infrared Connections

The .NET Compact Framework provides classes for developing infrared connectivity applications for smart devices and personal computers. These classes are additions to the System.Net.Sockets namespace and implement socket programming that conforms to standards set by the Infrared Data Association (IrDA) specification.

Using IrDA Classes

The full .NET Framework does not have IrDA classes. To establish IrDA connections between a personal computer and a device, you must invoke the Windows socket using platform invoke on the personal computer side.

Note

The .NET Compact Framework supports only the IrDA standard. You must use platform invoke to access other infrared capabilities on a device. The .NET Compact Framework supports Windows CE powered devices with an IrDA port, such as mice, printers, Pocket PCs and other PDAs.

IrDA defines a protocol suite designed to support point-to-point infrared data transmission between two wireless devices over a short range. IrDA accommodates peer connectivity where multiple devices can establish connections to the same host.

You can implement client and server functionality. A client is the device that initiates the connection. After establishing a connection, data can be exchanged reliably. Because a server requires additional stack requirements, the server is typically a personal computer.

The IrDA classes operate in the Information Access Service (IAS) layer of the IrDA protocol stack. An IAS layer can have one or both of the following components:

  • Server. Contains a collection of objects that describe the services and applications available for incoming connections to that server.

    Note

    There is no class for the server component for this release of the .NET Compact Framework.

  • Client. Performs discovery queries on the server component to obtain a directory of all available connections.

The following table summarizes the functions performed by the .NET Compact Framework IrDA classes.

Class

Description

IrDACharacterSet

This enumeration describes the character set supported by the IrDA device that was discovered.

IrDAClient

Provides access to the client so that you can determine a desired connection, open it, and send and receive data.

IrDADeviceInfo

Provides information on available connections on a server obtained by a discovery query from the client.

IrDAEndPoint

Provides for creating a connection to a server and obtaining infrared port information.

IrDAHints

This enumeration lists values indicating the type of device or connection, such as a fax.

IrDAListener

Places a socket in a listening state to monitor available connections for a specified service. The listener does not listen until the Start method is called.

See Also

Tasks

How to: Make an Infrared File Transfer

Other Resources

Networking and Connectivity in the .NET Compact Framework