summaryrefslogtreecommitdiff
path: root/libopie2/examples
Unidiff
Diffstat (limited to 'libopie2/examples') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/odebugdemo/odebugdemo.pro3
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp37
2 files changed, 38 insertions, 2 deletions
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro
index c52cd02..aa37394 100644
--- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro
+++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.pro
@@ -6,9 +6,8 @@ INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lopiecore2 7LIBS += -lopiecore2
8TARGET = odebugdemo 8TARGET = odebugdemo
9 9
10MOC_DIR = moc
11OBJECTS_DIR = obj 10OBJECTS_DIR = obj
12 11
13!contains( platform, x11 ) { 12!contains( platform, x11 ) {
14 include ( $(OPIEDIR)/include.pro ) 13 include ( $(OPIEDIR)/include.pro )
@@ -16,4 +15,6 @@ OBJECTS_DIR = obj
16 15
17contains( platform, x11 ) { 16contains( platform, x11 ) {
18 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 17 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
19} 18}
19
20MOC_DIR = moc
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
index 21026e1..06b8b19 100644
--- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
+++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
@@ -1,8 +1,10 @@
1#include <opie2/onetwork.h> 1#include <opie2/onetwork.h>
2#include <opie2/ostation.h> 2#include <opie2/ostation.h>
3#include <opie2/omanufacturerdb.h> 3#include <opie2/omanufacturerdb.h>
4 4
5#include <unistd.h>
6
5int main( int argc, char** argv ) 7int main( int argc, char** argv )
6{ 8{
7 qDebug( "OPIE Network Demo" ); 9 qDebug( "OPIE Network Demo" );
8 10
@@ -12,8 +14,9 @@ int main( int argc, char** argv )
12 14
13 while ( it.current() ) 15 while ( it.current() )
14 { 16 {
15 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); 17 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() );
18 qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() );
16 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); 19 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() );
17 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); 20 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) );
18 qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); 21 qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() );
19 qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); 22 qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) );
@@ -27,19 +30,23 @@ int main( int argc, char** argv )
27 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); 30 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() );
28 31
29 //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) 32 //if ( iface->mode() == OWirelessNetworkInterface::adhoc )
30 //{ 33 //{
31 qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); 34 //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() );
32 //} 35 //}
33 36
37 /*
38
34 // nickname 39 // nickname
35 qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); 40 qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() );
36 iface->setNickName( "MyNickName" ); 41 iface->setNickName( "MyNickName" );
37 if ( iface->nickName() != "MyNickName" ) 42 if ( iface->nickName() != "MyNickName" )
38 qDebug( "DEMO: Warning! Can't change nickname" ); 43 qDebug( "DEMO: Warning! Can't change nickname" );
39 else 44 else
40 qDebug( "DEMO: Nickname change successful." ); 45 qDebug( "DEMO: Nickname change successful." );
41 46
47 /*
48
42 // operation mode 49 // operation mode
43 qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); 50 qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() );
44 iface->setMode( "adhoc" ); 51 iface->setMode( "adhoc" );
45 if ( iface->mode() != "adhoc" ) 52 if ( iface->mode() != "adhoc" )
@@ -56,8 +63,12 @@ int main( int argc, char** argv )
56 qDebug( "DEMO: RF channel change successful." ); 63 qDebug( "DEMO: RF channel change successful." );
57 64
58 iface->setMode( "managed" ); 65 iface->setMode( "managed" );
59 66
67 */
68
69 /*
70
60 // network scan 71 // network scan
61 72
62 OStationList* stations = iface->scanNetwork(); 73 OStationList* stations = iface->scanNetwork();
63 if ( stations ) 74 if ( stations )
@@ -96,8 +107,32 @@ int main( int argc, char** argv )
96 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() );
97 108
98 */ 109 */
99 110
111 // monitor test
112
113 /*
114
115 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
116 iface->setMode( "monitor" );
117 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
118
119 sleep( 1 ); */
120
121 iface->setMode( "master" );
122
123 //sleep( 1 );
124 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
125
126 /*iface->setMode( "adhoc" );
127 sleep( 1 );
128 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
129 iface->setMode( "managed" );
130 sleep( 1 );
131 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
132 iface->setMode( "master" );
133 sleep( 1 );
134 qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/
100 135
101 } 136 }
102 ++it; 137 ++it;
103 } 138 }