summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/modem.h
authortille <tille>2003-05-22 15:08:21 (UTC)
committer tille <tille>2003-05-22 15:08:21 (UTC)
commit273857932d4d4af9bf78bfca92f2986163e5f4f6 (patch) (side-by-side diff)
treefd809cda2eefdbb3d39567f956513511cb43dd3d /noncore/settings/networksettings/ppp/modem.h
parent4364269ddceef65bf06f475e2dcface882d37ed4 (diff)
downloadopie-273857932d4d4af9bf78bfca92f2986163e5f4f6.zip
opie-273857932d4d4af9bf78bfca92f2986163e5f4f6.tar.gz
opie-273857932d4d4af9bf78bfca92f2986163e5f4f6.tar.bz2
finds the modem of my laptop now,
thanks to the kppp team
Diffstat (limited to 'noncore/settings/networksettings/ppp/modem.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/modem.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/ppp/modem.h b/noncore/settings/networksettings/ppp/modem.h
new file mode 100644
index 0000000..c23524a
--- a/dev/null
+++ b/noncore/settings/networksettings/ppp/modem.h
@@ -0,0 +1,98 @@
+/*
+ * kPPP: A pppd Front End for the KDE project
+ *
+ * $Id$
+ *
+ * Copyright (C) 1997 Bernd Johannes Wuebben
+ * wuebben@math.cornell.edu
+ *
+ * This file was added by Harri Porten <porten@tu-harburg.de>
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _MODEM_H_
+#define _MODEM_H_
+
+#include <qdir.h>
+
+#include <sys/types.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <qsocketnotifier.h>
+
+//#include <config.h>
+
+void alarm_handler(int);
+const char *pppdPath();
+
+class Modem : public QObject {
+ Q_OBJECT
+public:
+ Modem();
+ ~Modem();
+
+ const QString getDevice() {return device;};
+ void setDevice(const QString dev) {device = dev;};
+
+ bool opentty();
+ bool closetty();
+ bool hangup();
+ bool writeChar(unsigned char);
+ bool writeLine(const char *);
+ bool dataMode() const { return data_mode; }
+ void setDataMode(bool set) { data_mode = set; }
+ const QString modemMessage();
+ speed_t modemspeed();
+ static QString parseModemSpeed(const QString &);
+ void notify(const QObject *, const char *);
+ void stop();
+ void flush();
+
+ int lockdevice();
+ void unlockdevice();
+
+public:
+ static Modem *modem;
+
+signals:
+ void charWaiting(unsigned char);
+
+private slots:
+ void startNotifier();
+ void stopNotifier();
+ void readtty(int);
+
+private:
+ void escape_to_command_mode();
+ int openLockfile(QString,int);
+
+private:
+ QString device;
+ QString lockfile;
+ int modemfd;
+ QSocketNotifier *sn;
+ bool data_mode;
+ QString errmsg;
+ struct termios initial_tty;
+ struct termios tty;
+ bool modem_is_locked;
+};
+
+#endif
+
+