| Home · All Classes · Annotated · Functions |
The QSerialPort class provides a simple serial device interface. More...
#include <QSerialPort>
Inherits QSerialIODevice.
The QSerialPort class provides a simple serial device interface.
This class manages a very simple serial device, which is accessed at a specific baud rate with no parity, 8 data bits, and 1 stop bit. It is intended for communicating with GSM modems and the like.
The recommended way to create an instance of this class is to call the QSerialPort::create() method.
See also QSerialIODevice.
Construct a new serial device handler object for the specified device at the given rate. After construction, it is necessary to call QSerialPort::open() to complete initialization.
If trackStatus is true, then the device should attempt to track changes in DSR, DCD, and CTS. This may require the use of a regular timeout, which will be detrimental to battery life.
Status tracking should only be enabled when absolutely required. It isn't required for modems that support GSM 07.10 multiplexing, as the multiplexing mechanism has its own method of tracking status changes that does not require the use of a timeout.
The device name is usually something like "/dev/ttyS0", but it can have the special form "sim:hostname", where "hostname" is the name of a host running a phone simulator daemon (usually localhost). The phone simulator mode is intended for debugging purposes only.
Destruct this serial device. If the device is currently open, it will be closed.
Return the number of bytes that are currently waiting to be read.
Reimplemented from QIODevice.
Get the current state of the DCD (carrier) modem status line.
Reimplemented from QSerialIODevice.
Close the serial device.
Reimplemented from QIODevice.
Create and open a serial device from a name of the form "device:rate". Returns NULL if the device could not be opened. The defaultRate parameter indicates the default rate to use if ":rate" was not included in the device name. If flowControl is true, then CTS/RTS flow control should be enabled on the device.
Get the current state of the CTS modem status line.
Reimplemented from QSerialIODevice.
Discard pending buffered data without transmitting it. The companion function QIODevice::flush() waits for the buffers to empty. This function will do nothing if the underlying implementation cannot discard buffers.
Reimplemented from QSerialIODevice.
Get the current state of the DSR modem status line.
Reimplemented from QSerialIODevice.
Get the current state of the DTR modem status line.
Reimplemented from QSerialIODevice.
See also setDtr().
Get the state of CTS/RTS flow control on the serial device. The default value is false.
See also setFlowControl().
Flush all buffered data to the physical serial device.
Determine if this device is valid.
Reimplemented from QSerialIODevice.
Open the serial device with the specified mode.
Reimplemented from QIODevice.
Get the serial device's baud rate.
Reimplemented from QSerialIODevice.
Read bytes from the serial port into the buffer data. Up to maxlen bytes of data will be read.
Reimplemented from QIODevice.
Get the current state of the RTS modem status line.
Reimplemented from QSerialIODevice.
See also setRts().
Set the state of the DTR modem status line to value.
Reimplemented from QSerialIODevice.
See also dtr().
Set the state of CTS/RTS flow control on the serial device to value. This must be called before QSerialPort::open(). Changes to the value after opening will be ignored.
See also flowControl().
Set the state of the RTS modem status line to value.
Reimplemented from QSerialIODevice.
See also rts().
Wait up to msecs milliseconds for the serial device to have data ready to read.
Reimplemented from QIODevice.
Write len bytes from the buffer data to the serial port.
Reimplemented from QIODevice.
| Copyright © 2006 Trolltech | Trademarks | Qtopia 4.1.7 |