예제 #1
0
void AtCommands::processNextCommand()
{
    // If we have a non-OK result, or no further commands, then stop now.
    if ( result != QAtResult::OK || cmdsPosn >= cmds.size() ) {
        cmdsPosn = cmds.size();
        frontEnd()->send( result );
        return;
    }

    // Remove one command from the queue.
    QString name = cmds[(cmdsPosn)++];
    QString params = cmds[(cmdsPosn)++];

    // Print the full command to the debug output stream.
    qLog(ModemEmulator) << "AT" + name + params;

    // Determine how to dispatch the command.
    QMap<QString, QSlotInvoker *>::Iterator iter;
    iter = invokers.find( name );
    if ( iter == invokers.end() ) {
        // Process the AT+CLAC command according to GSM 27.007, section 8.37.
        // We also supply AT* as a synonym for quicker debugging.
        if ( name == "+CLAC"
        #ifndef QTOPIA_AT_STRICT
            || name == "*"
        #endif
            ) {
            for ( iter = invokers.begin();
                  iter != invokers.end(); ++iter ) {
                send( "AT" + iter.key() );
            }
            send( "AT+CLAC" );
        #ifndef QTOPIA_AT_STRICT
            send( "AT*" );
        #endif
            done( QAtResult::OK );
            return;
        }

        // We don't know how to process this command, so error out.
        // This will stop any further commands from being processed.
        cmdsPosn = cmds.size();
        frontEnd()->send( QAtResult::Error );
        return;
    }

    // Notify the call manager which handler will be talking to it
    // to properly deliver deferred results back to this handler.
    manager()->callManager()->setHandler( this );

    // Dispatch the command to the associated slot.
    QList<QVariant> args;
    args += QVariant( params );
    iter.value()->invoke( args );
}
예제 #2
0
// Deferred result code from the call manager.
void AtCommands::deferredResult
        ( AtCommands *handler, QAtResult::ResultCode result )
{
    if ( handler != this )
        return;

    //if we have a connect we forward the raw data traffic
    if ( dataCallRequested && result == QAtResult::Connect ) {
        dataCallRequested = false;
        frontEnd()->setState( AtFrontEnd::OnlineData );
        if (cmdsPosn >= cmds.size()) {
            this->result = result;
            cmdsPosn = cmds.size();
            frontEnd()->send( result );
            return;
        } else {
            qLog(ModemEmulator) << "Data call: Connected but more commands pending";
        }
    }
    done( result );
}
예제 #3
0
void ExtractFragmentsDialog::accept()
{
    fillOperationFromUI();
    _errorMessage = "" ;
    if(!checkOperationParameters()) {
        return ;
    }
    if(_operation.isFilterTextForPath()) {
        if(!Utils::askYN(this, tr("This opertation fill take out some text from the result. Do you want to continue?"))) {
            return ;
        }
    }
    _operation.saveSettings();
    ExtractionFrontEnd frontEnd(&_operation, this);
    frontEnd.exec();
    QDialog::accept();
}
예제 #4
0
int main(int argc, char *argv[]){

  if (argc < 2){

    cout << "You should at least specify a query " << endl;

  }
  else {

    try {
      IndexCliFrontEnd frontEnd(argc, argv);
      frontEnd.doSearch();
    } catch (ocfa::misc::OcfaException &e){

      cout << e.what();
    }
  }
}
예제 #5
0
void AtCommands::send( const QString& line )
{
    frontEnd()->send( line );
}
예제 #6
0
AtOptions *AtCommands::options() const
{
    return frontEnd()->options();
}