Muokkaa

Jaa


Opening and Initializing a Serial Device

When Serial is used as a function driver, the following considerations apply to opening and initializing a serial device:

  • Serial supports only one open at a time on a serial device.

  • A device is in an undefined state when it is opened. A client should initialize a device to a known state before using the device. A user-mode client must use the communications functions that are supported by the Windows Base Services in the Microsoft Windows SDK. A kernel-mode client can use the IOCTL_SERIAL_SET_Xxx and the IOCTL_SERIAL_INTERNAL_Xxx requests. For more information see the ntddser.hheader.

  • All clients must open a serial device when needed, and close the device immediately after they are through with the port.

  • Serenum must open an RS-232 port to enumerate the port. Clients that hold an RS-232 port open indefinitely should not use Serenum.