Chapter 12: Serial Communications

If there's one area of the Win32 API that Windows CE doesn't skimp, it's in communication. It makes sense. Either systems running Windows CE are mobile, requiring extensive communication functionality, or they're devices generally employed to communicate with remote servers or as remote servers. In this chapter, I introduce the low-level serial communication APIs.Talking to a serial port involves opening and conversing with a serial device driver. Talking to a device driver isn't a complicated process. In fact, in the tradition of most modern operating systems, applications in Windows CE access device drivers through the file system API, using functions such as CreateFile, ReadFile, WriteFile, and CloseHandle. In addition, there are times, and the serial driver occasions one of those times, when an application needs to talk to the device, not just send data through the device. To do this, use the DeviceIoControl function. We'll use all these functions in this chapter.