Serial Communications

Many recent handheld devices support IrDA or Bluetooth wireless technology to connect to another device, but for many devices, such as modems, bar code scanners, and GPS receivers or printers, RS-232 serial communication over a cable remains the only option. Unfortunately, there are no managed classes to access the serial port on the device, so to do this you must use the native API in the underlying Windows CE operating system. Use P/Invoke to call out to the methods in the native DLLs. Chapter 22,covers how to use P/Invoke, so we won’t explain it here but we will show you the structure definitions and external function call declarations that you need. For a detailed description of how to perform serial communications in ...

Get Microsoft® .NET Compact Framework (Core Reference) 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.