summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 8a9e55d..448b52b 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -448,61 +448,66 @@ void Wellenreiter::startClicked()
448 sniffing = true; 448 sniffing = true;
449 emit( startedSniffing() ); 449 emit( startedSniffing() );
450 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title 450 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
451 else 451 else
452 { 452 {
453 assert( parent() ); 453 assert( parent() );
454 ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); 454 ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
455 } 455 }
456} 456}
457 457
458 458
459void Wellenreiter::timerEvent( QTimerEvent* ) 459void Wellenreiter::timerEvent( QTimerEvent* )
460{ 460{
461 qDebug( "Wellenreiter::timerEvent()" ); 461 qDebug( "Wellenreiter::timerEvent()" );
462 OPacket* p = pcap->next(); 462 OPacket* p = pcap->next();
463 if ( !p ) // no more packets available 463 if ( !p ) // no more packets available
464 { 464 {
465 stopClicked(); 465 stopClicked();
466 } 466 }
467 else 467 else
468 { 468 {
469 receivePacket( p ); 469 receivePacket( p );
470 delete p; 470 delete p;
471 } 471 }
472} 472}
473 473
474 474
475void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) 475void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
476{ 476{
477 if ( action == "TouchSound" ) 477 if ( action == "TouchSound" )
478 ODevice::inst()->touchSound(); 478 ODevice::inst()->touchSound();
479 else if ( action == "AlarmSound" ) 479 else if ( action == "AlarmSound" )
480 ODevice::inst()->alarmSound(); 480 ODevice::inst()->alarmSound();
481 else if ( action == "KeySound" ) 481 else if ( action == "KeySound" )
482 ODevice::inst()->keySound(); 482 ODevice::inst()->keySound();
483 else if ( action == "LedOn" ) 483 else if ( action == "LedOn" )
484 ODevice::inst()->setLedState( Led_Mail, Led_On ); 484 ODevice::inst()->setLedState( Led_Mail, Led_On );
485 else if ( action == "LedOff" ) 485 else if ( action == "LedOff" )
486 ODevice::inst()->setLedState( Led_Mail, Led_Off ); 486 ODevice::inst()->setLedState( Led_Mail, Led_Off );
487 else if ( action == "LogMessage" ) 487 else if ( action == "LogMessage" )
488 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 488 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
489 else if ( action == "MessageBox" ) 489 else if ( action == "MessageBox" )
490 QMessageBox::information ( this, "Notification!", 490 QMessageBox::information ( this, "Notification!",
491 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 491 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
492} 492}
493 493
494void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) 494void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr)
495{ 495{
496 // we need the interface too:
497 const QString iface = "wlan0";
496 qDebug( "joinNetwork() - %s, %s, %d, %s", 498 qDebug( "joinNetwork() - %s, %s, %d, %s",
497 (const char*) type, 499 (const char*) type,
498 (const char*) essid, 500 (const char*) essid,
499 channel, 501 channel,
500 (const char*) macaddr ); 502 (const char*) macaddr );
501 503
502 // TODO: Stop scanning here 504 // TODO: Stop scanning here
503 505
504 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); 506 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
505 msg << "test" << "test" << "test"; 507 msg << iface << QString("Mode") << type;
508 msg << iface << QString("ESSID") << essid;
509 msg << iface << QString("Channel") << channel;
510 msg << iface << QString("MacAddr") << macaddr;
506 511
507} 512}
508 513