Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 4ee9a35..4c1c972 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -229,29 +229,24 @@ void Wellenreiter::buttonClicked() logwindow->log( "(i) Daemon has been stopped." ); button->setText( "Start Scanning" ); // Stop daemon - ugly for now... later better - system( "killall orinoco_hopper" ); system( "killall wellenreiterd" ); // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); const QString& cardtype = configwindow->deviceType->currentText(); - const QString& interval = configwindow->hopInterval->cleanText(); + //const QString& interval = configwindow->hopInterval->cleanText(); // reset the card trying to get into a usable state again QString cmdline; - cmdline.sprintf( "iwpriv %s monitor 1", (const char*) interface ); - system( cmdline ); - cmdline.sprintf( "iwpriv %s monitor 1 6", (const char*) interface ); - system( cmdline ); - cmdline.sprintf( "ifconfig %s -promisc", (const char*) interface ); + cmdline.sprintf( "cardctl eject; cardctl insert" ); system( cmdline ); cmdline.sprintf( "killall -14 dhcpcd" ); system( cmdline ); cmdline.sprintf( "killall -10 udhcpc" ); // message the user @@ -259,55 +254,33 @@ void Wellenreiter::buttonClicked() QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); } else { - logwindow->log( "(i) Daemon has been started." ); - daemonRunning = true; - button->setText( "Stop Scanning" ); - // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); - const QString& cardtype = configwindow->deviceType->currentText(); - const QString& interval = configwindow->hopInterval->cleanText(); + const int cardtype = configwindow->daemonDeviceType(); + const int interval = configwindow->daemonHopInterval(); - if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) + if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) { QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); return; } - // set interface into monitor mode - /* Global::Execute definitely does not work very well with non-gui stuff! :( */ + // start wellenreiterd 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.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); - cmdline = "orinoco_hopper "; - cmdline += interface; - cmdline += " -i "; - cmdline += interval; - cmdline += " &"; - qDebug( "execute: %s", (const char*) cmdline ); + qDebug( "about to execute '%s' ...", (const char*) cmdline ); system( cmdline ); - qDebug( "done" ); - - // start daemon - - cmdline = "wellenreiterd "; - cmdline += interface; - cmdline += " 3"; - cmdline += " &"; + qDebug( "done!" ); - qDebug( "execute: %s", (const char*) cmdline ); - system( cmdline ); - qDebug( "done" ); + logwindow->log( "(i) Daemon has been started." ); + daemonRunning = true; + button->setText( "Stop Scanning" ); } } |