-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index fc2026f..21026e1 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -1,7 +1,8 @@ #include <opie2/onetwork.h> +#include <opie2/ostation.h> #include <opie2/omanufacturerdb.h> int main( int argc, char** argv ) { qDebug( "OPIE Network Demo" ); @@ -24,13 +25,13 @@ int main( int argc, char** argv ) qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); 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() ); + 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" ) @@ -55,17 +56,24 @@ int main( int argc, char** argv ) qDebug( "DEMO: RF channel change successful." ); iface->setMode( "managed" ); // network scan - int stations = iface->scanNetwork(); - if ( stations != -1 ) + OStationList* stations = iface->scanNetwork(); + if ( stations ) { - qDebug( "DEMO: # of stations around = %d", stations ); + qDebug( "DEMO: # of stations around = %d", stations->count() ); + OStation* station; + for ( station = stations->first(); station != 0; station = stations->next() ) + { + qDebug( "DEMO: station dump following..." ); + station->dump(); + } } + else { qDebug( "DEMO: Warning! Scan didn't work!" ); } /* |