Partager via


Accessing an IR Port Through Raw IR (Windows CE 5.0)

Send Feedback

Raw IR access is only available on devices that expose the IR hardware as a serial port. Using raw IR involves accessing the IR port and handling the connection as a serial port with IR hardware attached. By using this non-IrDA-compliant method, which does not use the Microsoft Windows CE-provided IrDA stack, an application has the most control of IR communications. However, the application cannot benefit from the functionality provided by the stack. For example, it is possible for signal collisions to occur between devices during a data exchange. Also, it is possible to lose data when the infrared beam is broken, such as when someone walks between the two devices. The application is responsible for detecting and handling these error conditions.

If a Windows CE–based device shares serial hardware with the IR port and the serial port, an application must instruct the COM driver to route data through the IR port.

To route data using the IR port

  1. Use the EscapeCommFunction function with the dwFunc parameter set to SETIR.
  2. Use the standard serial communications functions to transmit and receive data. For more information about these functions, see Programming Serial Connections and Serial Communications Functions.
  3. Call the EscapeCommFunction with the dwFunc parameter set to CLRIR to set the port back to normal serial mode.

See Also

IrDA OS Design Development | IrDA Application Development | IrDA Stack Architecture

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.