-rw-r--r-- | libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp | 2 | ||||
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp index eb2e8e8..f1966c1 100644 --- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp +++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp | |||
@@ -1,35 +1,37 @@ | |||
1 | #include <qdict.h> | 1 | #include <qdict.h> |
2 | #include <qsocketnotifier.h> | 2 | #include <qsocketnotifier.h> |
3 | #include <qstring.h> | 3 | #include <qstring.h> |
4 | #include <opie2/onetwork.h> | 4 | #include <opie2/onetwork.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <opie2/opcap.h> | 6 | #include <opie2/opcap.h> |
7 | #include <cerrno> | 7 | #include <cerrno> |
8 | #include <cstdio> | 8 | #include <cstdio> |
9 | #include <cstdlib> | 9 | #include <cstdlib> |
10 | #include <cstring> | 10 | #include <cstring> |
11 | 11 | ||
12 | |||
13 | using namespace Opie::Net; | ||
12 | //======================== Station help class =============================== | 14 | //======================== Station help class =============================== |
13 | 15 | ||
14 | class Station | 16 | class Station |
15 | { | 17 | { |
16 | public: | 18 | public: |
17 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; | 19 | Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; |
18 | ~Station() {}; | 20 | ~Station() {}; |
19 | 21 | ||
20 | QString type; | 22 | QString type; |
21 | int channel; | 23 | int channel; |
22 | bool wep; | 24 | bool wep; |
23 | int beacons; | 25 | int beacons; |
24 | }; | 26 | }; |
25 | 27 | ||
26 | QDict<Station> stations; | 28 | QDict<Station> stations; |
27 | 29 | ||
28 | //======================== Application class =============================== | 30 | //======================== Application class =============================== |
29 | 31 | ||
30 | class Wellenreiter : public QApplication | 32 | class Wellenreiter : public QApplication |
31 | { | 33 | { |
32 | Q_OBJECT | 34 | Q_OBJECT |
33 | public: | 35 | public: |
34 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) | 36 | Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) |
35 | { | 37 | { |
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() ); |