Home · All Classes · Annotated · Functions

QRawModemChannel Class Reference

The QRawModemChannel class provides raw access to a data channel. More...

#include <QRawModemChannel>

Inherits QSerialIODevice.

Public Types

Public Functions

Signals

Protected Functions

Additional Inherited Members


Detailed Description

The QRawModemChannel class provides raw access to a data channel.

The QRawModemChannel class allows an application to directly access an AT-based modem for data, fax, video, etc. The data is delivered directly to the application for processing.

This feature is not recommended if the qtopiaphone library already has an appropriate API for the function that you wish to perform. For example, GPRS support is already built into qtopiaphone.

The raw modem channel appears to the application as a virtual serial device. Data can be read or written using the usual QIODevice methods. Modem control signals such as DTR, RTS, DCD, etc, can be queried and adjusted.

See also QPhoneLine and QRawModem.


Member Type Documentation

enum QRawModemChannel::DetachReason

This enum defines the reason why a channel became detached.

ConstantValueDescription
QRawModemChannel::Closed0The application called QRawModemChannel::close().
QRawModemChannel::Busy1The channel is busy because some other application is currently accessing it. There are typically limitations on how many channels can be active at once on a modem. Different types of channels can block each other; for example, data calls may not be possible if a GPRS session is active. The "Busy" reason code indicates that a retry at some future time may be successful.
QRawModemChannel::Unsupported2The requested type of channel is not supported, and further retries will also be unsuccessful.
QRawModemChannel::Interrupted3The channel was interrupted in some way that caused the connection to be severed; for example, a modem reset.

enum QRawModemChannel::Type

This enum defines the type of raw modem channel that is requested. This is intended as a hint, because some modems need to create different channels depending upon the intended use.

ConstantValueDescription
QRawModemChannel::Data0Regular data connection.
QRawModemChannel::Fax1Fascimile data will be sent over the channel.
QRawModemChannel::Video2Live streaming video will be sent over the channel.
QRawModemChannel::External3The data will be forwarded to an external serial port to allow a connected device to directly access the modem.
QRawModemChannel::Other4Some other kind of data will be sent over the channel.


Member Function Documentation

QRawModemChannel::QRawModemChannel ( QObject * parent = 0 )

Construct a new raw modem channel object attached to parent.

QRawModemChannel::~QRawModemChannel ()

Destruct a raw modem channel object.

void QRawModemChannel::attach ( QPhoneLine & line, Type type, bool flowControl = false )

Attach to a raw modem channel of a particular type on a particular phone line. This object will respond with the "attached()" signal once the channel is ready to accept data. The "detached()" signal will be emitted if the channel could not be established for some reason.

If flowControl is true, then the underlying implementation should handle CTS/RTS flow control on the channel automatically. If flowControl is false, then the application is responsible for flow control if it is important to its requirements.

void QRawModemChannel::attached ()   [signal]

Signal that is emitted when the channel attaches.

qint64 QRawModemChannel::bytesAvailable () const   [virtual]

Determine how many bytes are currently available to be read from the raw modem channel.

Reimplemented from QIODevice.

bool QRawModemChannel::carrier () const   [virtual]

Determine the current state of the modem channel's carrier (DCD) signal.

Reimplemented from QSerialIODevice.

void QRawModemChannel::chat ( const QString & cmd, QObject * target = 0, const char * slot = 0 )

Issue an AT command, cmd, on this raw modem channel, and send the response to the indicated slot on target. This is typically used to perform connection setup prior to entering data mode.

Some modems require that connection setup be performed on the main control channel, rather than the data channel. The chat() function will take care of this detail automatically.

While a chat is in progress that uses the data channel, the readyRead() signal will be suppressed. The caller should refrain from reading or writing bytes to the channel until after the chat is complete and the readyRead() signal arrives. Reading bytes from or writing bytes to the channel may interfere with the chat process.

void QRawModemChannel::close ()   [virtual]

Close a raw modem channel. It is assumed that the caller has already taken appropriate steps to inform the modem that the data call has ended (e.g. dropping DTR, sending a hangup AT command, etc).

Reimplemented from QIODevice.

bool QRawModemChannel::cts () const   [virtual]

Determine the current state of the modem channel's CTS signal.

Reimplemented from QSerialIODevice.

void QRawModemChannel::detached ( DetachReason reason )   [signal]

Signal that is emitted to give the reason that a channel was detached.

void QRawModemChannel::discard ()   [virtual]

Discard buffered data that hasn't been written to the underlying raw modem channel yet.

Reimplemented from QSerialIODevice.

bool QRawModemChannel::dsr () const   [virtual]

Determine the current state of the modem channel's DSR signal.

Reimplemented from QSerialIODevice.

bool QRawModemChannel::dtr () const   [virtual]

Determine the current state of the modem channel's DTR signal.

Reimplemented from QSerialIODevice.

See also setDtr().

bool QRawModemChannel::flush ()   [virtual]

Flush pending data to the raw modem channel.

qint64 QRawModemChannel::readData ( char * data, qint64 maxlen )   [virtual protected]

Read data from the raw modem channel into the buffer data. Up to maxlen bytes will be read.

Reimplemented from QIODevice.

bool QRawModemChannel::rts () const   [virtual]

Determine the current state of the modem channel's RTS signal.

Reimplemented from QSerialIODevice.

See also setRts().

void QRawModemChannel::setDtr ( bool value )   [virtual]

Set the current state of the modem channel's DTR signal to value.

Reimplemented from QSerialIODevice.

See also dtr().

void QRawModemChannel::setRts ( bool value )   [virtual]

Set the current state of the modem channel's RTS signal to value.

Reimplemented from QSerialIODevice.

See also rts().

qint64 QRawModemChannel::writeData ( const char * data, qint64 len )   [virtual protected]

Write len bytes to the raw modem channel from the buffer data.

Reimplemented from QIODevice.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7