summaryrefslogtreecommitdiffstats
path: root/wifi/interface_wireless.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /wifi/interface_wireless.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'wifi/interface_wireless.h')
-rw-r--r--wifi/interface_wireless.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/wifi/interface_wireless.h b/wifi/interface_wireless.h
new file mode 100644
index 00000000..029a8156
--- /dev/null
+++ b/wifi/interface_wireless.h
@@ -0,0 +1,125 @@
+/***************************************************************************
+ stuff.h - description
+ -------------------
+ begin : Mon Aug 19 2002
+ copyright : (C) 2002 by Stefan Winter
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef INTERFACE_WIRELESS_H
+#define INTERFACE_WIRELESS_H
+
+#include "config.h"
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qtable.h>
+
+#ifndef WITHOUT_ARTS
+#include <arts/iomanager.h>
+#include <arts/dispatcher.h>
+#endif
+
+const int POLL_DELAY_MS = 250; // how much time between device polls
+const int MAX_HISTORY = 240; // number of device states to be saved
+
+class Interface_wireless:public QObject
+{
+Q_OBJECT public:
+ Interface_wireless (QStringList * ignoreInterfaces);
+ virtual ~ Interface_wireless() { };
+
+ virtual bool get_device_freq (double &freq);
+ // true: device returned valid frequency
+ virtual bool get_mode (int &mode);
+ // true: device returned valid mode info
+ virtual bool get_key (QString & key, int &size, int &flags);
+ // true: device has set up a valid crypto key
+ virtual QString get_essid ();
+ virtual bool get_AP_info (QString & mac, QString & ip);
+ // true: could retrieve IP, false: returned IP info invalid
+ virtual QString get_IP_info ();
+ virtual double get_bitrate ();
+ virtual QString get_interface_name ();
+ // if no device is attached, return empty QString
+ virtual bool get_current_quality (int &sig, int &noi, int &qua);
+ // quality info is only valid when true
+ virtual QTable* get_available_networks () = 0;
+ virtual bool get_has_txpower();
+ virtual int get_txpower_disabled();
+ virtual void setActiveDevice( QString device ) = 0;
+ // stats
+ int sigLevel[MAX_HISTORY];
+ int sigLevelMin, sigLevelMax;
+ int noiseLevel[MAX_HISTORY];
+ int noiseLevelMin, noiseLevelMax;
+ int qual[MAX_HISTORY];
+ bool valid[MAX_HISTORY];
+ int current;
+
+public slots:
+ virtual bool poll_device_info () = 0;
+
+signals:
+ void interfaceChanged ();
+ void strengthChanged ();
+ void statusChanged ();
+ void modeChanged ();
+ void speedChanged ();
+ void essidChanged (QString essid);
+ void txPowerChanged ();
+ void statsUpdated ();
+protected:
+ bool already_warned;
+ // device info
+ bool has_frequency;
+ float frequency;
+ bool has_mode;
+ int mode;
+ bool has_key;
+ QString key;
+ int key_size;
+ int key_flags;
+ QString essid;
+ QString access_point_address;
+ QString ip_address;
+ double bitrate;
+ QString interface_name;
+ int socket;
+ bool has_range;
+ int range;
+ QStringList * ignoreInterfaces;
+ bool has_txpower;
+ int txpower_disabled;
+};
+
+#ifndef WITHOUT_ARTS
+
+void sinus_wave (double frequency);
+
+class MyTimeNotify:public
+ Arts::TimeNotify
+{
+public:
+ Arts::Dispatcher * test;
+ MyTimeNotify (Arts::Dispatcher * siff)
+ {
+ test = siff;
+ };
+ void notifyTime ();
+};
+
+#endif
+
+QString whois (const char *MAC_ADR, QStringList APList);
+
+#endif /* INTERFACE_WIRELESS_H */