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

QSerialIODeviceMultiplexer Class Reference
[QtBaseModule]

The QSerialIODeviceMultiplexer class provides a base class for serial device multiplexing on AT-based modems. More...

    #include <QSerialIODeviceMultiplexer>

Inherits QObject.

Inherited by QGsm0710Multiplexer, QMultiPortMultiplexer, and QNullSerialIODeviceMultiplexer.

Public Functions

Static Public Members

Additional Inherited Members


Detailed Description

The QSerialIODeviceMultiplexer class provides a base class for serial device multiplexing on AT-based modems.

A multiplexer manages one or more channels, identified by their names. The standard names are:

primaryPrimary AT command channel.
secondarySecondary AT command channel for slow AT commands. Should return the same as primary if there is no explicit secondary channel on the modem.
dataData channel for GPRS and similar data sessions. Should return null if there is no explicit data channel on the modem.
datasetupChannel for data call setup commands. Should return null if data is null.

Sometimes these channels may overlap. For example, datasetup may be the same as data if data call setup should be sent on the same channel as the data itself; or it may be the same as primary if data call setup should be sent on the primary AT command channel.

If a channel is not supported, the channel() method returns null. The primary and secondary channels must always be supported, even if they are the same.

Auxiliary channels can be created and released dynamically. The channel name should begin with aux. The rest of the name gives an indication as to the type of auxiliary data: auxdata, auxvideo, etc. The multiplexer may return a pre-defined channel (e.g. data) if the number of channels on the multiplexer is limited. The QSerialIODevice::isOpen() method can be used to determine if the channel is already in use, or is free for auxiliary traffic.

Several standard multiplexer implementations are provided with Qtopia:

QGsm0710MultiplexerImplementation of 3GPP TS 07.10/27.010 multiplexing.
QMultiPortMultiplexerImplementation of multiplexing over several serial ports, where each port corresponds to a single channel.
QNullSerialIODeviceMultiplexerNull multiplexer with a single channel wrapped around a serial port, for modems that do not support proper multiplexing.

New multiplexer implementations can be added using a multiplexer plug-in. See the Tutorial: Writing a Multiplexer Plug-in for more information on how to write a multiplexer plug-in.

See also QGsm0710Multiplexer, QMultiPortMultiplexer, QNullSerialIODeviceMultiplexer, and QSerialIODeviceMultiplexerPlugin.


Member Function Documentation

QSerialIODeviceMultiplexer::QSerialIODeviceMultiplexer ( QObject * parent = 0 )

Construct a new multiplexer attached to parent.

QSerialIODeviceMultiplexer::~QSerialIODeviceMultiplexer ()

Destruct a multiplexer.

QSerialIODevice * QSerialIODeviceMultiplexer::channel ( const QString & name )   [pure virtual]

Returns the serial device corresponding the channel name. If the indicated channel does not exist, it should be created if possible. Some multiplexers may not be able to create all types of channels, and will return null for unsupported channels. All multiplexers must support at least primary and secondary.

bool QSerialIODeviceMultiplexer::chat ( QSerialIODevice * device, const QString & cmd )   [static]

Sends cmd to the specified serial device and wait for the response. Returns true if the command responds with OK, or false if the command responds with an error or it times out.

This function is typically used by multiplexing plug-ins to turn on multiplexing prior to creating a subclass of QSerialIODeviceMultiplexer.

See also chatWithResponse().

QString QSerialIODeviceMultiplexer::chatWithResponse ( QSerialIODevice * device, const QString & cmd )   [static]

Sends cmd to the specified serial device and wait for the response. Returns a null string if the command fails or times out, or the contents of the command's response if OK.

This function can be used to issue commands such as AT+CGMI where the caller is interested in the text of the response.

See also chat().

QSerialIODeviceMultiplexer * QSerialIODeviceMultiplexer::create ( QSerialIODevice * device = 0 )   [static]

Create a multiplexer for handling the communications traffic on device. If device is null, a default device handler will be created based on the QTOPIA_PHONE_DEVICE setting.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3