4 files changed, 28 insertions, 10 deletions
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp index 74886fa..e8bf04f 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp | |||
@@ -89,18 +89,20 @@ public slots: | |||
89 | m = method; | 89 | m = method; |
90 | qDebug( "choosing method: %d", method ); | 90 | qDebug( "choosing method: %d", method ); |
91 | OConfig* g = OGlobal::config(); | 91 | OConfig* g = OGlobal::config(); |
92 | g->setGroup( "General" ); | 92 | g->setGroup( "General" ); |
93 | g->writeEntry( "debugMode", m ); | 93 | g->writeEntry( "debugMode", m ); |
94 | e->setText( OGlobalSettings::debugOutput() ); | 94 | e->setText( OGlobalSettings::debugOutput() ); |
95 | g->write(); | ||
95 | } | 96 | } |
96 | void updateDebugOutput() | 97 | void updateDebugOutput() |
97 | { | 98 | { |
98 | OConfig* g = OGlobal::config(); | 99 | OConfig* g = OGlobal::config(); |
99 | g->setGroup( "General" ); | 100 | g->setGroup( "General" ); |
100 | g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); | 101 | g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); |
102 | g->write(); | ||
101 | } | 103 | } |
102 | void emitInfoOutput() | 104 | void emitInfoOutput() |
103 | { | 105 | { |
104 | odebug << "This is a debug message" << oendl; | 106 | odebug << "This is a debug message" << oendl; |
105 | } | 107 | } |
106 | void emitWarningOutput() | 108 | void emitWarningOutput() |
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 | |||
@@ -28,13 +28,13 @@ QDict<Station> stations; | |||
28 | //======================== Application class =============================== | 28 | //======================== Application class =============================== |
29 | 29 | ||
30 | class Wellenreiter : public QApplication | 30 | class Wellenreiter : public QApplication |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | public: | 33 | public: |
34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ) | 34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) |
35 | { | 35 | { |
36 | 36 | ||
37 | ONetwork* net = ONetwork::instance(); | 37 | ONetwork* net = ONetwork::instance(); |
38 | 38 | ||
39 | if ( argc < 3 ) | 39 | if ( argc < 3 ) |
40 | { | 40 | { |
@@ -53,15 +53,15 @@ public: | |||
53 | } | 53 | } |
54 | ++it; | 54 | ++it; |
55 | } | 55 | } |
56 | exit( -1 ); | 56 | exit( -1 ); |
57 | } | 57 | } |
58 | 58 | ||
59 | printf( "****************************************************\n" ); | 59 | printf( "*******************************************************************\n" ); |
60 | printf( "* Wellenreiter mini edition 1.0 (C) 2003 M-M-M *\n" ); | 60 | printf( "* Wellenreiter mini edition 1.0.0 (C) 2003 Michael 'Mickey' Lauer *\n" ); |
61 | printf( "****************************************************\n" ); | 61 | printf( "*******************************************************************\n" ); |
62 | printf( "\n\n" ); | 62 | printf( "\n\n" ); |
63 | 63 | ||
64 | QString interface( argv[1] ); | 64 | QString interface( argv[1] ); |
65 | QString driver( argv[2] ); | 65 | QString driver( argv[2] ); |
66 | 66 | ||
67 | printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); | 67 | printf( "Trying to use '%s' as %s-controlled device...\n", (const char*) interface, (const char*) driver ); |
@@ -102,20 +102,26 @@ public: | |||
102 | printf( "Interface status is already promisc - good.\n" ); | 102 | printf( "Interface status is already promisc - good.\n" ); |
103 | 103 | ||
104 | // connect a monitoring strategy to the interface | 104 | // connect a monitoring strategy to the interface |
105 | if ( driver == "orinoco" ) | 105 | if ( driver == "orinoco" ) |
106 | new OOrinocoMonitoringInterface( wiface, false ); | 106 | new OOrinocoMonitoringInterface( wiface, false ); |
107 | else | 107 | else |
108 | if ( driver == "hostap" ) | ||
109 | new OHostAPMonitoringInterface( wiface, false ); | ||
110 | else | ||
111 | if ( driver == "wlan-ng" ) | ||
112 | new OWlanNGMonitoringInterface( wiface, false ); | ||
113 | else | ||
108 | { | 114 | { |
109 | printf( "Unknown driver. Exiting\n" ); | 115 | printf( "Unknown driver. Exiting\n" ); |
110 | exit( -1 ); | 116 | exit( -1 ); |
111 | } | 117 | } |
112 | 118 | ||
113 | // enable monitoring mode | 119 | // enable monitoring mode |
114 | printf( "Enabling monitor mode...\n" ); | 120 | printf( "Enabling monitor mode...\n" ); |
115 | //wiface->setMonitorMode( true ); | 121 | wiface->setMode( "monitor" ); |
116 | 122 | ||
117 | // open a packet capturer | 123 | // open a packet capturer |
118 | cap = new OPacketCapturer(); | 124 | cap = new OPacketCapturer(); |
119 | cap->open( interface ); | 125 | cap->open( interface ); |
120 | if ( !cap->isOpen() ) | 126 | if ( !cap->isOpen() ) |
121 | { | 127 | { |
@@ -128,18 +134,26 @@ public: | |||
128 | 134 | ||
129 | // start channel hopper | 135 | // start channel hopper |
130 | //wiface->setChannelHopping( 1000 ); | 136 | //wiface->setChannelHopping( 1000 ); |
131 | 137 | ||
132 | // connect | 138 | // connect |
133 | connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 139 | connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
140 | // timer | ||
141 | startTimer( 1000 ); | ||
134 | 142 | ||
135 | } | 143 | } |
136 | 144 | ||
137 | ~Wellenreiter() {}; | 145 | ~Wellenreiter() {}; |
138 | 146 | ||
139 | public slots: | 147 | public slots: |
148 | virtual void timerEvent(QTimerEvent* e) | ||
149 | { | ||
150 | wiface->setChannel( channel++ ); | ||
151 | if ( channel == 14 ) channel = 1; | ||
152 | } | ||
153 | |||
140 | void receivePacket(OPacket* p) | 154 | void receivePacket(OPacket* p) |
141 | { | 155 | { |
142 | if (!p) | 156 | if (!p) |
143 | { | 157 | { |
144 | printf( "(empty packet received)\n" ); | 158 | printf( "(empty packet received)\n" ); |
145 | return; | 159 | return; |
@@ -200,12 +214,13 @@ public slots: | |||
200 | return; | 214 | return; |
201 | } | 215 | } |
202 | } | 216 | } |
203 | private: | 217 | private: |
204 | OPacketCapturer* cap; | 218 | OPacketCapturer* cap; |
205 | OWirelessNetworkInterface* wiface; | 219 | OWirelessNetworkInterface* wiface; |
220 | int channel; | ||
206 | }; | 221 | }; |
207 | 222 | ||
208 | 223 | ||
209 | int main( int argc, char** argv ) | 224 | int main( int argc, char** argv ) |
210 | { | 225 | { |
211 | Wellenreiter w( argc, argv ); | 226 | Wellenreiter w( argc, argv ); |
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 | |||
@@ -3,11 +3,11 @@ CONFIG = qt warn_on debug | |||
3 | HEADERS = | 3 | HEADERS = |
4 | SOURCES = miniwellenreiter.cpp | 4 | SOURCES = miniwellenreiter.cpp |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
7 | LIBS += -lopiecore2 -lopienet2 | 7 | LIBS += -lopiecore2 -lopienet2 |
8 | TARGET = miniwellenreiter | 8 | TARGET = miniwellenreiter |
9 | MOC_DIR = moc | 9 | MOC_DIR = moc |
10 | OBJECTS_DIR = obj | 10 | OBJECTS_DIR = obj |
11 | 11 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
13 | 13 | ||
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 | |||
@@ -107,21 +107,22 @@ int main( int argc, char** argv ) | |||
107 | qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); | 107 | qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); |
108 | 108 | ||
109 | */ | 109 | */ |
110 | 110 | ||
111 | // monitor test | 111 | // monitor test |
112 | 112 | ||
113 | /* | 113 | |
114 | 114 | ||
115 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 115 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
116 | iface->setMode( "monitor" ); | 116 | iface->setMode( "monitor" ); |
117 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 117 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
118 | 118 | ||
119 | sleep( 1 ); */ | 119 | sleep( 1 ); |
120 | 120 | ||
121 | iface->setMode( "master" ); | 121 | iface->setChannel( 1 ); |
122 | iface->setMode( "managed" ); | ||
122 | 123 | ||
123 | //sleep( 1 ); | 124 | //sleep( 1 ); |
124 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); | 125 | qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); |
125 | 126 | ||
126 | /*iface->setMode( "adhoc" ); | 127 | /*iface->setMode( "adhoc" ); |
127 | sleep( 1 ); | 128 | sleep( 1 ); |