Qt Extended has a built-in implementation of GSM 07.10 that it will use if there isn't an explicit multiplexer plug-in provided. The default parameters are GSM 07.10 in Basic mode with a frame size of 31. The vendor can change these defaults by writing a multiplexer plug-in. The following example increases the frame size to 256:
Multiplexers That Use Multiple Serial Ports
Some GSM modules use multiple serial ports, one per channel. The QMultiPortMultiplexer class can be used to support such modules. As an example, consider a module with the following serial ports:
- /dev/mux0 Primary AT command channel.
- /dev/mux1 Secondary AT command channel.
- /dev/mux2 GPRS data channel.
To support such a module, first set QTOPIA_PHONE_DEVICE to /dev/mux0 in the custom.h file for the platform. Then the detect() and create() methods would be implemented as follows:
class MultiPortMultiplexerPlugin : public QSerialIODeviceMultiplexerPlugin
{
Q_OBJECT
public:
MultiPortMultiplexerPlugin( QObject *parent = 0 )
: QSerialIODeviceMultiplexerPlugin( parent ) {}
bool detect( QSerialIODevice *device );
QSerialIODeviceMultiplexer *create( QSerialIODevice *device );
};
bool MultiPortMultiplexerPlugin::detect( QSerialIODevice * )
{
return true;
}
QSerialIODeviceMultiplexer *MultiPortMultiplexerPlugin::create( QSerialIODevice *device )
{
QMultiPortMultiplexer *mux = new QMultiPortMultiplexer( device );
QSerialPort *secondary = QSerialPort::create( "/dev/mux1" );
mux->addChannel( "secondary", secondary );
QSerialPort *data = QSerialPort::create( "/dev/mux2" );
mux->addChannel( "data", data );
mux->addChannel( "datasetup", data );
return mux;
}
QTOPIA_EXPORT_PLUGIN( MultiPortMultiplexerPlugin )
The first parameter to QMultiPortMultiplexer::addChannel() is the name of the channel that is being set. It may be one of the following standard names:
- primary - primary AT command channel
- secondary - secondary AT command channel
- data GPRS - data channel
- datasetup - channel that receives GPRS setup commands.
Other channel names are possible. Refer to the documentation for QSerialIODeviceMultiplexer for further details.
Some modules only have one AT command channel, not two. For such modules, both primary and secondary should be set to the same value:
QMultiPortMultiplexer *mux = new QMultiPortMultiplexer( device );
mux->addChannel( "secondary", device );
Some modules require that GPRS setup commands such as AT+CGDCONT and ATD must be sent on the primary AT command channel, not the data channel. For such modules, datasetup should be set to the same value as primary.
Complex Multiplexing Over a Single Serial Port
The most complex kind of multiplexer is one which is neither a GSM 07.10 variant, nor a multi-port setup. The Wavecom multiplexer is an example of this kind of multiplexer.
Refer to the source code under <qt-extended-root-dir>/src/plugins/multiplexers/wavecom if you need to write a multiplexer of this kind. The source code for QGsm0710Multiplexer might also provide some clues as to how to handle this case.