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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.