Diffstat (limited to 'libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 4763316..4f8af60 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | |||
@@ -1,30 +1,32 @@ | |||
1 | #include <opie2/onetwork.h> | 1 | #include <opie2/onetwork.h> |
2 | #include <opie2/ostation.h> | 2 | #include <opie2/ostation.h> |
3 | #include <opie2/omanufacturerdb.h> | 3 | #include <opie2/omanufacturerdb.h> |
4 | 4 | ||
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | 6 | ||
7 | using namespace Opie::Net; | ||
8 | |||
7 | int main( int argc, char** argv ) | 9 | int main( int argc, char** argv ) |
8 | { | 10 | { |
9 | qDebug( "OPIE Network Demo" ); | 11 | qDebug( "OPIE Network Demo" ); |
10 | 12 | ||
11 | ONetwork* net = ONetwork::instance(); | 13 | ONetwork* net = ONetwork::instance(); |
12 | 14 | ||
13 | ONetwork::InterfaceIterator it = net->iterator(); | 15 | ONetwork::InterfaceIterator it = net->iterator(); |
14 | 16 | ||
15 | while ( it.current() ) | 17 | while ( it.current() ) |
16 | { | 18 | { |
17 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); | 19 | qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); |
18 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); | 20 | qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); |
19 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); | 21 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); |
20 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); | 22 | qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); |
21 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); | 23 | qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); |
22 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); | 24 | qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); |
23 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); | 25 | qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); |
24 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); | 26 | qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); |
25 | if ( it.current()->isWireless() ) | 27 | if ( it.current()->isWireless() ) |
26 | { | 28 | { |
27 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); | 29 | OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); |
28 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); | 30 | qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); |
29 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); | 31 | qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); |
30 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); | 32 | qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); |