From 3f28b7e0edb6115699b19f9db37b55f775b91dc7 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 16 Dec 2002 23:38:55 +0000 Subject: - updates to the config window - GUI now starts channelhopper and sniffer using the command line interface --- (limited to 'noncore/net/wellenreiter') diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 57ffd2a..e2f734a 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -11,22 +11,28 @@ 0 0 - 240 - 276 + 232 + 267 caption Form1 + + layoutMargin + + + layoutSpacing + margin - 11 + 4 spacing - 6 + 0 QLayoutWidget @@ -34,6 +40,9 @@ name Layout5 + + layoutSpacing + margin @@ -41,7 +50,7 @@ spacing - 6 + 2 QLabel @@ -80,6 +89,9 @@ name Layout7 + + layoutSpacing + margin @@ -87,7 +99,7 @@ spacing - 6 + 2 QComboBox @@ -139,7 +151,7 @@ enabled - false + true @@ -195,7 +207,7 @@ enabled - false + true @@ -221,7 +233,7 @@ enabled - false + true suffix @@ -248,7 +260,7 @@ enabled - false + true text @@ -263,7 +275,7 @@ enabled - false + true text @@ -278,7 +290,7 @@ enabled - false + true text @@ -293,6 +305,9 @@ name Layout6 + + layoutSpacing + margin @@ -300,7 +315,7 @@ spacing - 6 + 2 QLabel @@ -337,7 +352,10 @@ QLayoutWidget name - Layout8 + Layout5 + + + layoutSpacing @@ -346,7 +364,7 @@ spacing - 6 + -1 QCheckBox @@ -378,8 +396,40 @@ Enable Activity Display + + QCheckBox + + name + beepOnFound + + + text + Beep on new network + + + + + name + Spacer2 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 759d46d..c2db283 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h @@ -24,6 +24,7 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase public: WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); + }; #endif diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 5808e9c..764ef34 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -16,6 +16,15 @@ // Qt #include +#include +#include +#include + +// Qtopia + +#ifdef QWS +#include +#endif // Standard @@ -24,6 +33,7 @@ #include #include #include +#include // Local @@ -31,13 +41,14 @@ #include "scanlistitem.h" #include "logwindow.h" #include "hexwindow.h" +#include "configwindow.h" #include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! #include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! #include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) - : WellenreiterBase( parent, name, fl ) + : WellenreiterBase( parent, name, fl ), daemonRunning( false ) { logwindow->log( "(i) Wellenreiter has been started." ); @@ -149,15 +160,15 @@ bool Wellenreiter::hasMessage() void Wellenreiter::timerEvent( QTimerEvent* e ) { - qDebug( "checking for message..." ); + //qDebug( "checking for message..." ); if ( hasMessage() ) { - qDebug( "got message" ); + //qDebug( "got message from daemon" ); handleMessage(); } else { - qDebug( "no message..." ); + //qDebug( "no message..." ); } } @@ -237,21 +248,78 @@ void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, boo void Wellenreiter::buttonClicked() { + if ( daemonRunning ) + { + logwindow->log( "(i) Daemon has been stopped." ); + button->setText( "Start Scanning" ); + + // Stop daemon + + // find out pids of wellenreiterd and orinoco_hopper + + } + + else + { + + // get configuration from config window + + const QString& interface = configwindow->interfaceName->currentText(); + const QString& cardtype = configwindow->deviceType->currentText(); + const QString& interval = configwindow->hopInterval->cleanText(); + + if ( ( interface == "" ) ) + { + QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); + return; + } + + logwindow->log( "(i) Daemon has been started." ); + button->setText( "Stop Scanning" ); + +#ifdef QWS + + // set interface into monitor mode + + QString cmdline; + + cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); + system( cmdline ); + cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); + system( cmdline ); + + // start channel hopper + + cmdline = "orinoco_hopper "; + cmdline += interface; + cmdline += " -i "; + cmdline += interval; + //qDebug( "execute: %s", (const char*) cmdline ); + Global::execute( cmdline ); + + // start daemon + + cmdline = "wellenreiterd "; + cmdline += interface; + cmdline += " 3"; + //qDebug( "execute: %s", (const char*) cmdline ); + Global::execute( cmdline ); +#endif - // FIXME: communicate with daemon and set button text according to state + /* - button->setText( "Stop Scanning" ); + // add some test stations, so that we can see if the GUI part works - // add some test stations, so that we can see if the GUI part works + addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); + addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); + addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); + addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); + addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); - addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); - addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); - addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); - addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); - addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); - - QString command ("98"); + QString command ("98"); - //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); + //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); + */ + } } diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 61f7503..052a242 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -30,6 +30,8 @@ public: protected: virtual void timerEvent( QTimerEvent* ); + + bool daemonRunning; public slots: void buttonClicked(); -- cgit v0.9.0.2