Beispiel #1
0
void QModemService::init( QSerialIODeviceMultiplexer *mux )
{
    d = new QModemServicePrivate();
    d->mux = mux;
    d->primaryAtChat = mux->channel( "primary" )->atchat();
    d->secondaryAtChat = mux->channel( "secondary" )->atchat();

    // Make sure that the primary command channel is open and valid.
    QSerialIODevice *primary = d->mux->channel( "primary" );
    if ( !primary->isOpen() )
        primary->open( QIODevice::ReadWrite );

    // Set a slightly different debug mode for the secondary channel,
    // to make it easier to see which command goes where.
    if ( d->primaryAtChat != d->secondaryAtChat )
        d->secondaryAtChat->setDebugChars( 'f', 't', 'n', '?' );

    connectToPost( "needsms", this, SLOT(needSms()) );
    connectToPost( "simready", this, SLOT(firstTimeInit()) );

    d->indicators = new QModemIndicators( this );

    // Listen for suspend() and wake() messages on QPE/ModemSuspend.
    QtopiaIpcAdaptor *suspend =
        new QtopiaIpcAdaptor( "QPE/ModemSuspend", this );
    QtopiaIpcAdaptor::connect( suspend, MESSAGE(suspend()),
                               this, SLOT(suspend()) );
    QtopiaIpcAdaptor::connect( suspend, MESSAGE(wake()),
                               this, SLOT(wake()) );
}
Beispiel #2
0
 void                loadDefaultState(void)                      { if (!m_commonCtrl.loadState(m_commonCtrl.getStateFileName(1))) firstTimeInit(); }