Microsoft® .NET Compact Framework (Core Reference)
by Andy Wigley, Stephen Wheelwright, Robert Burbidge, Rory MacLoed, Mark Sutton
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access