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 | |||
@@ -233,5 +233,4 @@ void Wellenreiter::buttonClicked() | |||
233 | // Stop daemon - ugly for now... later better | 233 | // Stop daemon - ugly for now... later better |
234 | 234 | ||
235 | system( "killall orinoco_hopper" ); | ||
236 | system( "killall wellenreiterd" ); | 235 | system( "killall wellenreiterd" ); |
237 | 236 | ||
@@ -240,14 +239,10 @@ void Wellenreiter::buttonClicked() | |||
240 | const QString& interface = configwindow->interfaceName->currentText(); | 239 | const QString& interface = configwindow->interfaceName->currentText(); |
241 | const QString& cardtype = configwindow->deviceType->currentText(); | 240 | const QString& cardtype = configwindow->deviceType->currentText(); |
242 | const QString& interval = configwindow->hopInterval->cleanText(); | 241 | //const QString& interval = configwindow->hopInterval->cleanText(); |
243 | 242 | ||
244 | // reset the card trying to get into a usable state again | 243 | // reset the card trying to get into a usable state again |
245 | 244 | ||
246 | QString cmdline; | 245 | QString cmdline; |
247 | cmdline.sprintf( "iwpriv %s monitor 1", (const char*) interface ); | 246 | cmdline.sprintf( "cardctl eject; cardctl insert" ); |
248 | system( cmdline ); | ||
249 | cmdline.sprintf( "iwpriv %s monitor 1 6", (const char*) interface ); | ||
250 | system( cmdline ); | ||
251 | cmdline.sprintf( "ifconfig %s -promisc", (const char*) interface ); | ||
252 | system( cmdline ); | 247 | system( cmdline ); |
253 | cmdline.sprintf( "killall -14 dhcpcd" ); | 248 | cmdline.sprintf( "killall -14 dhcpcd" ); |
@@ -263,15 +258,11 @@ void Wellenreiter::buttonClicked() | |||
263 | { | 258 | { |
264 | 259 | ||
265 | logwindow->log( "(i) Daemon has been started." ); | ||
266 | daemonRunning = true; | ||
267 | button->setText( "Stop Scanning" ); | ||
268 | |||
269 | // get configuration from config window | 260 | // get configuration from config window |
270 | 261 | ||
271 | const QString& interface = configwindow->interfaceName->currentText(); | 262 | const QString& interface = configwindow->interfaceName->currentText(); |
272 | const QString& cardtype = configwindow->deviceType->currentText(); | 263 | const int cardtype = configwindow->daemonDeviceType(); |
273 | const QString& interval = configwindow->hopInterval->cleanText(); | 264 | const int interval = configwindow->daemonHopInterval(); |
274 | 265 | ||
275 | if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) | 266 | if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) |
276 | { | 267 | { |
277 | QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); | 268 | QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); |
@@ -279,34 +270,16 @@ void Wellenreiter::buttonClicked() | |||
279 | } | 270 | } |
280 | 271 | ||
281 | // set interface into monitor mode | 272 | // start wellenreiterd |
282 | /* Global::Execute definitely does not work very well with non-gui stuff! :( */ | ||
283 | 273 | ||
284 | QString cmdline; | 274 | QString cmdline; |
285 | cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); | 275 | cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); |
286 | system( cmdline ); | ||
287 | cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); | ||
288 | system( cmdline ); | ||
289 | |||
290 | // start channel hopper | ||
291 | 276 | ||
292 | cmdline = "orinoco_hopper "; | 277 | qDebug( "about to execute '%s' ...", (const char*) cmdline ); |
293 | cmdline += interface; | ||
294 | cmdline += " -i "; | ||
295 | cmdline += interval; | ||
296 | cmdline += " &"; | ||
297 | qDebug( "execute: %s", (const char*) cmdline ); | ||
298 | system( cmdline ); | 278 | system( cmdline ); |
299 | qDebug( "done" ); | 279 | qDebug( "done!" ); |
300 | |||
301 | // start daemon | ||
302 | |||
303 | cmdline = "wellenreiterd "; | ||
304 | cmdline += interface; | ||
305 | cmdline += " 3"; | ||
306 | cmdline += " &"; | ||
307 | 280 | ||
308 | qDebug( "execute: %s", (const char*) cmdline ); | 281 | logwindow->log( "(i) Daemon has been started." ); |
309 | system( cmdline ); | 282 | daemonRunning = true; |
310 | qDebug( "done" ); | 283 | button->setText( "Stop Scanning" ); |
311 | 284 | ||
312 | } | 285 | } |