commandscheduler.h
00001 #ifndef COMMANDSCHEDULER_H
00002 #define COMMANDSCHEDULER_H
00003
00004
00005 #include <qobject.h>
00006 #include <qptrlist.h>
00007
00008 #include "atcommand.h"
00009 #include "commandset.h"
00010
00011 class Modem;
00012
00013 class CommandScheduler : public QObject {
00014 Q_OBJECT
00015 public:
00016 CommandScheduler (Modem *modem,QObject *parent = 0, const char *name = 0);
00017
00018 void execute(const QString &command);
00019 void execute(ATCommand *command);
00020 void executeId(const QString &id);
00021
00022 Modem *modem() { return mModem; }
00023 CommandSet *commandSet() { return &mCommandSet; }
00024
00025 bool loadProfile(const QString& filename);
00026 bool saveProfile(const QString& filename);
00027
00028 signals:
00029 void result(const QString &);
00030 void commandProcessed(ATCommand *);
00031
00032 private slots:
00033 void processOutput(const char *line);
00034
00035 private:
00036 void sendCommand(const QString &command);
00037 void nextCommand();
00038
00039 private:
00040 Modem *mModem;
00041
00042 CommandSet mCommandSet;
00043
00044 ATCommand *mLastCommand;
00045
00046 QPtrList<ATCommand> mCommandQueue;
00047
00048 enum State { WAITING, PROCESSING };
00049 State mState;
00050
00051 QString mResult;
00052 };
00053
00054 #endif
This file is part of the documentation for kdelibs Version 3.1.4.