author | mickeyl <mickeyl> | 2003-03-28 15:11:52 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-28 15:11:52 (UTC) |
commit | 11304d02942e9fa493e4e80943a828f9c65f6772 (patch) (side-by-side diff) | |
tree | a0223c10c067e1afc70d15c2b82be3f3c15e41ae /libopie2/examples/opienet/onetworkdemo | |
parent | b271d575fa05cf570a1a829136517761bd47e69b (diff) | |
download | opie-11304d02942e9fa493e4e80943a828f9c65f6772.zip opie-11304d02942e9fa493e4e80943a828f9c65f6772.tar.gz opie-11304d02942e9fa493e4e80943a828f9c65f6772.tar.bz2 |
skeleton and the start of libopie2, please read README, ROADMAP and STATUS and comment...
Diffstat (limited to 'libopie2/examples/opienet/onetworkdemo') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/.cvsignore | 6 | ||||
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp | 35 | ||||
-rw-r--r-- | libopie2/examples/opienet/onetworkdemo/onetworkdemo.pro | 12 |
3 files changed, 53 insertions, 0 deletions
diff --git a/libopie2/examples/opienet/onetworkdemo/.cvsignore b/libopie2/examples/opienet/onetworkdemo/.cvsignore new file mode 100644 index 0000000..8f7300c --- a/dev/null +++ b/libopie2/examples/opienet/onetworkdemo/.cvsignore @@ -0,0 +1,6 @@ +Makefile* +moc* +*moc +*.o +~* + diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp new file mode 100644 index 0000000..7703b4c --- a/dev/null +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -0,0 +1,35 @@ +#include <opie2/onetwork.h> + +int main( int argc, char** argv ) +{ + qDebug( "OPIE Network Demo" ); + + ONetwork* net = ONetwork::instance(); + + ONetwork::InterfaceIterator it = net->iterator(); + + while ( it.current() ) + { + qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); + qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); + qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); + if ( it.current()->isWireless() ) + { + OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); + 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: Current NickName is '%s'", (const char*) iface->nickName() ); + 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() ); + //} + + } + ++it; + } + + return 0; + +} diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.pro b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.pro new file mode 100644 index 0000000..2d71aa0 --- a/dev/null +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +CONFIG = qt warn_on debug +HEADERS = +SOURCES = onetworkdemo.cpp +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lopiecore2 -lopienet2 +TARGET = onetworkdemo +MOC_DIR = moc +OBJECTS_DIR = obj + +include ( $(OPIEDIR)/include.pro ) |