summaryrefslogtreecommitdiff
path: root/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp37
1 files changed, 36 insertions, 1 deletions
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 @@
#include <opie2/onetwork.h>
#include <opie2/ostation.h>
#include <opie2/omanufacturerdb.h>
+#include <unistd.h>
+
int main( int argc, char** argv )
{
qDebug( "OPIE Network Demo" );
@@ -12,8 +14,9 @@ int main( int argc, char** argv )
while ( it.current() )
{
qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() );
+ qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() );
qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() );
qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) );
qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() );
qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) );
@@ -27,19 +30,23 @@ int main( int argc, char** argv )
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().toString() );
+ //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() );
//}
+ /*
+
// 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" )
@@ -56,8 +63,12 @@ int main( int argc, char** argv )
qDebug( "DEMO: RF channel change successful." );
iface->setMode( "managed" );
+ */
+
+ /*
+
// network scan
OStationList* stations = iface->scanNetwork();
if ( stations )
@@ -96,8 +107,32 @@ int main( int argc, char** argv )
qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() );
*/
+ // monitor test
+
+ /*
+
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
+ iface->setMode( "monitor" );
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
+
+ sleep( 1 ); */
+
+ iface->setMode( "master" );
+
+ //sleep( 1 );
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
+
+ /*iface->setMode( "adhoc" );
+ sleep( 1 );
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
+ iface->setMode( "managed" );
+ sleep( 1 );
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );
+ iface->setMode( "master" );
+ sleep( 1 );
+ qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/
}
++it;
}