# ISerialPort Interface Reference

The ISerialPort interface represents the virtual serial port device. More...

List of all members.

## Public Attributes
readonly attribute unsigned long | slot
| Slot number this serial port is plugged into.
attribute boolean | enabled
| Flag whether the serial port is enabled.
attribute unsigned long | IOBase
| Base I/O address of the serial port.
attribute unsigned long | IRQ
| IRQ number of the serial port.
attribute PortMode | hostMode
| How is this port connected to the host.
attribute boolean | server
| Flag whether this serial port acts as a server (creates a new pipe on the host) or as a client (uses the existing pipe).
attribute wstring | path
| Path to the serial port's pipe on the host when ISerialPort::hostMode is PortMode_HostPipe, or the host serial device name when ISerialPort::hostMode is PortMode_HostDevice.

## Detailed Description

The ISerialPort interface represents the virtual serial port device.

The virtual serial port device acts like an ordinary serial port inside the virtual machine. This device communicates to the real serial port hardware in one of two modes: host pipe or host device.

In host pipe mode, the path attribute specifies the path to the pipe on the host computer that represents a serial port. The server attribute determines if this pipe is created by the virtual machine process at machine startup or it must already exist before starting machine execution.

In host device mode, the path attribute specifies the name of the serial port device on the host computer.

There is also a third communication mode: the disconnected mode. In this mode, the guest OS running inside the virtual machine will be able to detect the serial port, but all port write operations will be discarded and all port read operations will return no data.

See also:
  IMachine::getSerialPort

Interface ID:
  `{937F6970-5103-4745-B78E-D28DCF1479A8}`

## Member Data Documentation

readonly attribute unsigned long ISerialPort::slot

Slot number this serial port is plugged into.

Corresponds to the value you pass to IMachine::getSerialPort to obtain this instance.

attribute boolean ISerialPort::enabled

Flag whether the serial port is enabled.

If disabled, the serial port will not be reported to the guest OS.

attribute unsigned long ISerialPort::IOBase

Base I/O address of the serial port.

attribute unsigned long ISerialPort::IRQ

IRQ number of the serial port.

attribute PortMode ISerialPort::hostMode

How is this port connected to the host.

Note:
  Changing this attribute may fail if the conditions for path are not met.

attribute boolean ISerialPort::server

Flag whether this serial port acts as a server (creates a new pipe on the host) or as a client (uses the existing pipe).

This attribute is used only when hostMode is PortMode_HostPipe.

attribute wstring ISerialPort::path

Path to the serial port's pipe on the host when ISerialPort::hostMode is PortMode_HostPipe, or the host serial device name when ISerialPort::hostMode is PortMode_HostDevice.

For both cases, setting a `null` or empty string as the attribute's value is an error. Otherwise, the value of this property is ignored.