Using Serial Ports

Serial ports are a communications technology that you can use to talk to peripheral devices attached to your device. The technology is tried and tested, and lots of specialist hardware sensors and accessories such as Global Positioning System (GPS) receivers communicate by using serial ports. .NET Compact Framework version 2.0 supports the SerialPort component, which was also introduced in version 2.0 of the full framework.The key port properties exposed are listed in Table 8-2.

Table 8-2. SerialPort Properties

Property

Description

PortName

This is the full name for the port without the trailing colon.

BaudRate

Physical baud rate in bits per second; this must match that used on the remote device.

StopBits

Number of stop-bits transmitted, ...

Get Microsoft® Mobile Development Handbook 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.