author | mickeyl <mickeyl> | 2003-08-27 13:01:30 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-08-27 13:01:30 (UTC) |
commit | 38538a71248a16ff964870909965cf233c796bf5 (patch) (side-by-side diff) | |
tree | fbd528a3403b26e1fd45349a1825c2d65bb1584c | |
parent | ea7aa8c3779be1e5aadb550559b3a463859ba104 (diff) | |
download | opie-38538a71248a16ff964870909965cf233c796bf5.zip opie-38538a71248a16ff964870909965cf233c796bf5.tar.gz opie-38538a71248a16ff964870909965cf233c796bf5.tar.bz2 |
add a channel example
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 6326ad0..607d8f1 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -25,48 +25,56 @@ int main( int argc, char** argv ) qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) //{ qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP() ); //} // nickname qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); iface->setNickName( "MyNickName" ); if ( iface->nickName() != "MyNickName" ) qDebug( "DEMO: Warning! Can't change nickname" ); else qDebug( "DEMO: Nickname change successful." ); // operation mode qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); iface->setMode( "adhoc" ); if ( iface->mode() != "adhoc" ) qDebug( "DEMO: Warning! Can't change operation mode" ); else qDebug( "DEMO: Operation Mode change successful." ); + // RF channel + qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); + iface->setChannel( 1 ); + if ( iface->channel() != 1 ) + qDebug( "DEMO: Warning! Can't change RF channel" ); + else + qDebug( "DEMO: RF channel change successful." ); + iface->setMode( "managed" ); /* // first some wrong calls to check if this is working iface->setPrivate( "seppel", 10 ); iface->setPrivate( "monitor", 0 ); // now the real deal iface->setPrivate( "monitor", 2, 2, 3 ); // trying to set hw address to 12:34:56:AB:CD:EF /* OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); iface->setUp( false ); iface->setMacAddress( addr ); iface->setUp( true ); qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); */ |