3 files changed, 26 insertions, 10 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 ) diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 06b8b19..4763316 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -110,15 +110,16 @@ int main( int argc, char** argv ) // monitor test - /* + qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); iface->setMode( "monitor" ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); - sleep( 1 ); */ + sleep( 1 ); - iface->setMode( "master" ); + iface->setChannel( 1 ); + iface->setMode( "managed" ); //sleep( 1 ); qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |