summaryrefslogtreecommitdiff
path: root/libopie2/examples/opienet/miniwellenreiter
authormickeyl <mickeyl>2003-12-01 22:44:38 (UTC)
committer mickeyl <mickeyl>2003-12-01 22:44:38 (UTC)
commit7a7683d435cfbb4fa2d6ed99fd4a94d388402aec (patch) (side-by-side diff)
tree1a34de131d935f34dd2622e3606ba664a7783e24 /libopie2/examples/opienet/miniwellenreiter
parenta4a47fca8badeca2b1aae51b39295ccdc8782c4f (diff)
downloadopie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.zip
opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.gz
opie-7a7683d435cfbb4fa2d6ed99fd4a94d388402aec.tar.bz2
slowly start to refactor & cleanup libopie2 before merging it with libopie1
Diffstat (limited to 'libopie2/examples/opienet/miniwellenreiter') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp25
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro4
2 files changed, 22 insertions, 7 deletions
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index c49daa0..eb2e8e8 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -31,7 +31,7 @@ class Wellenreiter : public QApplication
{
Q_OBJECT
public:
- Wellenreiter( int argc, char** argv ) : QApplication( argc, argv )
+ Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 )
{
ONetwork* net = ONetwork::instance();
@@ -56,9 +56,9 @@ public:
exit( -1 );
}
- printf( "****************************************************\n" );
- printf( "* Wellenreiter mini edition 1.0 (C) 2003 M-M-M *\n" );
- printf( "****************************************************\n" );
+ printf( "*******************************************************************\n" );
+ printf( "* Wellenreiter mini edition 1.0.0 (C) 2003 Michael 'Mickey' Lauer *\n" );
+ printf( "*******************************************************************\n" );
printf( "\n\n" );
QString interface( argv[1] );
@@ -105,6 +105,12 @@ public:
if ( driver == "orinoco" )
new OOrinocoMonitoringInterface( wiface, false );
else
+ if ( driver == "hostap" )
+ new OHostAPMonitoringInterface( wiface, false );
+ else
+ if ( driver == "wlan-ng" )
+ new OWlanNGMonitoringInterface( wiface, false );
+ else
{
printf( "Unknown driver. Exiting\n" );
exit( -1 );
@@ -112,7 +118,7 @@ public:
// enable monitoring mode
printf( "Enabling monitor mode...\n" );
- //wiface->setMonitorMode( true );
+ wiface->setMode( "monitor" );
// open a packet capturer
cap = new OPacketCapturer();
@@ -131,12 +137,20 @@ public:
// connect
connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
+ // timer
+ startTimer( 1000 );
}
~Wellenreiter() {};
public slots:
+ virtual void timerEvent(QTimerEvent* e)
+ {
+ wiface->setChannel( channel++ );
+ if ( channel == 14 ) channel = 1;
+ }
+
void receivePacket(OPacket* p)
{
if (!p)
@@ -203,6 +217,7 @@ public slots:
private:
OPacketCapturer* cap;
OWirelessNetworkInterface* wiface;
+ int channel;
};
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro
index 7ce535c..b2c5c14 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.pro
@@ -6,8 +6,8 @@ INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopiecore2 -lopienet2
TARGET = miniwellenreiter
-MOC_DIR = moc
-OBJECTS_DIR = obj
+MOC_DIR = moc
+OBJECTS_DIR = obj
include ( $(OPIEDIR)/include.pro )