Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

main.cpp

Go to the documentation of this file.
00001 #include <opie2/odebug.h>
00002 #include <opie2/obluetooth.h>
00003 
00004 using namespace Opie::Core;
00005 using namespace Opie::Bluez;
00006 
00007 int main( int argc, char** argv )
00008 {
00009     OBluetooth* sys = OBluetooth::instance();
00010     OBluetooth::InterfaceIterator it = sys->iterator();
00011 
00012     while( it.current() )
00013     {
00014         odebug << "APP: Bluetooth host controller interface '" << it.current()->name() << "' has MAC '" << it.current()->macAddress() << "'" << oendl;
00015         odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl;
00016         //odebug << "APP: Trying to toggle state..." << oendl;
00017         //it.current()->setUp( !it.current()->isUp() );
00018         //odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl;
00019 
00020         odebug << "APP: scanning..." << oendl;
00021 
00022         OBluetoothInterface::DeviceIterator devit = it.current()->neighbourhood();
00023         while( devit.current() )
00024         {
00025             odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has MAC '" << devit.current()->macAddress() << "'" << oendl;
00026             odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has class '" << devit.current()->deviceClass() << "'" << oendl;
00027             ++devit;
00028         }
00029 
00030         ++it;
00031     }
00032     return 0;
00033 }
00034 

Generated on Sat Nov 5 16:15:25 2005 for OPIE by  doxygen 1.4.2