Ejemplo n.º 1
0
NeoModemService::NeoModemService
    (const QString & service, QSerialIODeviceMultiplexer * mux,
     QObject * parent)
:  QModemService(service, mux, parent)
    , inputEvent("/dev/input/incoming")
    , inputNotifier(0)
{
    qDebug() << "Gta04ModemService::constructor";

    // Turn on dynamic signal quality notifications.
    // Register for "_OSIGQ" notifications to get signal quality updates.
    primaryAtChat()->registerNotificationType
        ("_OSIGQ:", this, SLOT(sigq(QString)));

    chat("AT+CSCS=\"GSM\"");    // GSM encoding
    chat("AT_OSQI=1");          // unsolicited reporting of antenna signal strength, e.g. "_OSIGQ: 3,0"
    chat("AT_OPCMENABLE=1");    // enable the PCM interface for voice calls
    chat("AT_OPSYS=0,2");       // disable UMTS, use only GSM

    // Modem input device - reports keys when modem generates interrupt (e.g.
    // on incoming call or sms).
    if(inputEvent.open(QIODevice::ReadOnly)) {
        inputNotifier = new QSocketNotifier(inputEvent.handle(), QSocketNotifier::Read, this);
        connect(inputNotifier, SIGNAL(activated(int)), this, SLOT(handleInputEvent()));
    }
Ejemplo n.º 2
0
NeoModemService::NeoModemService
    (const QString & service, QSerialIODeviceMultiplexer * mux,
     QObject * parent)
:  QModemService(service, mux, parent)
{
    qDebug() << "Gta04ModemService::constructor";

    // Turn on dynamic signal quality notifications.
    // Register for "_OSIGQ" notifications to get signal quality updates.
    primaryAtChat()->registerNotificationType
        ("_OSIGQ:", this, SLOT(sigq(QString)));

    chat("AT_OSQI=1");          // unsolicited reporting of antenna signal strength, e.g. "_OSIGQ: 3,0"
    chat("AT_OPCMENABLE=1");    // enable the PCM interface for voice calls
    chat("AT_OPSYS=0,2");       // disable UMTS, use only GSM
}
Ejemplo n.º 3
0
NeoModemService::NeoModemService
    (const QString & service, QSerialIODeviceMultiplexer * mux,
     QObject * parent)
:  QModemService(service, mux, parent)
    , inputEvent("/dev/input/incoming")
    , inputNotifier(0)
{
    qDebug() << "Gta04ModemService::constructor";

    // Turn on dynamic signal quality notifications.
    // Register for "_OSIGQ" notifications to get signal quality updates.
    primaryAtChat()->registerNotificationType
        ("_OSIGQ:", this, SLOT(sigq(QString)));

    // Determine AT_OPSYS value - by default disable UMTS, use only GSM 0,2
    // this can help reduce modem reenumerations.
    // Some references:
    // see [1] at the end of this source file
    // http://lists.goldelico.com/pipermail/gta04-owner/2013-August/004891.html
    // http://lists.goldelico.com/pipermail/gta04-owner/2013-September/004939.html
    QSettings cfg("Trolltech", "Modem");
    cfg.beginGroup("OPSYS");
    QString opsys = cfg.value("Value", "AT_OPSYS=0,2").toString();
    qLog(Modem) << "OPSYS value:" << opsys;

    chat("AT+CSCS=\"GSM\"");    // GSM encoding
    chat("AT_OSQI=1");          // unsolicited reporting of antenna signal strength, e.g. "_OSIGQ: 3,0"
    chat("AT_OPCMENABLE=1");    // enable the PCM interface for voice calls
    chat(opsys);

    // Modem input device - reports keys when modem generates interrupt (e.g.
    // on incoming call or sms).
    if(inputEvent.open(QIODevice::ReadOnly)) {
        inputNotifier = new QSocketNotifier(inputEvent.handle(), QSocketNotifier::Read, this);
        connect(inputNotifier, SIGNAL(activated(int)), this, SLOT(handleInputEvent()));
    }