Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QSerialIODevice Class Reference
[QtBaseModule]

The QSerialIODevice class is the base for all serial devices. More...

    #include <QSerialIODevice>

Inherits QIODevice.

Inherited by QNullSerialIODevice, QSerialPort, and QSerialSocket.

Public Functions

Signals

Protected Slots

Additional Inherited Members


Detailed Description

The QSerialIODevice class is the base for all serial devices.

The abstract QSerialIODevice class extends QIODevice with functionality that is specific to serial devices. Subclasses implement specific kinds of serial devices. In particular, QSerialPort implements a physical hardware serial port.

See also QIODevice and QSerialPort.


Member Function Documentation

QSerialIODevice::QSerialIODevice ( QObject * parent = 0 )

Construct a new QSerialIODevice object attached to parent.

QSerialIODevice::~QSerialIODevice ()

Destruct a QSerialIODevice object.

void QSerialIODevice::abortDial ()   [virtual]

Abort an ATD dial command. The default implementation transmits a single CR character.

If a modem needs to change the way abortDial() works, a multiplexer plug-in should be written which overrides the abortDial() function on the channels that need different abort logic.

See also QSerialIODeviceMultiplexerPlugin.

QAtChat * QSerialIODevice::atchat ()   [virtual]

Returns the modem AT command chat object for this serial device. This is an alternative to accessing the raw binary data via read() and write().

See also QAtChat.

bool QSerialIODevice::carrier () const   [pure virtual]

Returns true if the current state of the DCD (carrier) modem status line is active; otherwise returns false.

See also setCarrier() and carrierChanged().

void QSerialIODevice::carrierChanged ( bool value )   [signal]

Signal that is emitted when the state of the DCD (carrier) modem status line changes to value.

See also carrier().

bool QSerialIODevice::cts () const   [pure virtual]

Returns true if current state of the CTS modem status line is active; otherwise returns false.

See also ctsChanged().

void QSerialIODevice::ctsChanged ( bool value )   [signal]

Signal that is emitted when the state of the CTS modem status line changes to value.

See also cts().

void QSerialIODevice::discard ()   [pure virtual]

Discard pending buffered data without transmitting it. This function will do nothing if the underlying serial device implementation cannot discard buffers.

bool QSerialIODevice::dsr () const   [pure virtual]

Returns true if the current state of the DSR modem status line is active; otherwise returns false.

See also dsrChanged().

void QSerialIODevice::dsrChanged ( bool value )   [signal]

Signal that is emitted when the state of the DSR modem status line changes to value.

See also dsr().

bool QSerialIODevice::dtr () const   [pure virtual]

Returns true if the current state of the DTR modem status line is active; otherwise returns false.

See also setDtr().

void QSerialIODevice::internalReadyRead ()   [protected slot]

Emit the readyRead() signal. If a process is currently running on this device, then the readyRead() signal will be suppressed. Subclasses should call this slot rather than emit readyRead() directly.

bool QSerialIODevice::isSequential () const   [virtual]

Returns if this device is sequential in nature; false otherwise. Serial devices are always sequential.

Reimplemented from QIODevice.

bool QSerialIODevice::isValid () const   [virtual]

Returns true if this serial device can validly transfer data; false otherwise. If this function returns false, there is no point writing data to this device, or attempting to read data from it, because it will never give a useful result.

The default implementation returns the same value as isOpen(). The QNullSerialIODevice class overrides this to always return false, even if the device is technically open.

int QSerialIODevice::rate () const   [virtual]

Returns the serial device's baud rate. The default implementation returns 115200. Subclasses are expected to override this value.

void QSerialIODevice::ready ()   [signal]

Signal that is emitted when the device is ready to accept data after being opened. This signal will only be emitted if the waitForReady() function returns true.

See also waitForReady().

bool QSerialIODevice::rts () const   [pure virtual]

Returns true if the current state of the RTS modem status line is active; otherwise returns false.

See also setRts().

QProcess * QSerialIODevice::run ( const QStringList & arguments, bool addPPPdOptions )   [virtual]

Run a program with the supplied arguments, redirecting the device's data to stdin and stdout on the new process via a pseudo-tty. Redirection will stop when the process exits.

This function returns a QProcess object that can be used to control the new process. The caller is responsible for destroying this object when it is no longer required. Returns null if the process could not be started for some reason.

If addPPPdOptions is true, then the caller is attempting to start pppd. The base class implementation will insert the pseudo-tty's device name at the beginning of the command arguments.

Subclasses may override this method to run pppd directly on an underlying device.

The readyRead() signal will be suppressed while the process is running.

bool QSerialIODevice::setCarrier ( bool value )   [virtual]

Sets the DCD (carrier) modem status line to value. This is used by programs that accept incoming serial connections to indicate to the peer machine that the carrier has dropped.

By default, this calls setDtr(), which supports the case where a null modem cable is connecting DTR to DSR and DCD on the peer machine. The caller should wait for a small delay and then setDtr(true) to restore DTR to the correct value.

This function will return false if it uses setDtr() to transmit the carrier change, or true if it can use a real carrier signal (QGsm0710MultiplexerServer supports real carrier signals).

See also carrier().

void QSerialIODevice::setDtr ( bool value )   [pure virtual]

Sets the state of the DTR modem status line to value.

See also dtr().

void QSerialIODevice::setRts ( bool value )   [pure virtual]

Sets the state of the RTS modem status line to value.

See also rts().

bool QSerialIODevice::waitForReady () const   [virtual]

Returns true if the caller should wait for the ready() signal to be emitted before sending data on this device. Returns false if the caller can send data immediately after calling open(). The default implementation returns false.

See also ready().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3