Contents

SerialPortInfo Class Reference

The SerialPortInfo class provides information about existing serial ports. More...

    #include <SerialPortInfo>

This class was introduced in SerialPort 5.0.

Public Functions

SerialPortInfo ()
SerialPortInfo ( const SerialPortInfo & other )
SerialPortInfo ( const SerialPort & port )
SerialPortInfo ( const QString & name )
~SerialPortInfo ()
QString description () const
bool isBusy () const
bool isNull () const
bool isValid () const
QString manufacturer () const
QString portName () const
QString productIdentifier () const
void swap ( SerialPortInfo & other )
QString systemLocation () const
QString vendorIdentifier () const
SerialPortInfo & operator= ( const SerialPortInfo & other )

Static Public Members

QList<SerialPortInfo> availablePorts ()
QList<qint32> standardRates ()

Detailed Description

The SerialPortInfo class provides information about existing serial ports.

Use the static functions to generate a list of SerialPortInfo objects. Each SerialPortInfo object in the list represents a single serial port and can be queried for the port name, system location, description, and manufacturer. The SerialPortInfo class can also be used as an input parameter for the setPort() method of the SerialPort class.

See also SerialPort.

Member Function Documentation

SerialPortInfo::SerialPortInfo ()

Constructs an empty SerialPortInfo object.

See also isNull().

SerialPortInfo::SerialPortInfo ( const SerialPortInfo & other )

Constructs a copy of other.

SerialPortInfo::SerialPortInfo ( const SerialPort & port )

Constructs a SerialPortInfo object from serial port.

SerialPortInfo::SerialPortInfo ( const QString & name )

Constructs a SerialPortInfo object from serial port name.

This constructor finds the relevant serial port among the available ones according to the port name name, and constructs the serial port info instance for that port.

SerialPortInfo::~SerialPortInfo ()

Destroys the SerialPortInfo object. References to the values in the object become invalid.

QList<SerialPortInfo> SerialPortInfo::availablePorts () [static]

Returns a list of available serial ports on the system.

QString SerialPortInfo::description () const

Returns the description string of the serial port, if available; otherwise returns an empty string.

bool SerialPortInfo::isBusy () const

Returns true if serial port is busy; otherwise returns false.

bool SerialPortInfo::isNull () const

Returns whether this SerialPortInfo object holds a serial port definition.

bool SerialPortInfo::isValid () const

Returns true if serial port is present on system; otherwise returns false.

QString SerialPortInfo::manufacturer () const

Returns the manufacturer string of the serial port, if available; otherwise returns an empty string.

QString SerialPortInfo::portName () const

Returns the name of the serial port.

QString SerialPortInfo::productIdentifier () const

Returns the product identifier string of the serial port in hexadecimal format, if available; otherwise returns an empty string.

QList<qint32> SerialPortInfo::standardRates () [static]

Returns a list of available standard baud rates supported by the current serial port.

void SerialPortInfo::swap ( SerialPortInfo & other )

Swaps SerialPortInfo other with this SerialPortInfo. This operation is very fast and never fails.

QString SerialPortInfo::systemLocation () const

Returns the system location of the serial port.

QString SerialPortInfo::vendorIdentifier () const

Returns the vendor identifier string of the serial port in hexadecimal format, if available; otherwise returns an empty string.

SerialPortInfo & SerialPortInfo::operator= ( const SerialPortInfo & other )

Sets the SerialPortInfo object to be equal to other.