-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 607d8f1..fc2026f 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | |||
@@ -43,32 +43,44 @@ int main( int argc, char** argv ) | |||
43 | iface->setMode( "adhoc" ); | 43 | iface->setMode( "adhoc" ); |
44 | if ( iface->mode() != "adhoc" ) | 44 | if ( iface->mode() != "adhoc" ) |
45 | qDebug( "DEMO: Warning! Can't change operation mode" ); | 45 | qDebug( "DEMO: Warning! Can't change operation mode" ); |
46 | else | 46 | else |
47 | qDebug( "DEMO: Operation Mode change successful." ); | 47 | qDebug( "DEMO: Operation Mode change successful." ); |
48 | 48 | ||
49 | // RF channel | 49 | // RF channel |
50 | qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); | 50 | qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); |
51 | iface->setChannel( 1 ); | 51 | iface->setChannel( 1 ); |
52 | if ( iface->channel() != 1 ) | 52 | if ( iface->channel() != 1 ) |
53 | qDebug( "DEMO: Warning! Can't change RF channel" ); | 53 | qDebug( "DEMO: Warning! Can't change RF channel" ); |
54 | else | 54 | else |
55 | qDebug( "DEMO: RF channel change successful." ); | 55 | qDebug( "DEMO: RF channel change successful." ); |
56 | 56 | ||
57 | iface->setMode( "managed" ); | 57 | iface->setMode( "managed" ); |
58 | 58 | ||
59 | // network scan | ||
60 | |||
61 | int stations = iface->scanNetwork(); | ||
62 | if ( stations != -1 ) | ||
63 | { | ||
64 | qDebug( "DEMO: # of stations around = %d", stations ); | ||
65 | } | ||
66 | else | ||
67 | { | ||
68 | qDebug( "DEMO: Warning! Scan didn't work!" ); | ||
69 | } | ||
70 | |||
59 | /* | 71 | /* |
60 | 72 | ||
61 | // first some wrong calls to check if this is working | 73 | // first some wrong calls to check if this is working |
62 | iface->setPrivate( "seppel", 10 ); | 74 | iface->setPrivate( "seppel", 10 ); |
63 | iface->setPrivate( "monitor", 0 ); | 75 | iface->setPrivate( "monitor", 0 ); |
64 | 76 | ||
65 | // now the real deal | 77 | // now the real deal |
66 | iface->setPrivate( "monitor", 2, 2, 3 ); | 78 | iface->setPrivate( "monitor", 2, 2, 3 ); |
67 | 79 | ||
68 | // trying to set hw address to 12:34:56:AB:CD:EF | 80 | // trying to set hw address to 12:34:56:AB:CD:EF |
69 | 81 | ||
70 | /* | 82 | /* |
71 | 83 | ||
72 | OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); | 84 | OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); |
73 | iface->setUp( false ); | 85 | iface->setUp( false ); |
74 | iface->setMacAddress( addr ); | 86 | iface->setMacAddress( addr ); |