summaryrefslogtreecommitdiff
path: root/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
Unidiff
Diffstat (limited to 'libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
index f801b15..fd68772 100644
--- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
+++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
@@ -16,33 +16,46 @@ int main( int argc, char** argv )
16 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); 16 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() );
17 if ( it.current()->isWireless() ) 17 if ( it.current()->isWireless() )
18 { 18 {
19 OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); 19 OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() );
20 qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); 20 qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() );
21 qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); 21 qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() );
22 qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() );
23 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); 22 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() );
24 23
25 //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) 24 //if ( iface->mode() == OWirelessNetworkInterface::adhoc )
26 //{ 25 //{
27 qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP() ); 26 qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP() );
28 //} 27 //}
29 28
30 // try to set monitor mode 29 // nickname
30 qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() );
31 iface->setNickName( "MyNickName" );
32 if ( iface->nickName() != "MyNickName" )
33 qDebug( "DEMO: Warning! Can't change nickname" );
34 else
35 qDebug( "DEMO: Nickname change successful." );
36
37 // operation mode
38 qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() );
39 iface->setMode( "adhoc" );
40 if ( iface->mode() != "adhoc" )
41 qDebug( "DEMO: Warning! Can't change operation mode" );
42 else
43 qDebug( "DEMO: Operation Mode change successful." );
44
45 iface->setMode( "managed" );
31 46
32 /* 47 /*
33 48
34 // first some wrong calls to check if this is working 49 // first some wrong calls to check if this is working
35 iface->setPrivate( "seppel", 10 ); 50 iface->setPrivate( "seppel", 10 );
36 iface->setPrivate( "monitor", 0 ); 51 iface->setPrivate( "monitor", 0 );
37 52
38 // now the real deal 53 // now the real deal
39 iface->setPrivate( "monitor", 2, 2, 3 ); 54 iface->setPrivate( "monitor", 2, 2, 3 );
40 55
41 */
42
43 // trying to set hw address to 12:34:56:AB:CD:EF 56 // trying to set hw address to 12:34:56:AB:CD:EF
44 57
45 /* 58 /*
46 59
47 OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); 60 OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" );
48 iface->setUp( false ); 61 iface->setUp( false );