summaryrefslogtreecommitdiff
authortille <tille>2003-06-21 15:36:59 (UTC)
committer tille <tille>2003-06-21 15:36:59 (UTC)
commite1e6c04dfb5d2ac785b4b5b0ed21648eb4e4d03b (patch) (side-by-side diff)
tree1d95c13bf5def759982a73ea5f11637f0715097e
parent5f5accf337a109371296c6a78175734454165406 (diff)
downloadopie-e1e6c04dfb5d2ac785b4b5b0ed21648eb4e4d03b.zip
opie-e1e6c04dfb5d2ac785b4b5b0ed21648eb4e4d03b.tar.gz
opie-e1e6c04dfb5d2ac785b4b5b0ed21648eb4e4d03b.tar.bz2
send message cound to networksettings
it's working now on the Z
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 79773b3..dcf796f 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -388,135 +388,143 @@ void Wellenreiter::startClicked()
if ( cardtype != DEVTYPE_MANUAL )
iface->setMonitorMode( true );
if ( !iface->monitorMode() )
{
QMessageBox::warning( this, "Wellenreiter II",
tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) );
return;
}
}
// open pcap and start sniffing
if ( cardtype != DEVTYPE_FILE )
{
pcap->open( interface );
if ( configwindow->writeCaptureFile->isOn() )
{
QString dumpname( configwindow->captureFileName->text() );
dumpname.append( '-' );
dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
dumpname.append( ".wellenreiter" );
pcap->openDumpFile( dumpname );
}
else
{
pcap->open( interface );
}
}
else
{
pcap->open( QFile( interface ) );
}
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II",
tr( "Can't open packet capturer for '%1':\n" ).arg( iface->name() ) + QString(strerror( errno ) ));
return;
}
// set capturer to non-blocking mode
pcap->setBlocking( false );
// start channel hopper
if ( cardtype != DEVTYPE_FILE )
iface->setChannelHopping( 1000 ); //use interval from config window
if ( cardtype != DEVTYPE_FILE )
{
// connect socket notifier and start channel hopper
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
}
else
{
// start timer for reading packets
startTimer( 100 );
}
logwindow->log( "(i) Started Scanning." );
sniffing = true;
emit( startedSniffing() );
if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
else
{
assert( parent() );
( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
}
}
void Wellenreiter::timerEvent( QTimerEvent* )
{
qDebug( "Wellenreiter::timerEvent()" );
OPacket* p = pcap->next();
if ( !p ) // no more packets available
{
stopClicked();
}
else
{
receivePacket( p );
delete p;
}
}
void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
{
if ( action == "TouchSound" )
ODevice::inst()->touchSound();
else if ( action == "AlarmSound" )
ODevice::inst()->alarmSound();
else if ( action == "KeySound" )
ODevice::inst()->keySound();
else if ( action == "LedOn" )
ODevice::inst()->setLedState( Led_Mail, Led_On );
else if ( action == "LedOff" )
ODevice::inst()->setLedState( Led_Mail, Led_Off );
else if ( action == "LogMessage" )
logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
else if ( action == "MessageBox" )
QMessageBox::information( this, "Notification!",
QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
}
void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr)
{
if ( !iface )
{
QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) );
return;
}
if ( sniffing )
{
QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) );
return;
}
qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s",
(const char*) iface->name(),
(const char*) type,
(const char*) essid,
channel,
(const char*) macaddr );
QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
+ int count = 3;
+ qDebug("sending %d messages",count);
+ msg << QString("count") << QString::number(count);
+ qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() );
msg << QString(iface->name()) << QString("Mode") << type;
+ qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1());
msg << QString(iface->name()) << QString("ESSID") << essid;
+ qDebug("msg >%s< channel >%d<", iface->name(),channel);
msg << QString(iface->name()) << QString("Channel") << channel;
- msg << QString(iface->name()) << QString("MacAddr") << macaddr;
+// qDebug("msg >%s< mac >%s<", iface->name(),macaddr);
+// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
+
}